summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2018-01-29 14:15:11 +0200
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2018-02-02 09:04:37 +0000
commitd91a333c01ff2ff7f6b9f07b4dbc0dfae1615b65 (patch)
treee1003c55e73abf7756723aa59bb3e1c0d031c54e /src
parent4786888312f4dcb37c4884cf4f4f7291d3fec98e (diff)
Treat all DataInput value sets as changes
Since the local value doesn't accurately reflect the actual value of the controlled value in the presentation, we treat all value sets on DataInputs as value changes and act accordingly. Change-Id: I96adc255263a5523fe951e0a4d67c51d6f0a7043 Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io> Reviewed-by: Jere Tuliniemi <jere.tuliniemi@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/Viewer/studio3d/q3dsdatainput.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Viewer/studio3d/q3dsdatainput.cpp b/src/Viewer/studio3d/q3dsdatainput.cpp
index 132cb571..a2221fff 100644
--- a/src/Viewer/studio3d/q3dsdatainput.cpp
+++ b/src/Viewer/studio3d/q3dsdatainput.cpp
@@ -94,10 +94,13 @@ QVariant Q3DSDataInput::value() const
void Q3DSDataInput::setValue(const QVariant &value)
{
- if (value != d_ptr->m_value) {
- d_ptr->setValue(value);
- Q_EMIT valueChanged();
- }
+ // Since properties controlled by data inputs can change without the currect value being
+ // reflected on the value of the DataInput element, we allow setting the value to the
+ // same one it was previously and still consider it a change.
+ // For example, when controlling timeline, the value set to DataInput will only be
+ // the current value for one frame if presentation has a running animation.
+ d_ptr->setValue(value);
+ Q_EMIT valueChanged();
}
Q3DSDataInputPrivate::Q3DSDataInputPrivate(Q3DSDataInput *parent)