summaryrefslogtreecommitdiffstats
path: root/src/Runtime/api/studio3dqml/q3dsrenderer.cpp
diff options
context:
space:
mode:
authorJanne Kangas <janne.kangas@qt.io>2019-05-14 11:02:30 +0300
committerJanne Kangas <janne.kangas@qt.io>2019-05-28 11:14:34 +0000
commit2d1bd330a141e83a7d79dcb945557d9703995081 (patch)
tree1879025fda3bc8a26ed0a972f670ec747cbd63c2 /src/Runtime/api/studio3dqml/q3dsrenderer.cpp
parent07af75cf100a21da07ba12ad0c714cdfc37091aa (diff)
Make Datainput min and max read-only
Remove setters and change signals for datainput min and max properties. These properties are not intended to be changed at runtime, and asynchronous separation of QML client side and renderer does not allow trivial tracking of these values. Min and max are now initialized at UIA load. Also fix bug where QML side did not receive UIA-specified min/max values. Change-Id: Ie04e81ea55bc4f4159c9f6989660caf9c36c49ed Task-id: QT3DS-3578 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
Diffstat (limited to 'src/Runtime/api/studio3dqml/q3dsrenderer.cpp')
-rw-r--r--src/Runtime/api/studio3dqml/q3dsrenderer.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Runtime/api/studio3dqml/q3dsrenderer.cpp b/src/Runtime/api/studio3dqml/q3dsrenderer.cpp
index a3d7b2d8..bbfee502 100644
--- a/src/Runtime/api/studio3dqml/q3dsrenderer.cpp
+++ b/src/Runtime/api/studio3dqml/q3dsrenderer.cpp
@@ -37,6 +37,7 @@
#include <QtStudio3D/private/q3dsviewersettings_p.h>
#include <QtStudio3D/private/q3dspresentation_p.h>
#include <QtStudio3D/private/studioutils_p.h>
+#include <QtStudio3D/private/q3dsdatainput_p.h>
#include <QtCore/qdebug.h>
#include <QtGui/qwindow.h>
@@ -413,11 +414,16 @@ void Q3DSRenderer::processCommands()
}
case CommandType_RequestDataInputs: {
QVariantList *requestData = new QVariantList();
- if (m_presentation) {
- const auto diList = m_presentation->dataInputs();
+ if (m_runtime) {
+ const auto diList = m_runtime->dataInputs();
- for (const auto &it : diList)
- requestData->append(QVariant::fromValue(it));
+ for (const auto &it : diList) {
+ Q3DSDataInput *newIt = new Q3DSDataInput(it, nullptr);
+ newIt->d_ptr->m_max = m_runtime->dataInputMax(it);
+ newIt->d_ptr->m_min = m_runtime->dataInputMin(it);
+
+ requestData->append(QVariant::fromValue(newIt));
+ }
}
Q_EMIT requestResponse(cmd.m_elementPath, cmd.m_commandType, requestData);