diff options
author | Henning Gruendl <henning.gruendl@qt.io> | 2021-09-29 12:16:19 +0200 |
---|---|---|
committer | Henning Gründl <henning.gruendl@qt.io> | 2021-09-30 12:55:16 +0000 |
commit | 502afc754beb50d12d35b2de34cf2c9d1c5f91d4 (patch) | |
tree | b853a23512f4b254d64c4d1707c7562499144e40 | |
parent | 969d65971378e4744967ace7de2a99ada86feabf (diff) |
QmlDesigner: Fix ColorEditor gradient controls
Fix ColorEditor gradient controls not updating their value on changing
the gradient or selecting another item containing a gradient.
Task-number: QDS-5183
Change-Id: Icbec41f8db90f1e9c4ff0f3564ad6ed1df667f0f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2 files changed, 19 insertions, 3 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml index d07812f02f..8006be8ffa 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml @@ -1075,6 +1075,20 @@ SecondColumnLayout { Layout.fillWidth: true spacing: 0 + Connections { + target: ceMode + function onActivated() { + spinBox.readValue() + } + } + + Connections { + target: modelNodeBackend + function onSelectionChanged() { + spinBox.readValue() + } + } + GradientPropertySpinBox { id: spinBox implicitWidth: StudioTheme.Values.controlGap diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPropertySpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPropertySpinBox.qml index a1c3251335..65b6c14c73 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPropertySpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPropertySpinBox.qml @@ -45,6 +45,10 @@ Item { onFocusChanged: restoreCursor() + function readValue() { + spinBox.realValue = gradientLine.model.readGradientProperty(wrapper.propertyName) + } + StudioControls.RealSpinBox { id: spinBox @@ -56,9 +60,7 @@ Item { realStepSize: 1 decimals: 0 - Component.onCompleted: { - spinBox.realValue = gradientLine.model.readGradientProperty(wrapper.propertyName) - } + Component.onCompleted: wrapper.readValue() onCompressedRealValueModified: { gradientLine.model.setGradientProperty(wrapper.propertyName, spinBox.realValue) } |