Fix type coercion warnings

This commit is contained in:
Alex Spataru 2021-09-30 23:15:32 -05:00
parent b822dc3072
commit beac88efd9
5 changed files with 24 additions and 24 deletions

View File

@ -310,7 +310,7 @@ Item {
checked: Cpp_IO_Console.echo
enabled: Cpp_IO_Manager.readWrite
onCheckedChanged: {
if (Cpp_IO_Console.echo != checked)
if (Cpp_IO_Console.echo !== checked)
Cpp_IO_Console.echo = checked
}
}
@ -328,7 +328,7 @@ Item {
Layout.alignment: Qt.AlignVCenter
checked: Cpp_IO_Console.autoscroll
onCheckedChanged: {
if (Cpp_IO_Console.autoscroll != checked)
if (Cpp_IO_Console.autoscroll !== checked)
Cpp_IO_Console.autoscroll = checked
}
}
@ -339,7 +339,7 @@ Item {
Layout.alignment: Qt.AlignVCenter
checked: Cpp_IO_Console.showTimestamp
onCheckedChanged: {
if (Cpp_IO_Console.showTimestamp != checked)
if (Cpp_IO_Console.showTimestamp !== checked)
Cpp_IO_Console.showTimestamp = checked
}
}
@ -354,7 +354,7 @@ Item {
model: Cpp_IO_Console.lineEndings()
currentIndex: Cpp_IO_Console.lineEnding
onCurrentIndexChanged: {
if (currentIndex != Cpp_IO_Console.lineEnding)
if (currentIndex !== Cpp_IO_Console.lineEnding)
Cpp_IO_Console.lineEnding = currentIndex
}
}
@ -365,7 +365,7 @@ Item {
model: Cpp_IO_Console.displayModes()
currentIndex: Cpp_IO_Console.displayMode
onCurrentIndexChanged: {
if (currentIndex != Cpp_IO_Console.displayMode)
if (currentIndex !== Cpp_IO_Console.displayMode)
Cpp_IO_Console.displayMode = currentIndex
}
}

View File

@ -119,8 +119,8 @@ Item {
Connections {
target: Cpp_JSON_Generator
function onOperationModeChanged() {
commAuto.checked = (Cpp_JSON_Generator.operationMode == 1)
commManual.checked = (Cpp_JSON_Generator.operationMode == 0)
commAuto.checked = (Cpp_JSON_Generator.operationMode === 1)
commManual.checked = (Cpp_JSON_Generator.operationMode === 0)
}
}

View File

@ -85,7 +85,7 @@ MenuBar {
sequence: "ctrl+o"
text: qsTr("Replay CSV") + "..."
onTriggered: Cpp_CSV_Player.openFile()
enabled: Cpp_JSON_Generator.operationMode == 0
enabled: Cpp_JSON_Generator.operationMode === 0
}
MenuSeparator {}
@ -145,14 +145,14 @@ MenuBar {
DecentMenuItem {
checkable: true
text: qsTr("Device sends JSON")
checked: Cpp_JSON_Generator.operationMode == 1
checked: Cpp_JSON_Generator.operationMode === 1
onTriggered: Cpp_JSON_Generator.operationMode = checked ? 1 : 0
}
DecentMenuItem {
checkable: true
text: qsTr("Load JSON from computer")
checked: Cpp_JSON_Generator.operationMode == 0
checked: Cpp_JSON_Generator.operationMode === 0
onTriggered: Cpp_JSON_Generator.operationMode = checked ? 0 : 1
}
}
@ -260,14 +260,14 @@ MenuBar {
DecentMenuItem {
checkable: true
text: qsTr("Normal (plain text)")
checked: Cpp_IO_Console.displayMode == 0
checked: Cpp_IO_Console.displayMode === 0
onTriggered: Cpp_IO_Console.displayMode = checked ? 0 : 1
}
DecentMenuItem {
checkable: true
text: qsTr("Binary (hexadecimal)")
checked: Cpp_IO_Console.displayMode == 1
checked: Cpp_IO_Console.displayMode === 1
onTriggered: Cpp_IO_Console.displayMode = checked ? 1 : 0
}
}
@ -285,21 +285,21 @@ MenuBar {
DecentMenuItem {
checkable: true
text: Cpp_IO_Console.lineEndings()[1]
checked: Cpp_IO_Console.lineEnding == 1
checked: Cpp_IO_Console.lineEnding === 1
onTriggered: Cpp_IO_Console.lineEnding = 1
}
DecentMenuItem {
checkable: true
text: Cpp_IO_Console.lineEndings()[2]
checked: Cpp_IO_Console.lineEnding == 2
checked: Cpp_IO_Console.lineEnding === 2
onTriggered: Cpp_IO_Console.lineEnding = 2
}
DecentMenuItem {
checkable: true
text: Cpp_IO_Console.lineEndings()[3]
checked: Cpp_IO_Console.lineEnding == 3
checked: Cpp_IO_Console.lineEnding === 3
onTriggered: Cpp_IO_Console.lineEnding = 3
}
}

View File

@ -60,7 +60,7 @@ MenuBar {
shortcut: "ctrl+o"
text: qsTr("Replay CSV") + "..."
onTriggered: Cpp_CSV_Player.openFile()
enabled: Cpp_JSON_Generator.operationMode == 0
enabled: Cpp_JSON_Generator.operationMode === 0
}
MenuSeparator {}
@ -120,14 +120,14 @@ MenuBar {
MenuItem {
checkable: true
text: qsTr("Device sends JSON")
checked: Cpp_JSON_Generator.operationMode == 1
checked: Cpp_JSON_Generator.operationMode === 1
onTriggered: Cpp_JSON_Generator.operationMode = checked ? 1 : 0
}
MenuItem {
checkable: true
text: qsTr("Load JSON from computer")
checked: Cpp_JSON_Generator.operationMode == 0
checked: Cpp_JSON_Generator.operationMode === 0
onTriggered: Cpp_JSON_Generator.operationMode = checked ? 0 : 1
}
}
@ -225,14 +225,14 @@ MenuBar {
MenuItem {
checkable: true
text: qsTr("Normal (plain text)")
checked: Cpp_IO_Console.displayMode == 0
checked: Cpp_IO_Console.displayMode === 0
onTriggered: Cpp_IO_Console.displayMode = checked ? 0 : 1
}
MenuItem {
checkable: true
text: qsTr("Binary (hexadecimal)")
checked: Cpp_IO_Console.displayMode == 1
checked: Cpp_IO_Console.displayMode === 1
onTriggered: Cpp_IO_Console.displayMode = checked ? 1 : 0
}
}
@ -250,21 +250,21 @@ MenuBar {
MenuItem {
checkable: true
text: Cpp_IO_Console.lineEndings()[1]
checked: Cpp_IO_Console.lineEnding == 1
checked: Cpp_IO_Console.lineEnding === 1
onTriggered: Cpp_IO_Console.lineEnding = 1
}
MenuItem {
checkable: true
text: Cpp_IO_Console.lineEndings()[2]
checked: Cpp_IO_Console.lineEnding == 2
checked: Cpp_IO_Console.lineEnding === 2
onTriggered: Cpp_IO_Console.lineEnding = 2
}
MenuItem {
checkable: true
text: Cpp_IO_Console.lineEndings()[3]
checked: Cpp_IO_Console.lineEnding == 3
checked: Cpp_IO_Console.lineEnding === 3
onTriggered: Cpp_IO_Console.lineEnding = 3
}
}

View File

@ -98,7 +98,7 @@ Window {
Layout.fillWidth: true
value: Cpp_CSV_Player.progress
onValueChanged: {
if (value != Cpp_CSV_Player.progress)
if (value !== Cpp_CSV_Player.progress)
Cpp_CSV_Player.setProgress(value)
}
}