summaryrefslogtreecommitdiffstats
path: root/src/runtime
diff options
context:
space:
mode:
authorAntti Määttä <antti.maatta@qt.io>2019-11-14 09:13:39 +0200
committerAntti Määttä <antti.maatta@qt.io>2019-11-20 16:09:00 +0200
commitc4d0de4f1c2d20a10abfb6f385ba1efa3b0f9a1e (patch)
tree86a372a85befa8530127b458646d9a20ff39fdfd /src/runtime
parenta0570efd0bb4f424d763818b5dfca1cffadc6c5c (diff)
Allow setting timeline value when element is about to activate
Task-number: QT3DS-4001 Change-Id: I9fbb1367999d2a3e3bea6520f9e59a820ef50c28 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/Qt3DSComponentManager.cpp2
-rw-r--r--src/runtime/Qt3DSElementSystem.h8
-rw-r--r--src/runtime/Qt3DSQmlEngine.cpp2
3 files changed, 10 insertions, 2 deletions
diff --git a/src/runtime/Qt3DSComponentManager.cpp b/src/runtime/Qt3DSComponentManager.cpp
index 8f33ec8..8849b5b 100644
--- a/src/runtime/Qt3DSComponentManager.cpp
+++ b/src/runtime/Qt3DSComponentManager.cpp
@@ -366,7 +366,7 @@ void CComponentManager::GoToTime(TElement *inComponent, const TTimeUnit inTime)
{
if (inComponent == NULL)
return;
- if (inComponent->GetActive() == false) {
+ if (!inComponent->GetActive() && !inComponent->AboutToActivate()) {
qCCritical(qt3ds::INVALID_OPERATION)
<< "Runtime: Attempt to goto time on inactive component!";
return;
diff --git a/src/runtime/Qt3DSElementSystem.h b/src/runtime/Qt3DSElementSystem.h
index 2784420..4eda166 100644
--- a/src/runtime/Qt3DSElementSystem.h
+++ b/src/runtime/Qt3DSElementSystem.h
@@ -444,6 +444,14 @@ namespace runtime {
void SetActive(bool inValue) { SetFlag(Q3DStudio::ELEMENTFLAG_GLOBALACTIVE, inValue); }
bool GetActive() const { return m_Flags.IsActive(); }
+ // Return true if we are about to activate, but have not yet been activated
+ bool AboutToActivate() const
+ {
+ if (!IsDirty())
+ return false;
+ return IsExplicitActive();
+ }
+
void SetPickEnabled(bool inValue)
{
SetFlag(Q3DStudio::ELEMENTFLAG_PICKENABLED, inValue);
diff --git a/src/runtime/Qt3DSQmlEngine.cpp b/src/runtime/Qt3DSQmlEngine.cpp
index 994354b..5ab5c10 100644
--- a/src/runtime/Qt3DSQmlEngine.cpp
+++ b/src/runtime/Qt3DSQmlEngine.cpp
@@ -1968,7 +1968,7 @@ bool CQmlEngineImpl::GetSlideInfo(const char *element, int &currentIndex, int &p
void CQmlEngineImpl::GotoTime(const char *component, const Q3DStudio::FLOAT time)
{
TElement *theTarget = getTarget(component);
- if (theTarget && theTarget->GetActive()) {
+ if (theTarget && (theTarget->GetActive() || theTarget->AboutToActivate())) {
UVariant theArg1;
UVariant theArg2;