summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/runtime/Qt3DSApplication.cpp4
-rw-r--r--src/runtime/Qt3DSIScriptBridge.h1
-rw-r--r--src/runtime/Qt3DSQmlEngine.cpp13
3 files changed, 18 insertions, 0 deletions
diff --git a/src/runtime/Qt3DSApplication.cpp b/src/runtime/Qt3DSApplication.cpp
index f12fef9..7b4d625 100644
--- a/src/runtime/Qt3DSApplication.cpp
+++ b/src/runtime/Qt3DSApplication.cpp
@@ -2277,6 +2277,10 @@ bool AssetHandlers::handlePresentation(SApp &app, SAssetValue &asset, bool initI
thePathStr.c_str());
return false;
}
+
+ app.GetRuntimeFactory().GetScriptEngineQml()
+ .initializePresentationDataInputsAndOutputs(*thePresentationAsset.m_Presentation);
+
return true;
}
diff --git a/src/runtime/Qt3DSIScriptBridge.h b/src/runtime/Qt3DSIScriptBridge.h
index 9eedfc5..cb13fb2 100644
--- a/src/runtime/Qt3DSIScriptBridge.h
+++ b/src/runtime/Qt3DSIScriptBridge.h
@@ -202,6 +202,7 @@ public: // Components
public: // Presentation
virtual void SetPresentationAttribute(const char *presId, const char *attName,
const char *attValue) = 0;
+ virtual void initializePresentationDataInputsAndOutputs(CPresentation &presentation) = 0;
public: // Multimedia
virtual bool PlaySoundFile(const char *soundPath) = 0;
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<TElement *> inElements)
{
+ if (!m_Application)
+ return;
+
QList<TElement *> 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<TElement *> elements;
listAllElements(parent, elements);