fix activate

slide_model.rs activate function now properly tells of the data that
was changed so that ListViews that use it as a model will reset their
data properly on changes.

The important parts were to ensure we are using the right indexes for
top_left and bottom_right. Then also ensure the roles are correct, but
I think I had that already, just went with the implementation that
CXX-Qt used in their examples.
This commit is contained in:
Chris Cochrun 2023-03-31 14:47:44 -05:00
parent bd2002ada2
commit 0f0f16e069
2 changed files with 166 additions and 9 deletions

View file

@ -74,11 +74,9 @@ Item {
target: SlideMod
function onDataChanged() {
if (active) {
previewHighlight.color = Kirigami.Theme.highlightColor;
previewSlidesList.currentIndex = index;
previewSlidesList.positionViewAtIndex(index, ListView.Center);
} else
previewHighlight.color = Kirigami.Theme.backgroundColor;
}
}
}
}