summaryrefslogtreecommitdiffstats
path: root/src/runtime/api/q3dswidget.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2018-04-20 11:41:53 +0200
committerAndy Nichols <andy.nichols@qt.io>2018-04-23 07:36:37 +0000
commitf220364448cd2e6023c829b6f76377567710dbc6 (patch)
tree7b43ce91efbaad522fef9881e7dc61e89f988ada /src/runtime/api/q3dswidget.cpp
parent327d52dd96b981829df62043f2525eba987c84e9 (diff)
Add Q3DSDataInput
Exposed as DataInput in the QML API. Also fixes a parsing issue with controlledproperty attributes in the Logic section. (namely that the attribute as not parsed if it was in an Add/Set). This involves some reorganizing of how the data is collected since we now need to accumulate both from the Scene and Logic sections. Also fixes cloning (Alias node) of controlledproperty data. Also adds a presentationLoaded() signal to Q3DSWidget and Q3DSSurfaceViewer because applications may want to act whenever a new scene is loaded (e.g. call setValue on some Q3DSDataInput object). Studio3D handles this internally and DataInputs magically just work, setting the values even when doing a reload or changing the source filename. Also adds a command 'datainput' to the console to allow quicker investigation of data input connections in the scene. Task-number: QT3DS-1404 Change-Id: Id2436490721e3386ba8604ca29ad4bda785521d2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/runtime/api/q3dswidget.cpp')
-rw-r--r--src/runtime/api/q3dswidget.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/api/q3dswidget.cpp b/src/runtime/api/q3dswidget.cpp
index d174b73..01463ba 100644
--- a/src/runtime/api/q3dswidget.cpp
+++ b/src/runtime/api/q3dswidget.cpp
@@ -220,6 +220,8 @@ Q3DSWidgetPrivate::~Q3DSWidgetPrivate()
void Q3DSWidgetPrivate::createEngine()
{
+ Q_Q(Q3DSWidget);
+
engine = new Q3DSEngine;
Q3DSEngine::Flags flags = Q3DSEngine::WithoutRenderAspect;
@@ -240,6 +242,8 @@ void Q3DSWidgetPrivate::createEngine()
if (!sz.isEmpty())
engine->resize(sz);
+ QObject::connect(engine, &Q3DSEngine::presentationLoaded, q, &Q3DSWidget::presentationLoaded);
+
QString err;
sourceLoaded = engine->setSource(fn, &err);
if (sourceLoaded) {