Commit de0beff4 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: avoiding warnings

I added more checks for undefined - there should be no warnings left
parent 95a39159
......@@ -7,10 +7,10 @@ QCheckBox { //This is a special CheckBox that does color coding for states
property var baseStateFlag;
checkable: true;
checked: backendValue === undefined ? false : backendValue.value;
onToggled: {
backendValue.value = checked;
}
checked: (backendValue === undefined || backendValue === null) ? false : backendValue.value;
onToggled: {
backendValue.value = checked;
}
onBaseStateFlagChanged: {
evaluate();
......
......@@ -10,7 +10,7 @@ QWidget { //This is a special DoubleSpinBox that does color coding for states
property alias minimum: box.minimum
property alias maximum: box.maximum
property alias text: label.text
property bool enabled
property bool enabled: true
minimumHeight: 22;
......@@ -57,6 +57,7 @@ QWidget { //This is a special DoubleSpinBox that does color coding for states
font.bold: true;
alignment: "Qt::AlignRight | Qt::AlignVCenter"
maximumWidth: 80
visible: DoubleSpinBox.text != "";
}
QDoubleSpinBox {
......@@ -65,11 +66,11 @@ QWidget { //This is a special DoubleSpinBox that does color coding for states
keyboardTracking: false;
enabled: (DoubleSpinBox.backendValue === undefined ||
DoubleSpinBox.backendValue === null)
? false : !backendValue.isBound && DoubleSpinBox.enabled;
? true : !backendValue.isBound && DoubleSpinBox.enabled;
property bool readingFromBackend: false;
property real valueFromBackend: (DoubleSpinBox.backendValue === undefined ||
DoubleSpinBox.backendValue === null)
DoubleSpinBox.backendValue === null || DoubleSpinBox.backendValue.value === undefined)
? .0 : DoubleSpinBox.backendValue.value;
onValueFromBackendChanged: {
......@@ -86,9 +87,7 @@ QWidget { //This is a special DoubleSpinBox that does color coding for states
onMouseOverChanged: {
}
}
}
ExtendedFunctionButton {
......
......@@ -30,22 +30,18 @@ layout: VerticalLayout{
"DropShadow"
] }
onCurrentTextChanged: {
print("currentTextChanged before dirty");
onCurrentTextChanged: {
if (dirty) //avoid recursion;
return;
print("currentTextChanged");
if (backendValues.effect.complexNode.exists)
backendValues.effect.complexNode.remove();
if (currentText == "None") {
print("none");
;
} else if (backendValues.effect.complexNode != null) {
print("add");
backendValues.effect.complexNode.add("Qt/" + currentText);
}
}
......
......@@ -18,7 +18,6 @@ QWidget {
text: backendValue.value
onTextEdited: {
print("text edited")
backendValue.value = text
}
......
......@@ -47,7 +47,8 @@ QWidget { //This is a special SpinBox that does color coding for states
id: box;
enabled: backendValue === undefined || backendValue.isBound === undefined || backendValue.isBound === null ? false : !backendValue.isBound
property bool readingFromBackend: false;
property int valueFromBackend: SpinBox.backendValue == null ? .0 : SpinBox.backendValue.value;
property int valueFromBackend: (SpinBox.backendValue === undefined || SpinBox.backendValue == null)
? .0 : SpinBox.backendValue.value;
onValueFromBackendChanged: {
readingFromBackend = true;
......
Supports Markdown
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