diff options
author | Jere Tuliniemi <jere.tuliniemi@qt.io> | 2019-11-04 10:50:40 +0200 |
---|---|---|
committer | Jere Tuliniemi <jere.tuliniemi@qt.io> | 2019-11-04 11:44:04 +0200 |
commit | 8803caed932cb4c5627310223a72a137ea5c99f3 (patch) | |
tree | 4abfdba40ea93ca89f2da1200104f76a71983761 | |
parent | 92e34b4a3f0448026da7934938e67aa8f759e601 (diff) |
Fix crash when queueing attributes with delayed loading
Task-number: QT3DS-3996
Change-Id: I24b96b4806cb24a92b199562d3f033ead47696d1
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r-- | src/runtime/Qt3DSQmlElementHelper.cpp | 3 | ||||
-rw-r--r-- | src/runtime/Qt3DSQmlEngine.cpp | 18 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/runtime/Qt3DSQmlElementHelper.cpp b/src/runtime/Qt3DSQmlElementHelper.cpp index fdc67ad..1ddd1c8 100644 --- a/src/runtime/Qt3DSQmlElementHelper.cpp +++ b/src/runtime/Qt3DSQmlElementHelper.cpp @@ -254,7 +254,8 @@ bool CQmlElementHelper::SetAttribute(TElement *theElement, const char *theAttNam bool force = false; // Fail if trying to change the activation state of an object in another slide - if (theAttributeKey.m_Hash == Q3DStudio::ATTRIBUTE_EYEBALL) { + if (theAttributeKey.m_Hash == Q3DStudio::ATTRIBUTE_EYEBALL + && theElement->GetBelongedPresentation()->GetActivityZone()) { CPresentation *presentation = static_cast<CPresentation *>( theElement->GetBelongedPresentation()); ISlideSystem &slideSystem = presentation->GetSlideSystem(); diff --git a/src/runtime/Qt3DSQmlEngine.cpp b/src/runtime/Qt3DSQmlEngine.cpp index c7e6e88..e5378a6 100644 --- a/src/runtime/Qt3DSQmlEngine.cpp +++ b/src/runtime/Qt3DSQmlEngine.cpp @@ -608,14 +608,16 @@ void CQmlEngineImpl::Initialize() bool queueAttributeChange(TElement *target, const char *attName, const char *value) { - TElement *componentElement = target->GetActivityZone().GetItemTimeParent(*target); - TComponent *component = static_cast<TComponent *>(componentElement); - // Queue changes to elements inside components that have not been activated even once - if (component->GetCurrentSlide() == 0) { - IPresentation *presentation = target->GetBelongedPresentation(); - presentation->GetComponentManager().queueChange(componentElement, target, - attName, value); - return true; + if (target->m_BelongedPresentation->GetActivityZone()) { + TElement *componentElement = target->GetActivityZone().GetItemTimeParent(*target); + TComponent *component = static_cast<TComponent *>(componentElement); + // Queue changes to elements inside components that have not been activated even once + if (component->GetCurrentSlide() == 0) { + IPresentation *presentation = target->GetBelongedPresentation(); + presentation->GetComponentManager().queueChange(componentElement, target, + attName, value); + return true; + } } return false; } |