Skip to content

Commit

Permalink
qml: Solve some random warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick J.P <patrickelectric@gmail.com>
  • Loading branch information
patrickelectric committed May 17, 2018
1 parent 597c09d commit acfda2a
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion qml/DisplaySettings.qml
Expand Up @@ -11,7 +11,7 @@ Item {
height: settingsLayout.height
width: settingsLayout.width
property var waterfallItem
property var replayItem: replayChB.checked
property bool replayItem: replayChB.checked

ColumnLayout {
id: settingsLayout
Expand Down
2 changes: 1 addition & 1 deletion qml/FirmwareUpdate.qml
Expand Up @@ -114,7 +114,7 @@ Item {
title: "Please choose a file"
folder: shortcuts.home
visible: false
property var fileName: ""
property string fileName: ""
nameFilters: ["Hex Files (*.hex)"]
onAccepted: {
console.log("You chose: " + fileDialog.fileUrls)
Expand Down
10 changes: 5 additions & 5 deletions qml/InfoPage.qml
Expand Up @@ -9,10 +9,10 @@ Item {
id: root
height: mainLayout.height
width: mainLayout.width
property var deviceType: 'No device'
property var deviceModel: 'No device'
property var deviceFirmware: 'No device'
property var deviceID: 'No device'
property string deviceType: 'No device'
property string deviceModel: 'No device'
property string deviceFirmware: 'No device'
property string deviceID: 'No device'

ColumnLayout {
id: mainLayout
Expand Down Expand Up @@ -60,7 +60,7 @@ Item {
ColumnLayout {
Text {
z: 1
text: 'Version: <b>' + (GitTag == "" ? "No tags!" : GitTag)
text: 'Version: <b>' + (GitTag === "" ? "No tags!" : GitTag)
color: Style.textColor
textFormat: Text.RichText
}
Expand Down
4 changes: 2 additions & 2 deletions qml/MainMenu.qml
Expand Up @@ -32,7 +32,7 @@ Item {
}

// Do not connect if no valid type or input
if(conntype.currentIndex < 0 && first != "" && second != "") {
if(conntype.currentIndex < 0 && first !== "" && second !== "") {
return;
}

Expand Down Expand Up @@ -75,7 +75,7 @@ Item {
Layout.columnSpan: 3
value: ping.pollFrequency;
onValueChanged: {
if (ping.pollFrequency != value) {
if (ping.pollFrequency !== value) {
ping.pollFrequency = value
}
}
Expand Down
2 changes: 1 addition & 1 deletion qml/MainPage.qml
Expand Up @@ -133,7 +133,7 @@ Item {
stepSize: 1
to: ping.link.packageSize
onValueChanged: {
if(ping.link.packageIndex != value) {
if(ping.link.packageIndex !== value) {
ping.link.packageIndex = value
ping.link.start()
}
Expand Down
2 changes: 1 addition & 1 deletion qml/Ping1DVisualizer.qml
Expand Up @@ -12,7 +12,7 @@ Item {
property var protocol

onWidthChanged: {
if(chart.Layout.minimumWidth == chart.width) {
if(chart.Layout.minimumWidth === chart.width) {
waterfall.width = width - chart.width
}
}
Expand Down
2 changes: 1 addition & 1 deletion qml/PingImage.qml
Expand Up @@ -5,7 +5,7 @@ Item {
id: root

property var source: undefined
property var selected: false
property bool selected: false

Image {
id: image
Expand Down
12 changes: 6 additions & 6 deletions qml/PingItem.qml
Expand Up @@ -19,18 +19,18 @@ Item {
property bool pingpong: false
property bool smartVisibility: false
property bool spin: false
property var animationType: Easing.Linear
property var clicked: false
property int animationType: Easing.Linear
property bool clicked: false
property var color: hideItem ? colorUnselected : colorSelected
property var colorSelected: Style.isDark ? Qt.rgba(0,0,0,0.75) : Qt.rgba(1,1,1,0.75)
property var colorUnselected: Style.isDark ? Qt.rgba(0,0,0,0.5) : Qt.rgba(1,1,1,0.5)
property var finalAngle: 180
property real finalAngle: 180
property var finalAngleValue: spin && !pingpong ? 360 : finalAngle
property var hoverParent: undefined
property var icon: undefined
property var item: null
property var marginMult: 1.05
property var startAngle: 0
property real marginMult: 1.05
property real startAngle: 0

onItemChanged: {
if(item == null) {
Expand Down Expand Up @@ -150,7 +150,7 @@ Item {
height: item != null ? item.height*marginMult : 0
width: item != null ? item.width*marginMult : 0
color: pingItem.color
property var hide: true
property bool hide: true

onOpacityChanged: {
item.opacity = itemRect.opacity
Expand Down
2 changes: 1 addition & 1 deletion qml/PingLogger.qml
Expand Up @@ -6,7 +6,7 @@ import Logger 1.0
Item {
id: root

property var scrollLockEnabled: true
property bool scrollLockEnabled: true

ListView {
property bool loadComplete: false
Expand Down
4 changes: 2 additions & 2 deletions qml/PingRelease.qml
Expand Up @@ -12,7 +12,7 @@ Item {
xmlhttp.onreadystatechange=function() {
//code for debug
//print(xmlhttp.status, xmlhttp.readyState)
if (xmlhttp.readyState == XMLHttpRequest.DONE && xmlhttp.status == 200) {
if (xmlhttp.readyState === XMLHttpRequest.DONE && xmlhttp.status == 200) {
handleJson(xmlhttp.responseText);
}
}
Expand All @@ -28,7 +28,7 @@ Item {
// Check for release tag v0.0
// Test release is t0.0
var releaseTagRx
if(GitTag[0] == 't') {
if(GitTag[0] === 't') {
releaseTagRx = /(t)\d+\.\d+/
print('Running test version:')
} else {
Expand Down
2 changes: 1 addition & 1 deletion qml/Style.qml
Expand Up @@ -9,7 +9,7 @@ QtObject {
property string dark: "dark"
property string light: "light"
property bool isDark: true
property var theme: Material.Dark
property int theme: Material.Dark

function useLightStyle() {
theme = Material.Light
Expand Down
18 changes: 9 additions & 9 deletions qml/ValueReadout.qml
Expand Up @@ -4,15 +4,15 @@ import QtQuick.Layouts 1.3

Item {
id: root
property var value: 0
property var units: "m"
property var precision: 2
property var margin: 10
property var depth: -1
property var strength: -1
property var confidence: 0
property var parentWidth: 0
property var parentHeight: 0
property int value: 0
property string units: "m"
property int precision: 2
property int margin: 10
property int depth: -1
property int strength: -1
property int confidence: 0
property int parentWidth: 0
property int parentHeight: 0
x: margin

width: mainLayout.width
Expand Down

0 comments on commit acfda2a

Please sign in to comment.