QmlDesigner: Fix a few warnings and errors

Change-Id: Ie25fdc100a8288cd1b10ee186ab925c0ed13ee2d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Henning Gruendl
2021-06-24 15:41:07 +02:00
committed by Tim Jenssen
parent 18f9a69f29
commit d5544c7aba
5 changed files with 19 additions and 19 deletions

View File

@@ -80,8 +80,8 @@ T.AbstractButton {
when: myButton.hovered && myButton.pressed when: myButton.hovered && myButton.pressed
PropertyChanges { PropertyChanges {
target: buttonBackground target: buttonBackground
color: StudioTheme.Values.themeControlBackgroundPressed color: StudioTheme.Values.themeControlBackgroundInteraction
border.color: StudioTheme.Values.themeInteraction border.color: StudioTheme.Values.themeControlOutlineInteraction
} }
}, },
State { State {

View File

@@ -145,7 +145,7 @@ Rectangle {
target: backgroundCard target: backgroundCard
color:StudioTheme.Values.themeInteraction color:StudioTheme.Values.themeInteraction
border.width: StudioTheme.Values.border border.width: StudioTheme.Values.border
border.color: StudioTheme.Values.themeControlBackgroundPressed border.color: StudioTheme.Values.themeControlOutlineInteraction
} }
} }
] ]

View File

@@ -52,7 +52,7 @@ Row {
if (enumString === "") if (enumString === "")
enumString = root.backendValue.value enumString = root.backendValue.value
root.origin = enumString root.origin = enumString === undefined ? "Center" : enumString
} }
} }

View File

@@ -48,7 +48,7 @@ Rectangle {
states: [ states: [
State { State {
name: "default" name: "default"
when: !mouseArea.containsMouse && !mouseArea.pressed && myControl.origin !== value when: !mouseArea.containsMouse && !mouseArea.pressed && myControl.origin !== root.value
PropertyChanges { PropertyChanges {
target: root target: root
color: StudioTheme.Values.themeTextColorDisabled // TODO color: StudioTheme.Values.themeTextColorDisabled // TODO
@@ -56,7 +56,7 @@ Rectangle {
}, },
State { State {
name: "hover" name: "hover"
when: mouseArea.containsMouse && !mouseArea.pressed && myControl.origin !== value when: mouseArea.containsMouse && !mouseArea.pressed && myControl.origin !== root.value
PropertyChanges { PropertyChanges {
target: root target: root
color: StudioTheme.Values.themeControlBackgroundInteraction // TODO color: StudioTheme.Values.themeControlBackgroundInteraction // TODO
@@ -64,7 +64,7 @@ Rectangle {
}, },
State { State {
name: "press" name: "press"
when: mouseArea.containsPress && myControl.origin !== enumValue when: mouseArea.containsPress && myControl.origin !== root.value
PropertyChanges { PropertyChanges {
target: root target: root
color: StudioTheme.Values.themeControlBackgroundInteraction // TODO color: StudioTheme.Values.themeControlBackgroundInteraction // TODO
@@ -73,7 +73,7 @@ Rectangle {
}, },
State { State {
name: "active" name: "active"
when: myControl.origin === value when: myControl.origin === root.value
PropertyChanges { PropertyChanges {
target: root target: root
color: StudioTheme.Values.themeInteraction color: StudioTheme.Values.themeInteraction

View File

@@ -46,18 +46,18 @@ Item {
implicitHeight: spinBox.height implicitHeight: spinBox.height
onFocusChanged: { onFocusChanged: {
restoreCursor(); restoreCursor()
transaction.end(); transaction.end()
} }
Component.onCompleted: { Component.onCompleted: {
spinBox.enabled = !isBlocked(backendValue.name); spinBox.enabled = backendValue === undefined ? false : !isBlocked(backendValue.name)
} }
Connections { Connections {
target: modelNodeBackend target: modelNodeBackend
function onSelectionChanged() { function onSelectionChanged() {
spinBox.enabled = !isBlocked(backendValue.name); spinBox.enabled = backendValue === undefined ? false : !isBlocked(backendValue.name)
} }
} }
@@ -65,25 +65,25 @@ Item {
id: spinBox id: spinBox
onDragStarted: { onDragStarted: {
hideCursor(); hideCursor()
transaction.start(); transaction.start()
} }
onDragEnded: { onDragEnded: {
restoreCursor(); restoreCursor()
transaction.end(); transaction.end()
} }
onDragging: holdCursorInPlace(); onDragging: holdCursorInPlace()
onRealValueModified: { onRealValueModified: {
if (transaction.active()) if (transaction.active())
commitValue(); commitValue()
} }
function commitValue() { function commitValue() {
if (spinBox.backendValue.value !== spinBox.realValue) if (spinBox.backendValue.value !== spinBox.realValue)
spinBox.backendValue.value = spinBox.realValue; spinBox.backendValue.value = spinBox.realValue
} }
property variant backendValue property variant backendValue