Commit 4079b29f authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.propertyEditor: fixes for spinboxes

Fixing mouse repeat.
Task-number: QTCREATORBUG-4990

Change-Id: I5a41bac8e11d874672b70fd518d8a90f8ffe56e9
Reviewed-on: http://codereview.qt.nokia.com/132Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@nokia.com>
parent 4154f815
......@@ -87,12 +87,17 @@ QWidget { //This is a special doubleSpinBox that does color coding for states
onValueFromBackendChanged: {
readingFromBackend = true;
value = valueFromBackend
if (value !== valueFromBackend)
value = valueFromBackend
readingFromBackend = false;
if (!focus)
evaluate();
}
onValueChanged: {
doubleSpinBox.backendValue.value = value;
if (doubleSpinBox.backendValue.value !== value)
doubleSpinBox.backendValue.value = value;
}
onMouseOverChanged: {
......@@ -100,10 +105,12 @@ QWidget { //This is a special doubleSpinBox that does color coding for states
}
onFocusChanged: {
if (focus)
if (focus) {
transaction.start();
else
} else {
transaction.end();
evaluate();
}
}
}
}
......
......@@ -62,12 +62,12 @@ QWidget { //This is a special spinBox that does color coding for states
ColorScheme { id:scheme; }
layout: HorizontalLayout {
spacing: 4
spacing: 4
QSpinBox {
property alias backendValue: spinBox.backendValue
toolTip: backendValue.isBound ? backendValue.expression : ""
enabled: !backendValue.isBound && spinBox.enabled;
enabled: !backendValue.isBound && spinBox.enabled;
keyboardTracking: false;
id: box;
......@@ -80,20 +80,26 @@ QWidget { //This is a special spinBox that does color coding for states
maximum = valueFromBackend;
if (minimum > valueFromBackend)
minimum = valueFromBackend;
value = valueFromBackend;
if (valueFromBackend !== value)
value = valueFromBackend;
readingFromBackend = false;
evaluate();
if (!focus)
evaluate();
}
onValueChanged: {
backendValue.value = value;
onValueChanged: {
if (backendValue.value !== value)
backendValue.value = value;
}
onFocusChanged: {
if (focus)
transaction.start();
else
transaction.end();
if (focus) {
transaction.start();
} else {
transaction.end();
evaluate();
}
}
onEditingFinished: {
}
......
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