summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaj Grönholm <kaj.gronholm@qt.io>2018-02-21 13:16:37 +0200
committerKaj Grönholm <kaj.gronholm@qt.io>2018-02-26 08:03:52 +0000
commit5a79216363e5208d4f40108948dd191978a65f0d (patch)
tree378987490d596fcbd893ff0b38453f1b6518dbfc
parent4cc86c178ba35c7769f1019253441e3352a3e957 (diff)
Slide view highlight to follow active slidev1.1.0-rc3v1.1.0
During playback highlight to follow presentation active slide. Task-number: QT3DS-1195 Change-Id: I874227e4f91c32044b21edb7aee2227c2b494028 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r--src/Authoring/Studio/Palettes/Slide/SlideModel.cpp10
-rw-r--r--src/Authoring/Studio/Palettes/Slide/SlideModel.h1
-rw-r--r--src/Authoring/Studio/Palettes/Slide/SlideView.cpp11
3 files changed, 21 insertions, 1 deletions
diff --git a/src/Authoring/Studio/Palettes/Slide/SlideModel.cpp b/src/Authoring/Studio/Palettes/Slide/SlideModel.cpp
index f0db7b26..308af8a1 100644
--- a/src/Authoring/Studio/Palettes/Slide/SlideModel.cpp
+++ b/src/Authoring/Studio/Palettes/Slide/SlideModel.cpp
@@ -381,5 +381,15 @@ void SlideModel::refreshSlideLabel(qt3dsdm::Qt3DSDMInstanceHandle instanceHandle
}
+// Set selected slide highlight on UI
+void SlideModel::setSelectedSlideIndex(const QModelIndex &index)
+{
+ if (!hasIndex(index.row(), index.column(), index.parent()))
+ return;
+
+ m_selectedRow = index.row();
+ Q_EMIT dataChanged(this->index(0, 0), this->index(rowCount() - 1, 0), {SelectedRole});
+}
+
diff --git a/src/Authoring/Studio/Palettes/Slide/SlideModel.h b/src/Authoring/Studio/Palettes/Slide/SlideModel.h
index da44c1c7..1de717cd 100644
--- a/src/Authoring/Studio/Palettes/Slide/SlideModel.h
+++ b/src/Authoring/Studio/Palettes/Slide/SlideModel.h
@@ -75,6 +75,7 @@ public:
int toRow);
void refreshSlideLabel(qt3dsdm::Qt3DSDMInstanceHandle instanceHandle,
qt3dsdm::Qt3DSDMPropertyHandle propertyHandle);
+ void setSelectedSlideIndex(const QModelIndex &index);
private:
bool hasSlideWithName(const QString &name) const;
diff --git a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp
index 62dbc732..5ffea440 100644
--- a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp
+++ b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp
@@ -223,8 +223,17 @@ void SlideView::OnActiveSlide(const qt3dsdm::Qt3DSDMSlideHandle &inMaster, int i
Q_UNUSED(inMaster);
qt3dsdm::ISlideSystem &theSlideSystem(*GetDoc()->GetStudioSystem()->GetSlideSystem());
- setShowMasterSlide(theSlideSystem.GetSlideIndex(inSlide) == 0);
+ int currentSlideIndex = theSlideSystem.GetSlideIndex(inSlide);
+ setShowMasterSlide(currentSlideIndex == 0);
setActiveSlide(inSlide);
+
+ // During playback update slide highlight
+ if (GetDoc()->IsPlaying()) {
+ // -1 because first slide is masterslide
+ auto index = m_SlidesModel->index(currentSlideIndex - 1, 0);
+ m_SlidesModel->setSelectedSlideIndex(index);
+ }
+
}
void SlideView::OnNewSlide(const qt3dsdm::Qt3DSDMSlideHandle &inSlide)