Skip to content
Snippets Groups Projects
Commit 337a6564 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: avoiding binding loops in IntEditor.qml

parent 0ebb52ca
No related branches found
No related tags found
No related merge requests found
...@@ -25,12 +25,18 @@ QWidget { ...@@ -25,12 +25,18 @@ QWidget {
backendValue: (intEditor.backendValue === undefined || backendValue: (intEditor.backendValue === undefined ||
intEditor.backendValue === null) intEditor.backendValue === null)
? null : intEditor.backendValue; ? null : intEditor.backendValue;
property var backendValueValue: (intEditor.backendValue === undefined ||
intEditor.backendValue === null)
? null : intEditor.backendValue.value;
onBackendValueValueChanged: {
intSlider.value = intEditor.backendValue.value;
}
minimum: minimumValue minimum: minimumValue
maximum: maximumValue maximum: maximumValue
baseStateFlag: (intEditor.backendValue === undefined || baseStateFlag: intEditor.baseStateFlag
intEditor.backendValue === null)
? null : intEditor.baseStateFlag;
} }
...@@ -38,6 +44,7 @@ QWidget { ...@@ -38,6 +44,7 @@ QWidget {
visible: intEditor.slider visible: intEditor.slider
id: sliderWidget id: sliderWidget
QSlider { QSlider {
id: intSlider
y: sliderWidget.height / 2 - 12 y: sliderWidget.height / 2 - 12
width: sliderWidget.width width: sliderWidget.width
height: 24 height: 24
...@@ -46,15 +53,14 @@ QWidget { ...@@ -46,15 +53,14 @@ QWidget {
minimum: minimumValue minimum: minimumValue
maximum: maximumValue maximum: maximumValue
singleStep: step singleStep: step
value: (backendValue == undefined
|| backendValue == null
|| backendValue.value == undefined
|| backendValue.value == null) ? 0 : backendValue.value
onValueChanged: { onValueChanged: {
if (backendValue != undefined && backendValue != null) if (backendValue != undefined && backendValue != null)
backendValue.value = value; backendValue.value = value;
} }
onSliderPressed: { onSliderPressed: {
backendValue.lock(); backendValue.lock();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment