From 85b766bef44ad3ce718e41163eed642bb61ddca7 Mon Sep 17 00:00:00 2001 From: Janne Kangas Date: Fri, 26 Jul 2019 14:49:10 +0300 Subject: Add debug logging for element visibilities overridden by datainput MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Output log when an element visibility is overridden via datainput and is no longer affected by slide transitions. This helps debugging visibility issues with presentations that use both datainput and slide initial values to control element visibility. Change-Id: I56fc39ff80851a16b0b2a90ca9d4c687d71750a3 Task-id: QT3DS-3951 Reviewed-by: Tomi Korpipää Reviewed-by: Miikka Heikkinen --- src/runtime/Qt3DSActivationManager.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/runtime/Qt3DSActivationManager.cpp b/src/runtime/Qt3DSActivationManager.cpp index 7015a61..9b74ea5 100644 --- a/src/runtime/Qt3DSActivationManager.cpp +++ b/src/runtime/Qt3DSActivationManager.cpp @@ -497,7 +497,12 @@ struct STimeContext void setControlled(TActivityItem &item) { - m_ControlledList.insert(item); + if (!m_ControlledList.contains(item)) { + m_ControlledList.insert(item); + qCInfo(TRACE_INFO) << "Element" << item.m_Name.c_str() + << "visibility now controlled by datainput. " + "Visibility will no longer be affected by slide transitions."; + } } static void UpdateItemScriptStatus(SElement &inNode, bool activeAndHasScript, @@ -573,9 +578,12 @@ struct STimeContext bool parentActive = theEntry.IsParentActive(); bool wasActive = theScanNode->IsGlobalActive(); + bool isControlledByDi + = controlledList.contains(*theScanNode) && theScanNode->m_OnMaster; + // Override visibility for master slide elements that have datainput eyeball controller. - bool isActive = (controlledList.contains(*theScanNode) && theScanNode->m_OnMaster) - ? theScanNode->IsControlledActive() : theScanNode->IsGlobalActive(parentActive); + bool isActive = isControlledByDi ? theScanNode->IsControlledActive() + : theScanNode->IsGlobalActive(parentActive); bool wasChildDirty = theScanNode->m_ActivationManagerNode.m_Flags.IsChildDirty(); theScanNode->m_ActivationManagerNode.m_Flags.ClearChildDirty(); bool activateChange = isActive != wasActive; @@ -583,6 +591,9 @@ struct STimeContext if (activateChange) { HandleActivationChange(*theScanNode, activateBuffer, deactivateBuffer, scriptBuffer, inElementAccessMutex, scriptBufferRequiresSort, isActive); + } else if (isControlledByDi) { + qCInfo(TRACE_INFO) << "Element" << theScanNode->m_Name.c_str() + << "visibility persistently controlled by datainput."; } if (checkChildren && theScanNode->m_Child) { @@ -590,7 +601,11 @@ struct STimeContext theScanNodeChild = theScanNodeChild->m_Sibling) { // Override visibility for master slide elements that have datainput // eyeball controller. - if (controlledList.contains(*theScanNodeChild) && theScanNodeChild->m_OnMaster) + isControlledByDi + = controlledList.contains(*theScanNodeChild) + && theScanNodeChild->m_OnMaster; + + if (isControlledByDi) theScanNodeChild->SetExplicitActive(theScanNodeChild->IsControlledActive()); if (theScanNodeChild->IsIndependent() == false) inScanBuffer.push_back(SScanBufferEntry(theScanNodeChild, isActive)); -- cgit v1.2.3