diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/RectangleColorGroupBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/RectangleColorGroupBox.qml index 79dafeccdba..14edc0afb37 100644 --- a/share/qtcreator/qmldesigner/propertyeditor/Qt/RectangleColorGroupBox.qml +++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/RectangleColorGroupBox.qml @@ -48,6 +48,8 @@ GroupBox { property variant colorAlpha: colorGroupBox.alpha property bool hasGradient: backendValues.gradient.isInModel + property bool gradientIsBinding: backendValues.gradient.isBound + onHasGradientChanged: { print("onGradientInModelChanged") if (backendValues.gradient.isInModel) { @@ -75,7 +77,7 @@ GroupBox { isSetup = true; gradientLine.active = false; colorGroupBox.setSolidButtonChecked = true; - if (backendValues.gradient.isInModel) { + if (backendValues.gradient.isInModel && !gradientIsBinding) { colorGroupBox.setGradientButtonChecked = true; gradientLine.active = true; gradientLine.setupGradient(); @@ -117,6 +119,8 @@ GroupBox { } ColorGroupBox { + enabled: !gradientIsBinding + opacity: gradientIsBinding ? 0.7 : 1 id: colorGroupBox caption: qsTr("Rectangle") finished: finishedNotify diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.cpp b/src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.cpp index 25668cd25e7..3f356ff317c 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/gradientlineqmladaptor.cpp @@ -85,6 +85,9 @@ void GradientLineQmlAdaptor::setupGradient() if (!modelNode.isValid()) return; + if (modelNode.hasBindingProperty(gradientName())) + return; + if (modelNode.hasProperty(gradientName())) { //gradient exists ModelNode gradientNode = modelNode.nodeProperty(gradientName()).modelNode();