Commit c1850305 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.propertyEditor: crash fix

We did not handle the case that a gradient is a binding.

Change-Id: Ib6892420c6d5de7522cb2b051ff2b046ab781c14
Reviewed-on: http://codereview.qt.nokia.com/2503Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent 3e8ffed0
......@@ -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
......
......@@ -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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment