From abe5db305a987dc5a5d4fcdd3e6f5ee97057b426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20M=C3=A4=C3=A4tt=C3=A4?= Date: Mon, 17 Jun 2019 10:27:09 +0300 Subject: 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 Reviewed-by: Miikka Heikkinen --- src/runtime/Qt3DSElementSystem.cpp | 13 +++++++++++-- 1 file 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(); } } -- cgit v1.2.3