From 861990264452d6ab9e52134740b6dc57b58d7ba4 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Fri, 8 Sep 2023 14:55:48 -0500 Subject: [PATCH] using the C++ proxy function to get item from Rust Model QMAP_QSTRING_QVARIANT doesn't automatically convert to a QVariantMap in QML. So we have to run it through C++ to make things work right. --- src/qml/presenter/MainWindow.qml | 5 +++-- src/qml/presenter/PreviewSlideListDelegate.qml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/qml/presenter/MainWindow.qml b/src/qml/presenter/MainWindow.qml index f2b8ebf..d336ae0 100644 --- a/src/qml/presenter/MainWindow.qml +++ b/src/qml/presenter/MainWindow.qml @@ -146,7 +146,8 @@ Controls.Page { SlideHelper { id: slideHelper } function changeServiceItem(index) { - const item = ServiceItemModel.getItem(index); + console.log("change-service-item: " + index); + const item = ServiceItemC.getRust(index, ServiceItemModel); currentServiceItem = index; const slideId = SlideModel.findSlideIdFromServItm(index); currentSlide = slideId; @@ -198,7 +199,7 @@ Controls.Page { /* SlideMod.activate(index); */ presentation.textIndex = 0; console.log("Slide changed to: ", item.imageBackground); - activeServiceItem = ServiceItemModel.getItem(currentServiceItem).name; + activeServiceItem = ServiceItemC.getRust(currentServiceItem, ServiceItemModel).name; } function loopVideo() { diff --git a/src/qml/presenter/PreviewSlideListDelegate.qml b/src/qml/presenter/PreviewSlideListDelegate.qml index 7e23760..7715218 100644 --- a/src/qml/presenter/PreviewSlideListDelegate.qml +++ b/src/qml/presenter/PreviewSlideListDelegate.qml @@ -68,7 +68,7 @@ Item { anchors.topMargin: Kirigami.Units.smallSpacing anchors.rightMargin: Kirigami.Units.smallSpacing * 2 elide: Text.ElideRight - text: ServiceItemModel.getItem(serviceItemId).name + text: ServiceItemC.getRust(serviceItemId, ServiceItemModel).name font.bold: true }