diff options
author | Janne Kangas <janne.kangas@qt.io> | 2019-05-14 11:02:30 +0300 |
---|---|---|
committer | Janne Kangas <janne.kangas@qt.io> | 2019-05-28 11:14:34 +0000 |
commit | 2d1bd330a141e83a7d79dcb945557d9703995081 (patch) | |
tree | 1879025fda3bc8a26ed0a972f670ec747cbd63c2 /src/Runtime/api/studio3d/q3dspresentation.cpp | |
parent | 07af75cf100a21da07ba12ad0c714cdfc37091aa (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/studio3d/q3dspresentation.cpp')
-rw-r--r-- | src/Runtime/api/studio3d/q3dspresentation.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Runtime/api/studio3d/q3dspresentation.cpp b/src/Runtime/api/studio3d/q3dspresentation.cpp index 8370dbb6..5b55608d 100644 --- a/src/Runtime/api/studio3d/q3dspresentation.cpp +++ b/src/Runtime/api/studio3d/q3dspresentation.cpp @@ -672,14 +672,17 @@ void Q3DSPresentationPrivate::requestResponseHandler(CommandType commandType, vo // Check and append to QML-side list if the (UIA) presentation has additional datainputs // that are not explicitly defined in QML code. auto receivedDI = response->at(i).value<Q3DSDataInput *>(); + // For QML behind async command queue, we cache min/max values in addition + // to name, in order to be able to return values initially set in UIA file (in QML + // getters). if (!m_dataInputs.contains(receivedDI->name())) { - // For QML behind async command queue, we cache min/max values in addition - // to name, in order to be able to return values initially set in UIA file (in QML - // setter/getters). auto newDI = new Q3DSDataInput(receivedDI->name(), nullptr); newDI->d_ptr->m_min = receivedDI->d_ptr->m_min; newDI->d_ptr->m_max = receivedDI->d_ptr->m_max; registerDataInput(newDI); + } else { + m_dataInputs[receivedDI->name()]->d_ptr->m_min = receivedDI->d_ptr->m_min; + m_dataInputs[receivedDI->name()]->d_ptr->m_max = receivedDI->d_ptr->m_max; } } delete response; |