making items select and activate so as to follow the presentation

This commit is contained in:
Chris Cochrun 2022-10-02 07:08:56 -05:00
parent 91bb08fbf2
commit b154cca3ed
3 changed files with 16 additions and 1 deletions

View file

@ -157,6 +157,7 @@ Controls.Page {
print(item);
presentation.stopVideo();
pWindow.stopVideo();
/* presentation.itemType = item.type; */
print("Time to start changing");
@ -169,7 +170,7 @@ Controls.Page {
/* } */
presentation.textIndex = 0;
serviceItemModel.select(index);
/* serviceItemModel.select(index); */
/* presentation.changeSlide(); */
print("Slide changed to: " + item.name);

View file

@ -209,6 +209,12 @@ Item {
cursorShape: Qt.PointingHandCursor
}
/* Connections { */
/* target: serviceItemModel */
/* onDataChanged: previewSlidesList.positionViewAtIndex(index, */
/* ListView.Center) */
/* } */
}
Kirigami.WheelHandler {
id: wheelHandler

View file

@ -373,6 +373,14 @@ QVariantMap ServiceItemModel::getItem(int index) const {
}
bool ServiceItemModel::select(int id) {
for (int i = 0; i < m_items.length(); i++) {
QModelIndex idx = index(i);
ServiceItem *item = m_items[idx.row()];
item->setSelected(false);
qDebug() << "################";
qDebug() << "deselected" << item->name();
qDebug() << "################";
}
QModelIndex idx = index(id);
ServiceItem *item = m_items[idx.row()];
item->setSelected(true);