forked from qt-creator/qt-creator
QmlDesigner: Fix drag-adjusting values not ending up with correct value
When drag-adjusting e.g. brightness or position of the object in 3D edit view, the value ending up in property editor and qml doc didn't always match what was displayed on 3D edit view. This happened because ValuesModifiedCommand was compressed to 100ms intervals, but any property changes also sent ValuesChangedCommand at 16ms interval, which changed the instance value at backend, but not the model value. Fixed by comparing modified value to model value instead of instance value. Also made the 100ms compression timer singleshot, so the backend wouldn't be unnecessarily bombarded with ValuesModifiedCommand when holding the mouse still while dragging. Change-Id: If86dcd61bcf0c04735d65648e4c34d9d214c5313 Fixes: QDS-2081 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -487,6 +487,7 @@ Qt5InformationNodeInstanceServer::Qt5InformationNodeInstanceServer(NodeInstanceC
|
||||
Qt5NodeInstanceServer(nodeInstanceClient)
|
||||
{
|
||||
m_propertyChangeTimer.setInterval(100);
|
||||
m_propertyChangeTimer.setSingleShot(true);
|
||||
m_selectionChangeTimer.setSingleShot(true);
|
||||
m_renderTimer.setSingleShot(true);
|
||||
}
|
||||
|
@@ -1254,7 +1254,7 @@ void NodeInstanceView::valuesModified(const ValuesModifiedCommand &command)
|
||||
if (instance.isValid()) {
|
||||
// QmlVisualNode is needed so timeline and state are updated
|
||||
QmlVisualNode node = instance.modelNode();
|
||||
if (node.instanceValue(container.name()) != container.value())
|
||||
if (node.modelValue(container.name()) != container.value())
|
||||
node.setVariantProperty(container.name(), container.value());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user