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.
This commit is contained in:
Chris Cochrun 2023-09-08 14:55:48 -05:00
parent 31aec1ca47
commit 8619902644
2 changed files with 4 additions and 3 deletions

View file

@ -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() {

View file

@ -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
}