From 74a1bf8d89eb3a62e0803264cea14568e83dc690 Mon Sep 17 00:00:00 2001 From: Jere Tuliniemi Date: Wed, 6 May 2020 09:59:31 +0300 Subject: Fix data inputs with delayed loading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Initialize data inputs and outputs every time a presentation is loaded. Task-number: QT3DS-4105 Change-Id: If2e9a6d95cc40109cb48f4d4d8b5dc88f963fb74 Reviewed-by: Tomi Korpipää Reviewed-by: Antti Määttä --- src/runtime/Qt3DSQmlEngine.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/runtime/Qt3DSQmlEngine.cpp') diff --git a/src/runtime/Qt3DSQmlEngine.cpp b/src/runtime/Qt3DSQmlEngine.cpp index d063e5e..994f6c1 100644 --- a/src/runtime/Qt3DSQmlEngine.cpp +++ b/src/runtime/Qt3DSQmlEngine.cpp @@ -460,6 +460,7 @@ public: void GotoSlideRelative(const char *, bool, bool, const SScriptEngineGotoSlideArgs &) override; void SetPresentationAttribute(const char *, const char *, const char *) override; + void initializePresentationDataInputsAndOutputs(CPresentation &presentation); // No need to implement here, as sound playing is done in Qt3DSViewerApp bool PlaySoundFile(const char *) override { return false; } @@ -1917,6 +1918,12 @@ void CQmlEngineImpl::SetPresentationAttribute(const char *presId, const char *, } } +void CQmlEngineImpl::initializePresentationDataInputsAndOutputs(CPresentation &presentation) +{ + initializeDataInputsInPresentation(presentation, false); + initializeDataOutputsInPresentation(presentation, false); +} + void CQmlEngineImpl::GotoSlideIndex(const char *component, const Q3DStudio::INT32 slideIndex, const SScriptEngineGotoSlideArgs &inArgs) { @@ -2135,6 +2142,9 @@ void CQmlEngineImpl::initializeDataInputsInPresentation(CPresentation &presentat bool isPrimary, bool isDynamicAdd, QList inElements) { + if (!m_Application) + return; + QList elements; if (!inElements.empty()) { elements = inElements; @@ -2310,6 +2320,9 @@ void CQmlEngineImpl::initializeDataInputsInPresentation(CPresentation &presentat void CQmlEngineImpl::initializeDataOutputsInPresentation(CPresentation &presentation, bool isPrimary) { + if (!m_Application) + return; + TElement *parent = presentation.GetRoot(); QList elements; listAllElements(parent, elements); -- cgit v1.2.3