[qml] Optimize QML files and fix syntax warnings

This commit addresses warnings that were raised by QtCreator's linter:
- IDs declared more than once
- variables declared more than once in the same scope
- type coercions
- variables declared as "var" when their type is known
- unclosed "case" in switch-case
This commit is contained in:
Candice Bentéjac 2023-01-27 11:00:51 +01:00
parent 8c2a7bba0f
commit 091346cbb8
18 changed files with 99 additions and 97 deletions

View file

@ -164,9 +164,9 @@ Item {
Layout.preferredHeight: parent.height
horizontalAlignment: Label.AlignHCenter
verticalAlignment: Label.AlignVCenter
color: object == uigraph.selectedNode ? Colors.sysPalette.window : Colors.sysPalette.text
color: object === uigraph.selectedNode ? Colors.sysPalette.window : Colors.sysPalette.text
background: Rectangle {
color: object == uigraph.selectedNode ? Colors.sysPalette.text : bgColor
color: object === uigraph.selectedNode ? Colors.sysPalette.text : bgColor
}
MouseArea {
@ -182,9 +182,9 @@ Item {
Layout.preferredHeight: parent.height
horizontalAlignment: Label.AlignHCenter
verticalAlignment: Label.AlignVCenter
color: object == uigraph.selectedNode ? Colors.sysPalette.window : Colors.sysPalette.text
color: object === uigraph.selectedNode ? Colors.sysPalette.window : Colors.sysPalette.text
background: Rectangle {
color: object == uigraph.selectedNode ? Colors.sysPalette.text : bgColor
color: object === uigraph.selectedNode ? Colors.sysPalette.text : bgColor
}
MouseArea {
@ -200,9 +200,9 @@ Item {
Layout.preferredHeight: parent.height
horizontalAlignment: Label.AlignHCenter
verticalAlignment: Label.AlignVCenter
color: object == uigraph.selectedNode ? Colors.sysPalette.window : Colors.sysPalette.text
color: object === uigraph.selectedNode ? Colors.sysPalette.window : Colors.sysPalette.text
background: Rectangle {
color: object == uigraph.selectedNode ? Colors.sysPalette.text : bgColor
color: object === uigraph.selectedNode ? Colors.sysPalette.text : bgColor
}
MouseArea {
@ -218,9 +218,9 @@ Item {
Layout.preferredHeight: parent.height
horizontalAlignment: Label.AlignHCenter
verticalAlignment: Label.AlignVCenter
color: object == uigraph.selectedNode ? Colors.sysPalette.window : Colors.sysPalette.text
color: object === uigraph.selectedNode ? Colors.sysPalette.window : Colors.sysPalette.text
background: Rectangle {
color: object == uigraph.selectedNode ? Colors.sysPalette.text : bgColor
color: object === uigraph.selectedNode ? Colors.sysPalette.text : bgColor
}
MouseArea {
@ -236,9 +236,9 @@ Item {
Layout.preferredHeight: parent.height
horizontalAlignment: Label.AlignHCenter
verticalAlignment: Label.AlignVCenter
color: object == uigraph.selectedNode ? Colors.sysPalette.window : Colors.sysPalette.text
color: object === uigraph.selectedNode ? Colors.sysPalette.window : Colors.sysPalette.text
background: Rectangle {
color: object == uigraph.selectedNode ? Colors.sysPalette.text : bgColor
color: object === uigraph.selectedNode ? Colors.sysPalette.text : bgColor
}
MouseArea {
@ -271,7 +271,7 @@ Item {
color: Colors.getChunkColor(object, {"NONE": bgColor})
radius: 3
border.width: 2
border.color: chunkList.node == uigraph.selectedNode ? Colors.sysPalette.text : Colors.getChunkColor(object, {"NONE": bgColor})
border.color: chunkList.node === uigraph.selectedNode ? Colors.sysPalette.text : Colors.getChunkColor(object, {"NONE": bgColor})
}