summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@nokia.com>2010-02-16 14:44:14 +0100
committerThomas Hartmann <Thomas.Hartmann@nokia.com>2010-02-16 14:44:29 +0100
commit5262ca20615542d43e0ae7bc0620720c674f0cee (patch)
treea49d90a9aebe4598a1124268ded33568ea5241bc /share
parent0924cb1c990dc7e58782f77897b54eb22255aa39 (diff)
downloadqt-creator-5262ca20615542d43e0ae7bc0620720c674f0cee.tar.gz
QmlDesigner.propertyEditor: use RewriterTransaction to speed things up
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/qmldesigner/propertyeditor/Qt/DoubleSpinBox.qml7
-rw-r--r--share/qtcreator/qmldesigner/propertyeditor/Qt/IntEditor.qml7
-rw-r--r--share/qtcreator/qmldesigner/propertyeditor/Qt/LineEdit.qml7
-rw-r--r--share/qtcreator/qmldesigner/propertyeditor/Qt/Modifiers.qml8
-rw-r--r--share/qtcreator/qmldesigner/propertyeditor/Qt/SliderWidget.qml8
-rw-r--r--share/qtcreator/qmldesigner/propertyeditor/Qt/SpinBox.qml13
6 files changed, 44 insertions, 6 deletions
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/DoubleSpinBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/DoubleSpinBox.qml
index 96f48ad9c6..82e264b811 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/DoubleSpinBox.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/DoubleSpinBox.qml
@@ -91,6 +91,13 @@ QWidget { //This is a special doubleSpinBox that does color coding for states
onMouseOverChanged: {
}
+
+ onFocusChanged: {
+ if (focus)
+ doubleSpinBox.backendValue.lock();
+ else
+ doubleSpinBox.backendValue.unlock();
+ }
}
}
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/IntEditor.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/IntEditor.qml
index b92ac0ac2f..bb8f4cb670 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/IntEditor.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/IntEditor.qml
@@ -55,6 +55,13 @@ QWidget {
if (backendValue != undefined && backendValue != null)
backendValue.value = value;
}
+
+ onSliderPressed: {
+ backendValue.lock();
+ }
+ onSliderReleased: {
+ backendValue.unlock();
+ }
}
}
}
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/LineEdit.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/LineEdit.qml
index 42a2544985..4676663ab4 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/LineEdit.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/LineEdit.qml
@@ -20,6 +20,13 @@ QWidget {
onTextEdited: {
backendValue.value = text
}
+
+ onFocusChanged: {
+ if (focus)
+ backendValue.lock();
+ else
+ backendValue.unlock();
+ }
}
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/Modifiers.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/Modifiers.qml
index 8787d0be1b..e3143ce902 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/Modifiers.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/Modifiers.qml
@@ -43,17 +43,22 @@ GroupBox {
text: ""
id: opacitySpinBox;
backendValue: backendValues.opacity === undefined ? null : backendValues.opacity
+ property var backendValueValue: backendValues.opacity.value;
minimumWidth: 60;
minimum: 0;
maximum: 1;
singleStep: 0.1
baseStateFlag: isBaseState;
+ onBackendValueValueChanged: {
+ opacitySlider.value = backendValue.value * 100;
+ }
}
SliderWidget {
+ id: opacitySlider
minimum: 0
maximum: 100
singleStep: 5;
- value: backendValues.opacity === undefined ? 0 : (backendValues.opacity.value * 100)
+ backendValue: backendValues.opacity === undefined ? null : backendValues.opacity
onValueChanged: {
if (backendValues.opacity !== undefined)
backendValues.opacity.value = value / 100;
@@ -110,6 +115,7 @@ GroupBox {
}
SliderWidget {
id: scaleSlider;
+ backendValue: backendValues.scale;
minimum: 1;
maximum: 100;
singleStep: 1;
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/SliderWidget.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/SliderWidget.qml
index 087b2df32f..760d6d81b0 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/SliderWidget.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/SliderWidget.qml
@@ -8,6 +8,7 @@ QWidget {
property alias singleStep: localSlider.singleStep
property alias minimum: localSlider.minimum
property alias maximum: localSlider.maximum
+ property var backendValue
QSlider {
orientation: "Qt::Horizontal";
@@ -18,6 +19,13 @@ QWidget {
value: sliderWidget.value
onValueChanged: {
sliderWidget.value = value
+ }
+
+ onSliderPressed: {
+ backendValue.lock();
+ }
+ onSliderReleased: {
+ backendValue.unlock();
}
}
}
diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/SpinBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/SpinBox.qml
index afab43fb6c..a632863ad7 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/Qt/SpinBox.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/SpinBox.qml
@@ -61,11 +61,14 @@ QWidget { //This is a special spinBox that does color coding for states
onValueChanged: {
if (spinBox.backendValue != null && readingFromBackend == false)
backendValue.value = value;
- }
- onFocusChanged: {
- //extendedSwitches.active = focus;
- //extendedSwitches.backendValue = backendValue;
- }
+ }
+
+ onFocusChanged: {
+ if (focus)
+ spinBox.backendValue.lock();
+ else
+ spinBox.backendValue.unlock();
+ }
}
}