summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Authoring/Studio/Palettes/Slide/SlideView.cpp22
-rw-r--r--src/Authoring/Studio/Palettes/Slide/SlideView.h5
2 files changed, 11 insertions, 16 deletions
diff --git a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp
index bfcb2505..6f82ef9b 100644
--- a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp
+++ b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp
@@ -93,24 +93,18 @@ void SlideView::setShowMasterSlide(bool show)
theBridge->GetOrCreateGraphRoot(theRoot); // this will return the master slide
qt3dsdm::ISlideSystem *theSlideSystem = theDoc->GetStudioSystem()->GetSlideSystem();
if (m_CurrentModel != m_MasterSlideModel) {
- const auto theFind = m_MasterSlideReturnPointers.find(theNewActiveSlide);
- size_t theSlideIndex = 1;
- size_t theNumSlides = theSlideSystem->GetSlideCount(theNewActiveSlide);
- if (theFind != m_MasterSlideReturnPointers.end() && theFind->second < theNumSlides)
- theSlideIndex = theFind->second;
-
- theNewActiveSlide = theSlideSystem->GetSlideByIndex(
- theNewActiveSlide, theSlideIndex); // activate the first slide
- } else {
- int theIndex = theSlideSystem->GetActiveSlideIndex(theNewActiveSlide);
- m_MasterSlideReturnPointers[theNewActiveSlide] = theIndex;
+ if (m_MasterSlideReturnPointers.contains(theNewActiveSlide)) {
+ theNewActiveSlide = m_MasterSlideReturnPointers.value(theNewActiveSlide);
+ } else {
+ theNewActiveSlide = theSlideSystem->GetSlideByIndex(
+ theNewActiveSlide, 1); // activate the first slide;
+ }
}
// We have forced a mode change, and so we need to set the current active TC
// to be in the correct mode so our slide palette will show the correct information
- if (theNewActiveSlide.Valid()) {
+ if (theNewActiveSlide.Valid())
theDoc->NotifyActiveSlideChanged(theNewActiveSlide);
- }
Q_EMIT showMasterSlideChanged();
Q_EMIT currentModelChanged();
@@ -250,6 +244,8 @@ void SlideView::OnActiveSlide(const qt3dsdm::Qt3DSDMSlideHandle &inMaster, int i
auto index = m_SlidesModel->index(currentSlideIndex - 1, 0);
m_SlidesModel->setSelectedSlideIndex(index);
+ if (currentSlideIndex != 0)
+ m_MasterSlideReturnPointers[inMaster] = inSlide;
}
void SlideView::OnNewSlide(const qt3dsdm::Qt3DSDMSlideHandle &inSlide)
diff --git a/src/Authoring/Studio/Palettes/Slide/SlideView.h b/src/Authoring/Studio/Palettes/Slide/SlideView.h
index a1d410e1..4bf5f14f 100644
--- a/src/Authoring/Studio/Palettes/Slide/SlideView.h
+++ b/src/Authoring/Studio/Palettes/Slide/SlideView.h
@@ -29,7 +29,7 @@
#ifndef SLIDEVIEW_H
#define SLIDEVIEW_H
-#include <QQuickWidget>
+#include <QtQuickWidgets/qquickwidget.h>
#include "DispatchListeners.h"
#include "SlideModel.h"
@@ -38,7 +38,6 @@
#include "Qt3DSDMSignals.h"
#include "DispatchListeners.h"
#include "Dispatch.h"
-#include <unordered_map>
class CClientDataModelBridge;
class CDoc;
@@ -127,7 +126,7 @@ private:
QColor m_BaseColor = QColor::fromRgb(75, 75, 75);
std::vector<std::shared_ptr<qt3dsdm::ISignalConnection>>
m_Connections; /// connections to the DataModel
- typedef std::unordered_map<int, int> TIntIntMap;
+ typedef QHash<int, int> TIntIntMap;
// We need to remember which slide we were on when we entered the master slide.
// Then, when the users leave the master slide we can go back to roughly the same
// state.