OSDN Git Service

QmlDesigner.propertyEditor: bug fix for color editing
authorThomas Hartmann <Thomas.Hartmann@nokia.com>
Thu, 24 Mar 2011 15:31:24 +0000 (16:31 +0100)
committerThomas Hartmann <Thomas.Hartmann@nokia.com>
Thu, 24 Mar 2011 15:31:47 +0000 (16:31 +0100)
Task-Nr: QTCREATORBUG-4069

share/qtcreator/qmldesigner/propertyeditor/Qt/RectangleColorGroupBox.qml

index 4aa57d4..9f10117 100644 (file)
@@ -13,6 +13,31 @@ GroupBox {
 
     property bool hasBorder
 
+    property variant colorAlpha: colorGroupBox.alpha
+    property bool hasGradient: backendValues.gradient.isInModel
+
+    onHasGradientChanged: {
+        print("onGradientInModelChanged")
+        if (backendValues.gradient.isInModel) {
+            print("inmodel")
+            colorGroupBox.setGradientButtonChecked = true;
+        } else {
+            print("else")
+            if (colorGroupBox.alpha == 0)
+                colorGroupBox.setNoneButtonChecked = true;
+            else
+                colorGroupBox.setSolidButtonChecked = true;
+        }
+    }
+
+    onColorAlphaChanged: {
+          if (backendValues.gradient.isInModel)
+              return
+        if (colorGroupBox.alpha == 0)
+            colorGroupBox.setNoneButtonChecked = true;
+        else
+            colorGroupBox.setSolidButtonChecked = true;
+    }
 
     onSelectionFlagChanged: {
         isSetup = true;