Commit 8e847749 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: removed qml warnings

Checking for undefined and null everywhere is the only way to fix this
right now
parent 771ccf06
......@@ -7,7 +7,7 @@ QCheckBox { //This is a special CheckBox that does color coding for states
property var baseStateFlag;
checkable: true;
checked: backendValue.value === undefined ? false : backendValue.value;
checked: backendValue === undefined ? false : backendValue.value;
onToggled: {
backendValue.value = checked;
}
......@@ -40,6 +40,5 @@ QCheckBox { //This is a special CheckBox that does color coding for states
backendValue: CheckBox.backendValue
y: 2
x: 0
visible: CheckBox.enabled
}
}
......@@ -6,10 +6,10 @@ QComboBox {
property var backendValue
ExtendedFunctionButton {
backendValue: ComboBox.backendValue
y: 3
x: 3
visible: CheckBox.enabled
}
}
\ No newline at end of file
ExtendedFunctionButton {
backendValue: (ComboBox.backendValue === undefined || ComboBox.backendValue === null)
? null : ComboBox.backendValue;
y: 3
x: 3
}
}
......@@ -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 var enabled
property bool enabled
minimumHeight: 22;
......@@ -38,13 +38,13 @@ QWidget { //This is a special DoubleSpinBox that does color coding for states
}
}
property bool isInModel: backendValue.isInModel
property bool isInModel: (backendValue === undefined || backendValue === null) ? false: backendValue.isInModel;
onIsInModelChanged: {
evaluate();
}
property bool isInSubState: backendValue.isInSubState
property bool isInSubState: (backendValue === undefined || backendValue === null) ? false: backendValue.isInSubState;
onIsInSubStateChanged: {
evaluate();
......@@ -53,7 +53,6 @@ QWidget { //This is a special DoubleSpinBox that does color coding for states
layout: HorizontalLayout {
QLabel {
visible: text != ""
id: label;
font.bold: true;
alignment: "Qt::AlignRight | Qt::AlignVCenter"
......@@ -64,9 +63,14 @@ QWidget { //This is a special DoubleSpinBox that does color coding for states
id: box;
decimals: 1;
keyboardTracking: false;
enabled: !backendValue.isBound && DoubleSpinBox.enabled;
enabled: (DoubleSpinBox.backendValue === undefined ||
DoubleSpinBox.backendValue === null)
? false : !backendValue.isBound && DoubleSpinBox.enabled;
property bool readingFromBackend: false;
property real valueFromBackend: DoubleSpinBox.backendValue == null ? .0 : DoubleSpinBox.backendValue.value;
property real valueFromBackend: (DoubleSpinBox.backendValue === undefined ||
DoubleSpinBox.backendValue === null)
? .0 : DoubleSpinBox.backendValue.value;
onValueFromBackendChanged: {
readingFromBackend = true;
......@@ -88,7 +92,9 @@ QWidget { //This is a special DoubleSpinBox that does color coding for states
}
ExtendedFunctionButton {
backendValue: DoubleSpinBox.backendValue
backendValue: (DoubleSpinBox.backendValue === undefined ||
DoubleSpinBox.backendValue === null)
? null : DoubleSpinBox.backendValue;
y: box.y + 4
x: box.x + 2
visible: DoubleSpinBox.enabled
......
......@@ -78,7 +78,7 @@ layout: VerticalLayout{
topMargin: 12;
IntEditor {
id: blurRadius;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.blurRadius : 0;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.blurRadius : null;
caption: "Blur Radius:"
baseStateFlag: isBaseState;
......@@ -95,7 +95,7 @@ layout: VerticalLayout{
DoubleSpinBox {
id: OpcacityEffectSpinBox;
objectName: "OpcacityEffectSpinBox";
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.opacity : 0;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.opacity : null;
minimum: 0;
maximum: 1;
singleStep: 0.1;
......@@ -130,7 +130,7 @@ layout: VerticalLayout{
topMargin: 12;
IntEditor {
id: pixelSize;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.pixelSize : 0;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.pixelSize : null;
caption: "Pixel Size:"
baseStateFlag: isBaseState;
......@@ -148,7 +148,7 @@ layout: VerticalLayout{
topMargin: 12;
IntEditor {
id: blurRadiusShadow;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.blurRadius : 0
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.blurRadius : null;
caption: "Blur Radius:"
baseStateFlag: isBaseState;
......@@ -172,7 +172,7 @@ layout: VerticalLayout{
IntEditor {
id: xOffset;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.xOffset : 0
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.xOffset : null;
caption: "x Offset: "
baseStateFlag: isBaseState;
......@@ -183,7 +183,7 @@ layout: VerticalLayout{
IntEditor {
id: yOffset;
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.yOffset : 0
backendValue: backendValues.effect.complexNode.exists ? backendValues.effect.complexNode.properties.yOffset : null;
caption: "y Offset: "
baseStateFlag: isBaseState;
......
......@@ -26,8 +26,7 @@ QToolButton {
onBackendValueChanged: {
setIcon();
}
property bool isBoundBackend: backendValue.isBound;
property bool isBoundBackend: backendValue === undefinded ? false : backendValue.isBound;
onIsBoundBackendChanged: {
setIcon();
......
......@@ -22,10 +22,15 @@ QWidget {
}
SpinBox {
backendValue: IntEditor.backendValue
backendValue: (IntEditor.backendValue === undefined ||
IntEditor.backendValue === null)
? null : IntEditor.backendValue;
minimum: minimumValue
maximum: maximumValue
baseStateFlag: IntEditor.baseStateFlag
baseStateFlag: (IntEditor.backendValue === undefined ||
IntEditor.backendValue === null)
? null : IntEditor.baseStateFlag;
}
......
......@@ -5,6 +5,7 @@ QWidget {
id: LineEdit
property var backendValue
property alias enabled: LineEdit.enabled
minimumHeight: 24;
......
......@@ -3,8 +3,6 @@ import Bauhaus 1.0
QWidget {
id: SliderWidget
visible: IntEditor.slider
//fixedWidth: 100
property alias value: slider.value
property alias singleStep: slider.singleStep
......
......@@ -9,6 +9,7 @@ QWidget { //This is a special SpinBox that does color coding for states
property alias singleStep: box.singleStep;
property alias minimum: box.minimum
property alias maximum: box.maximum
property alias enabled: SpinBox.enabled
minimumHeight: 22;
......@@ -66,8 +67,10 @@ QWidget { //This is a special SpinBox that does color coding for states
}
}
ExtendedFunctionButton {
backendValue: SpinBox.backendValue
ExtendedFunctionButton {
backendValue: (SpinBox.backendValue === undefined ||
SpinBox.backendValue === null)
? null : SpinBox.backendValue;
y: box.y + 4
x: box.x + 2
visible: SpinBox.enabled
......
......@@ -78,8 +78,9 @@ GroupBox {
ColorWidget {
visible: showStyleColor
text: "Style color:";
color: backendValues.styleColor.value;
onColorChanged: {
color: (backendValues.styleColor === undefined || backendValues.styleColor === null)
? "#000000" : backendValues.styleColor.value;
onColorChanged: {
backendValues.styleColor.value = strColor;
}
}
......
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