From b00b8fce540261d13fe37fae80f16f5b5459880b Mon Sep 17 00:00:00 2001
From: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Date: Tue, 12 Apr 2011 16:05:41 +0200
Subject: [PATCH] QmlDesigner.propertyEditor: bugfix for Rectangle.radius

Task-number: QTCREATORBUG-4285
Reviewed-by: Marco Bubke
---
 .../qmldesigner/propertyeditor/Qt/IntEditor.qml  | 16 ++++++++--------
 .../qmldesigner/propertyeditor/Qt/SpinBox.qml    |  6 +++++-
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/IntEditor.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/IntEditor.qml
index bc0b50f400..2fe97b5bdd 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/IntEditor.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/IntEditor.qml
@@ -31,10 +31,6 @@ QWidget {
             intEditor.backendValue === null)
             ? null : intEditor.backendValue.value;
 
-            onBackendValueValueChanged: {
-                intSlider.value = intEditor.backendValue.value;
-            }
-
             minimum: minimumValue
             maximum: maximumValue
             baseStateFlag: intEditor.baseStateFlag
@@ -54,12 +50,16 @@ QWidget {
                 minimum: minimumValue
                 maximum: maximumValue
                 singleStep: step
+                property int valueFromBackend: intEditor.backendValue.value;
 
+                onValueFromBackendChanged: {
+                    if (intSlider.maximum < valueFromBackend)
+                        intSlider.maximum = valueFromBackend;
+                    if (intSlider.minimum > valueFromBackend)
+                        intSlider.minimum = valueFromBackend;
+                    intSlider.value = valueFromBackend;
+                }
 
-                value: (backendValue == undefined
-                || backendValue == null
-                || backendValue.value == undefined
-                || backendValue.value == null) ? 0 : backendValue.value
                 onValueChanged: {
                     if (backendValue != undefined && backendValue != null)
                     backendValue.value = value;
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/SpinBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/SpinBox.qml
index 6ceb50f461..90596f2b53 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/SpinBox.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/SpinBox.qml
@@ -75,7 +75,11 @@ QWidget { //This is a special spinBox that does color coding for states
             property int valueFromBackend: spinBox.backendValue.value;
 
             onValueFromBackendChanged: {
-                readingFromBackend = true;                
+                readingFromBackend = true;
+                if (maximum < valueFromBackend)
+                    maximum = valueFromBackend;
+                if (minimum > valueFromBackend)
+                    minimum = valueFromBackend;
                 value = valueFromBackend;
                 readingFromBackend = false;
                 evaluate();
-- 
GitLab