summaryrefslogtreecommitdiffstats
path: root/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlEngine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlEngine.cpp')
-rw-r--r--src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlEngine.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlEngine.cpp b/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlEngine.cpp
index 3e741b39..ac958ea7 100644
--- a/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlEngine.cpp
+++ b/src/Runtime/ogl-runtime/src/runtime/Qt3DSQmlEngine.cpp
@@ -473,7 +473,8 @@ private:
void createComponent(QQmlComponent *component, TElement *element);
TElement *getTarget(const char *component);
void listAllElements(TElement *root, QList<TElement *> &elements);
- void initializeDataInputsInPresentation(CPresentation &presentation, bool isPrimary);
+ void initializeDataInputsInPresentation(CPresentation &presentation, bool isPrimary,
+ QList<TElement *> inElements = QList<TElement *>());
void initializeDataOutputsInPresentation(CPresentation &presentation, bool isPrimary);
// Splits down vector attributes to components as Runtime does not really
// handle vectors at this level anymore
@@ -1234,6 +1235,9 @@ void CQmlEngineImpl::createElements(const QString &parentElementPath, const QStr
createdElements << &newElem;
}
+ bool isPrimary = presentation == m_Application->GetPrimaryPresentation() ? true : false;
+ initializeDataInputsInPresentation(*presentation, isPrimary, createdElements.toList());
+
renderer->ChildrenUpdated(parentObject);
handleError();
@@ -2023,12 +2027,19 @@ void CQmlEngineImpl::listAllElements(TElement *root, QList<TElement *> &elements
}
}
+// Initializes datainput bindings in the presentation starting by default from the root element.
+// If inElements is specified, only parses the specified elements.
void CQmlEngineImpl::initializeDataInputsInPresentation(CPresentation &presentation,
- bool isPrimary)
+ bool isPrimary,
+ QList<TElement *> inElements)
{
- TElement *parent = presentation.GetRoot();
QList<TElement *> elements;
- listAllElements(parent, elements);
+ if (!inElements.empty()) {
+ elements = inElements;
+ } else {
+ TElement *parent = presentation.GetRoot();
+ listAllElements(parent, elements);
+ }
qt3ds::runtime::DataInputMap &diMap = m_Application->dataInputMap();
// #TODO: Remove below once QT3DS-3510 has been implemented in the editor