summaryrefslogtreecommitdiffstats
path: root/src/runtime
diff options
context:
space:
mode:
authorJanne Kangas <janne.kangas@qt.io>2020-01-07 09:24:44 +0200
committerJanne Kangas <janne.kangas@qt.io>2020-01-13 12:26:42 +0200
commit4a81ef40986e3903ad489a9314b1c38cd7542f86 (patch)
tree0e8213e259491c1b4ced1b96d119a5f54c6426f8 /src/runtime
parent7b5d524ab3e4cc6dd88987bd4afd2cee3054e9da (diff)
Fix SceneElement::currentSlideIndex
Fixes issue of current slide change signals not working from subpresentations. (Does not touch indexing conventions in SceneElement or Presentation.) Task-ID: QT3DS-3015 Change-Id: I74ef95d72efa1fc75674081e242c9f5526decf77 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/Qt3DSComponentManager.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/runtime/Qt3DSComponentManager.cpp b/src/runtime/Qt3DSComponentManager.cpp
index 8849b5b..1700222 100644
--- a/src/runtime/Qt3DSComponentManager.cpp
+++ b/src/runtime/Qt3DSComponentManager.cpp
@@ -100,7 +100,13 @@ void CComponentManager::GotoSlideIndex(TElement *inComponent,
const UINT8 theCurrentSlideIndex = theComponent->GetCurrentSlide();
- QString elementPath = QString::fromUtf8(inComponent->m_Path.c_str());
+ QString elementPath;
+ // Primary presentation stores elementpaths with subpresentation prefix.
+ // Prepend it here so that slide change notification is directed at a correct elementpath.
+ if (&m_Presentation != m_Presentation.GetApplication().GetPrimaryPresentation())
+ elementPath = m_Presentation.GetName() + QLatin1Char(':');
+
+ elementPath.append(QString::fromUtf8(inComponent->m_Path.c_str()));
if (inSlideExit) {
SEventCommand theEvent = { inComponent, EVENT_ONSLIDEEXIT };