summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAntti Määttä <antti.maatta@qt.io>2019-06-17 10:27:09 +0300
committerAntti Määttä <antti.maatta@qt.io>2019-06-17 10:37:40 +0300
commitabe5db305a987dc5a5d4fcdd3e6f5ee97057b426 (patch)
tree7a2efee9050242ae668728b0b282c91f119c268c /src
parent3701e1641213480228dff268b4a8b7fcb46c5213 (diff)
Fix component visibility change
We also need to update the parent time context when component becomes active. Task-number: QT3DS-3656 Change-Id: I9c2872561b950dc2b1ea215148399083ca6f8844 Reviewed-by: Janne Kangas <janne.kangas@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/Qt3DSElementSystem.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/runtime/Qt3DSElementSystem.cpp b/src/runtime/Qt3DSElementSystem.cpp
index f87f4fd..836b65b 100644
--- a/src/runtime/Qt3DSElementSystem.cpp
+++ b/src/runtime/Qt3DSElementSystem.cpp
@@ -770,10 +770,19 @@ void SElement::SetFlag(Q3DStudio::EElementFlag inFlag, bool inValue)
bool existing = m_Flags & inFlag;
if (existing != inValue && HasActivityZone()) {
m_Flags.clearOrSet(inValue, inFlag);
- if (inFlag == Q3DStudio::ELEMENTFLAG_EXPLICITACTIVE)
+ if (inFlag == Q3DStudio::ELEMENTFLAG_EXPLICITACTIVE) {
GetActivityZone().UpdateItemInfo(*this);
- else if (inFlag == Q3DStudio::ELEMENTFLAG_SCRIPTCALLBACKS)
+ if (IsComponent()) {
+ SElement *parent = m_Parent;
+ // Get out parent component
+ while (parent && parent->m_Parent && !parent->IsComponent())
+ parent = parent->m_Parent;
+ if (parent)
+ parent->GetActivityZone().UpdateItemInfo(*parent);
+ }
+ } else if (inFlag == Q3DStudio::ELEMENTFLAG_SCRIPTCALLBACKS) {
GetActivityZone().UpdateItemScriptStatus(*this);
+ }
SetDirty();
}
}