[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

@ -68,7 +68,7 @@ RowLayout {
property Component menuComp: Menu {
id: paramMenu
property bool isFileAttribute: attribute.type == "File"
property bool isFileAttribute: attribute.type === "File"
property bool isFilepath: isFileAttribute && Filepath.isFile(attribute.evalValue)
MenuItem {

View file

@ -86,11 +86,11 @@ RowLayout {
// Check if attributes are compatible to create a valid connection
if( root.readOnly // cannot connect on a read-only attribute
|| drag.source.objectName != inputDragTarget.objectName // not an edge connector
|| drag.source.baseType != inputDragTarget.baseType // not the same base type
|| drag.source.nodeItem == inputDragTarget.nodeItem // connection between attributes of the same node
|| drag.source.baseType !== inputDragTarget.baseType // not the same base type
|| drag.source.nodeItem === inputDragTarget.nodeItem // connection between attributes of the same node
|| (drag.source.isList && !inputDragTarget.isList) // connection between a list and a simple attribute
|| (drag.source.isList && childrenRepeater.count) // source/target are lists but target already has children
|| drag.source.connectorType == "input" // refuse to connect an "input pin" on another one (input attr can be connected to input attr, but not the graphical pin)
|| drag.source.connectorType === "input" // refuse to connect an "input pin" on another one (input attr can be connected to input attr, but not the graphical pin)
)
{
// Refuse attributes connection
@ -235,11 +235,11 @@ RowLayout {
onEntered: {
// Check if attributes are compatible to create a valid connection
if( drag.source.objectName != outputDragTarget.objectName // not an edge connector
|| drag.source.baseType != outputDragTarget.baseType // not the same base type
|| drag.source.nodeItem == outputDragTarget.nodeItem // connection between attributes of the same node
|| drag.source.baseType !== outputDragTarget.baseType // not the same base type
|| drag.source.nodeItem === outputDragTarget.nodeItem // connection between attributes of the same node
|| (!drag.source.isList && outputDragTarget.isList) // connection between a list and a simple attribute
|| (drag.source.isList && childrenRepeater.count) // source/target are lists but target already has children
|| drag.source.connectorType == "output" // refuse to connect an output pin on another one
|| drag.source.connectorType === "output" // refuse to connect an output pin on another one
)
{
// Refuse attributes connection

View file

@ -41,7 +41,7 @@ Shape {
startY: root.startY
fillColor: "transparent"
strokeColor: "#3E3E3E"
strokeStyle: edge != undefined && ((edge.src != undefined && edge.src.isOutput) || edge.dst == undefined) ? ShapePath.SolidLine : ShapePath.DashLine
strokeStyle: edge !== undefined && ((edge.src !== undefined && edge.src.isOutput) || edge.dst === undefined) ? ShapePath.SolidLine : ShapePath.DashLine
strokeWidth: 1
// final visual width of this path (never below 1)
readonly property real visualWidth: Math.max(strokeWidth, 1)

View file

@ -67,10 +67,11 @@ Item {
/// Duplicate a node and optionally all the following ones
function duplicateNode(duplicateFollowingNodes) {
var nodes
if (duplicateFollowingNodes) {
var nodes = uigraph.duplicateNodesFrom(uigraph.selectedNodes)
nodes = uigraph.duplicateNodesFrom(uigraph.selectedNodes)
} else {
var nodes = uigraph.duplicateNodes(uigraph.selectedNodes)
nodes = uigraph.duplicateNodes(uigraph.selectedNodes)
}
uigraph.clearNodeSelection()
uigraph.selectedNode = nodes[0]
@ -93,7 +94,7 @@ Item {
var finalPosition = undefined
var centerPosition = false
if (mouseArea.containsMouse) {
if (uigraph.hoveredNode != null) {
if (uigraph.hoveredNode !== null) {
var node = nodeDelegate(uigraph.hoveredNode)
finalPosition = Qt.point(node.mousePosition.x + node.x, node.mousePosition.y + node.y)
} else {
@ -124,7 +125,7 @@ Item {
fit();
}
else if (event.key === Qt.Key_Delete) {
if (event.modifiers == Qt.AltModifier) {
if (event.modifiers === Qt.AltModifier) {
uigraph.removeNodesFrom(uigraph.selectedNodes);
}
else {
@ -132,15 +133,15 @@ Item {
}
}
else if (event.key === Qt.Key_D) {
duplicateNode(event.modifiers == Qt.AltModifier);
duplicateNode(event.modifiers === Qt.AltModifier);
}
else if (event.key === Qt.Key_C && event.modifiers == Qt.ControlModifier) {
else if (event.key === Qt.Key_C && event.modifiers === Qt.ControlModifier) {
copyNodes();
}
else if (event.key === Qt.Key_V && event.modifiers == Qt.ControlModifier) {
else if (event.key === Qt.Key_V && event.modifiers === Qt.ControlModifier) {
pasteNodes();
}
else if (event.key == Qt.Key_Tab) {
else if (event.key === Qt.Key_Tab) {
event.accepted = true;
if (mouseArea.containsMouse) {
newNodeMenu.spawnPosition = mouseArea.mapToItem(draggable, mouseArea.mouseX, mouseArea.mouseY);
@ -329,7 +330,7 @@ Item {
Repeater {
id: nodeMenuRepeater
model: searchBar.text != "" ? Object.values(newNodeMenu.menuKeys) : undefined
model: searchBar.text !== "" ? Object.values(newNodeMenu.menuKeys) : undefined
// create Menu items from available items
delegate: menuItemDelegateComponent
@ -337,7 +338,7 @@ Item {
// Dynamically add the menu categories
Instantiator {
model: !(searchBar.text != "") ? Object.keys(newNodeMenu.parseCategories()).sort() : undefined
model: !(searchBar.text !== "") ? Object.keys(newNodeMenu.parseCategories()).sort() : undefined
onObjectAdded: newNodeMenu.insertMenu(index+1, object ) // add sub-menu under the search bar
onObjectRemoved: newNodeMenu.removeMenu(object)
@ -392,10 +393,10 @@ Item {
delegate: Edge {
property var src: root._attributeToDelegate[edge.src]
property var dst: root._attributeToDelegate[edge.dst]
property bool isValidEdge: src != undefined && dst != undefined
property bool isValidEdge: src !== undefined && dst !== undefined
visible: isValidEdge
property bool inFocus: containsMouse || (edgeMenu.opened && edgeMenu.currentEdge == edge)
property bool inFocus: containsMouse || (edgeMenu.opened && edgeMenu.currentEdge === edge)
edge: object
color: edge.dst === root.edgeAboutToBeRemoved ? "red" : inFocus ? activePalette.highlight : activePalette.text
@ -408,7 +409,7 @@ Item {
onPressed: {
const canEdit = !edge.dst.node.locked
if(event.button == Qt.RightButton)
if(event.button === Qt.RightButton)
{
if(canEdit && (event.modifiers & Qt.AltModifier)) {
uigraph.removeEdge(edge)
@ -600,7 +601,7 @@ Item {
onAttributePinDeleted: unregisterAttributePin(attribute, pin)
onPressed: {
if (mouse.button == Qt.LeftButton) {
if (mouse.button === Qt.LeftButton) {
if (mouse.modifiers & Qt.ControlModifier && !(mouse.modifiers & Qt.AltModifier)) {
if (mainSelected && selected) {
// left clicking a selected node twice with control will deselect it
@ -617,7 +618,7 @@ Item {
} else if (!mainSelected && !selected) {
uigraph.clearNodeSelection()
}
} else if (mouse.button == Qt.RightButton) {
} else if (mouse.button === Qt.RightButton) {
if (!mainSelected && !selected) {
uigraph.clearNodeSelection()
}
@ -663,7 +664,7 @@ Item {
// update all selected nodes positions with this node that is being dragged
for (var i = 0; i < nodeRepeater.count; i++) {
var otherNode = nodeRepeater.itemAt(i)
if (uigraph.selectedNodes.contains(otherNode.node) && otherNode.node != node) {
if (uigraph.selectedNodes.contains(otherNode.node) && otherNode.node !== node) {
otherNode.x = otherNode.node.x + (x - node.x)
otherNode.y = otherNode.node.y + (y - node.y)
}

View file

@ -100,8 +100,8 @@ Item {
function isFileAttributeBaseType(attribute) {
// ATM, only File attributes are meant to be connected
// TODO: review this if we want to connect something else
return attribute.type == "File"
|| (attribute.type == "ListAttribute" && attribute.desc.elementDesc.type == "File")
return attribute.type === "File"
|| (attribute.type === "ListAttribute" && attribute.desc.elementDesc.type === "File")
}
// Used to generate list of node's label sharing the same uid
@ -480,22 +480,22 @@ Item {
width: parent.width
sourceComponent: AttributePin {
id: inPin
id: inParamsPin
nodeItem: root
property real globalX: root.x + nodeAttributes.x + inputParamsRect.x + paramLoader.x + inPin.x
property real globalY: root.y + nodeAttributes.y + inputParamsRect.y + paramLoader.y + inPin.y
property real globalX: root.x + nodeAttributes.x + inputParamsRect.x + paramLoader.x + inParamsPin.x
property real globalY: root.y + nodeAttributes.y + inputParamsRect.y + paramLoader.y + inParamsPin.y
height: isFullyActive ? childrenRect.height : 0
Behavior on height { PropertyAnimation {easing.type: Easing.Linear} }
visible: (height == childrenRect.height)
attribute: object
readOnly: root.readOnly || object.isReadOnly
Component.onCompleted: attributePinCreated(attribute, inPin)
Component.onDestruction: attributePinDeleted(attribute, inPin)
Component.onCompleted: attributePinCreated(attribute, inParamsPin)
Component.onDestruction: attributePinDeleted(attribute, inParamsPin)
onPressed: root.pressed(mouse)
onEdgeAboutToBeRemoved: root.edgeAboutToBeRemoved(input)
onChildPinCreated: attributePinCreated(childAttribute, inPin)
onChildPinDeleted: attributePinDeleted(childAttribute, inPin)
onChildPinCreated: attributePinCreated(childAttribute, inParamsPin)
onChildPinDeleted: attributePinDeleted(childAttribute, inParamsPin)
}
}
}

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})
}

View file

@ -70,7 +70,7 @@ DelegateModel {
function find(value, roleName) {
for(var i = 0; i < filteredItems.count; ++i)
{
if(modelData(filteredItems.get(i), roleName) == value)
if(modelData(filteredItems.get(i), roleName) === value)
return i
}
return -1

View file

@ -74,8 +74,8 @@ Item {
for (var i = 0; i < root.json.checkers.length; i++) {
// Only load ccheckers for the current view
var checker = root.json.checkers[i]
if (checker.viewId == viewId ||
checker.imagePath == currentImagePath) {
if (checker.viewId === viewId ||
checker.imagePath === currentImagePath) {
var cpt = Qt.createComponent("ColorCheckerEntity.qml");
var obj = cpt.createObject(root, {

View file

@ -163,14 +163,14 @@ FloatingPane {
editable: true
textFromValue: function(value, locale) {
if (value == -1) return "No Limit";
if (value == 0) return "Disable";
if (value === -1) return "No Limit";
if (value === 0) return "Disable";
return value;
}
valueFromText: function(text, locale) {
if (text == "No Limit") return -1;
if (text == "Disable") return 0;
if (text === "No Limit") return -1;
if (text === "Disable") return 0;
return Number.fromLocaleString(locale, text);
}

View file

@ -63,7 +63,7 @@ AliceVision.FloatImageViewer {
property int pointsNumber: (surface.subdivisions + 1) * (surface.subdivisions + 1);
property int index: 0;
property var idView: 0;
property int idView: 0;
clearBeforeLoad: true

View file

@ -45,7 +45,7 @@ FloatingPane {
function getGPSCoordinates(metadata)
{
// GPS data available
if(metadata && metadata["GPS:Longitude"] != undefined && metadata["GPS:Latitude"] != undefined)
if(metadata && metadata["GPS:Longitude"] !== undefined && metadata["GPS:Latitude"] !== undefined)
{
var latitude = gpsMetadataToCoordinates(metadata["GPS:Latitude"], metadata["GPS:LatitudeRef"])
var longitude = gpsMetadataToCoordinates(metadata["GPS:Longitude"], metadata["GPS:LongitudeRef"])
@ -79,11 +79,11 @@ FloatingPane {
var entry = {}
// split on ":" to get group and key
var i = key.lastIndexOf(":")
if(i == -1)
if(i === -1)
{
i = key.lastIndexOf("/")
}
if(i != -1)
if(i !== -1)
{
entry["group"] = key.substr(0, i)
entry["key"] = key.substr(i+1)
@ -190,7 +190,7 @@ FloatingPane {
sortRole: "raw"
filters: [{role: "raw", value: searchBar.text}]
delegate: RowLayout {
width: parent.width
width: parent ? parent.width : 0
Label {
text: key
leftPadding: 6
@ -289,7 +289,7 @@ FloatingPane {
anchors.right: parent.right
anchors.top: parent.top
padding: 2
visible: map.center != coordinates
visible: map.center !== coordinates
ToolButton {
font.family: MaterialIcons.fontFamily

View file

@ -28,7 +28,7 @@ AliceVision.PanoramaViewer {
}
}
property var readyToLoad: Image.Null
property int readyToLoad: Image.Null
property int subdivisionsPano: 12
@ -42,7 +42,7 @@ AliceVision.PanoramaViewer {
property bool cropFisheyePano: false
property var idSelected : -1
property int idSelected : -1
onIsHighlightableChanged:{
for (var i = 0; i < repeater.model; ++i) {
@ -53,26 +53,26 @@ AliceVision.PanoramaViewer {
property alias containsMouse: mouseAreaPano.containsMouse
property bool isRotating: false
property var lastX : 0
property var lastY: 0
property double lastX : 0
property double lastY: 0
property var xStart : 0
property var yStart : 0
property double xStart : 0
property double yStart : 0
property var previous_yaw: 0;
property var previous_pitch: 0;
property var previous_roll: 0;
property double previous_yaw: 0;
property double previous_pitch: 0;
property double previous_roll: 0;
property double yaw: 0;
property double pitch: 0;
property double roll: 0;
property var activeNode: _reconstruction.activeNodes.get('SfMTransform').node
property var activeNode: _reconstruction.activeNodes.get('SfMTransform').node;
// Yaw and Pitch in Degrees from SfMTransform node sliders
property int yawNode: activeNode.attribute("manualTransform.manualRotation.y").value;
property int pitchNode: activeNode.attribute("manualTransform.manualRotation.x").value;
property int rollNode: activeNode.attribute("manualTransform.manualRotation.z").value;
property double yawNode: activeNode ? activeNode.attribute("manualTransform.manualRotation.y").value : 0;
property double pitchNode: activeNode ? activeNode.attribute("manualTransform.manualRotation.x").value : 0;
property double rollNode: activeNode ? activeNode.attribute("manualTransform.manualRotation.z").value : 0;
//Convert angle functions
function toDegrees(radians){
@ -137,9 +137,7 @@ AliceVision.PanoramaViewer {
// Rotate Panorama
if (isRotating && isEditable) {
var nx = Math.max(0, mouse.x)
var nx = Math.min(width - 1, mouse.x)
var ny = Math.max(0, mouse.y)
var ny = Math.min(height - 1, mouse.y)
var xoffset = nx - lastX;
@ -156,17 +154,18 @@ AliceVision.PanoramaViewer {
var end_pt = Qt.vector2d(latitude_end, longitude_end)
var previous_euler = Qt.vector3d(previous_yaw, previous_pitch, previous_roll)
var result
if (mouse.modifiers & Qt.ControlModifier)
{
var result = Transformations3DHelper.updatePanoramaInPlane(previous_euler, start_pt, end_pt)
result = Transformations3DHelper.updatePanoramaInPlane(previous_euler, start_pt, end_pt)
root.pitch = result.x
root.yaw = result.y
root.roll = result.z
}
else
{
var result = Transformations3DHelper.updatePanorama(previous_euler, start_pt, end_pt)
result = Transformations3DHelper.updatePanorama(previous_euler, start_pt, end_pt)
root.pitch = result.x
root.yaw = result.y
root.roll = result.z

View file

@ -99,7 +99,7 @@ FocusScope {
// slots
Keys.onPressed: {
if(event.key == Qt.Key_F) {
if(event.key === Qt.Key_F) {
root.fit();
event.accepted = true;
}
@ -147,7 +147,7 @@ FocusScope {
// make sure the image is ready for use
if(!imgContainer.image)
return;
if(imgContainer.image.status != Image.Ready)
if(imgContainer.image.status !== Image.Ready)
return;
// for Exif orientation tags 5 to 8, a 90 degrees rotation is applied
@ -225,7 +225,7 @@ FocusScope {
return "";
for (var i = 0; i < node.attributes.count; i++) {
var attr = node.attributes.at(i);
if (attr.name == attrName) {
if (attr.name === attrName) {
let path = String(attr.value)
for (var key in patterns) {
if (patterns.hasOwnProperty(key)) {
@ -333,7 +333,7 @@ FocusScope {
{
return null;
}
if(floatImageViewerLoader.item.containsMouse == false)
if(floatImageViewerLoader.item.containsMouse === false)
{
return null;
}
@ -389,9 +389,9 @@ FocusScope {
orientationTag: imgContainer.orientationTag
xOrigin: imgContainer.width / 2
yOrigin: imgContainer.height / 2
property var fittedOnce: false
property var previousWidth: 0
property var previousHeight: 0
property bool fittedOnce: false
property int previousWidth: 0
property int previousHeight: 0
onHeightChanged: {
/* Image size is not updated through a single signal with the floatImage viewer, unlike
* the simple QML image viewer: instead of updating straight away the width and height to x and
@ -404,7 +404,7 @@ FocusScope {
* group has already been auto-fitted. If we change the group of images (when another project is
* opened, for example, and the images have a different size), then another auto-fit needs to be
* performed */
if ((!fittedOnce && imgContainer.image.status == Image.Ready && imgContainer.image.height > 0) ||
if ((!fittedOnce && imgContainer.image && imgContainer.image.status === Image.Ready && imgContainer.image.height > 0) ||
(fittedOnce && ((width > 1 && previousWidth != width) || (height > 1 && previousHeight != height)))) {
fit();
fittedOnce = true;
@ -1135,7 +1135,7 @@ FocusScope {
font.pointSize: 11
Layout.minimumWidth: 0
checkable: true
enabled: activeNode && activeNode.isComputed && _reconstruction.selectedViewId != -1
enabled: activeNode && activeNode.isComputed && _reconstruction.selectedViewId !== -1
checked: false
visible: activeNode
onEnabledChanged: {

View file

@ -63,10 +63,11 @@ Entity {
currentPosition.x = mouse.x;
currentPosition.y = mouse.y;
const dt = 0.02
const dt = 0.02;
var d;
if(panning) { // translate
var d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.03;
d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.03;
var tx = axisMX.value * root.translateSpeed * d;
var ty = axisMY.value * root.translateSpeed * d;
mouseHandler.hasMoved = true;
@ -80,7 +81,7 @@ Entity {
return;
}
if(zooming) { // zoom with alt + RMD
var d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.1;
d = (root.camera.viewCenter.minus(root.camera.position)).length() * 0.1;
var tz = axisMX.value * root.translateSpeed * d;
mouseHandler.hasMoved = true;
root.camera.translate(Qt.vector3d(0, 0, tz).times(dt), Camera.DontTranslateViewCenter)

View file

@ -344,12 +344,12 @@ FloatingPane {
text: model.label
opacity: model.valid ? 1.0 : 0.6
elide: Text.ElideMiddle
font.weight: mediaListView.currentIndex == index ? Font.DemiBold : Font.Normal
font.weight: mediaListView.currentIndex === index ? Font.DemiBold : Font.Normal
background: Rectangle {
Connections {
target: mediaLibrary
function onLoadRequest(idx) {
if(idx == index)
if(idx === index)
focusAnim.restart()
}
}

View file

@ -39,7 +39,7 @@ Entity {
return
for(var i=0; i < entity.components.length; ++i)
{
if(entity.components[i].toString().indexOf(type) != -1)
if(entity.components[i].toString().indexOf(type) !== -1)
{
//entity.components[i].enabled = false;
Scene3DHelper.removeComponent(entity, entity.components[i]);

View file

@ -88,7 +88,7 @@ FocusScope {
]
Keys.onPressed: {
if (event.key == Qt.Key_F) {
if (event.key === Qt.Key_F) {
resetCameraPosition();
}
else if(Qt.Key_1 <= event.key && event.key < Qt.Key_1 + Viewer3DSettings.renderModes.length)
@ -168,7 +168,7 @@ FocusScope {
focus: scene3D.activeFocus
onMousePressed: {
scene3D.forceActiveFocus()
if(mouse.button == Qt.LeftButton)
if(mouse.button === Qt.LeftButton)
{
if(!doubleClickTimer.running)
doubleClickTimer.restart()
@ -179,7 +179,7 @@ FocusScope {
onMouseReleased: {
if(moving)
return
if(!moved && mouse.button == Qt.RightButton)
if(!moved && mouse.button === Qt.RightButton)
{
contextMenu.popup()
}
@ -260,7 +260,7 @@ FocusScope {
]
onPressed: {
if(pick.button == Qt.LeftButton)
if(pick.button === Qt.LeftButton)
{
mainCamera.viewCenter = pick.worldIntersection;
}

View file

@ -120,7 +120,7 @@ ApplicationWindow {
{
saveFileDialog.open()
function _callbackWrapper(rc) {
if(rc == Platform.Dialog.Accepted)
if(rc === Platform.Dialog.Accepted)
fireCallback()
saveFileDialog.closed.disconnect(_callbackWrapper)
}
@ -277,6 +277,7 @@ ApplicationWindow {
case "Compatibility Issue": {
close()
compatibilityManager.open()
break
}
default: close()
}
@ -577,7 +578,7 @@ ApplicationWindow {
Menu {
id: newPipelineMenu
title: "New Pipeline"
enabled: newPipelineMenuItems.model != undefined && newPipelineMenuItems.model.length > 0
enabled: newPipelineMenuItems.model !== undefined && newPipelineMenuItems.model.length > 0
property int maxWidth: 1000
property int fullWidth: {
var result = 0;
@ -621,7 +622,7 @@ ApplicationWindow {
Menu {
id: openRecentMenu
title: "Open Recent"
enabled: recentFilesMenuItems.model != undefined && recentFilesMenuItems.model.length > 0
enabled: recentFilesMenuItems.model !== undefined && recentFilesMenuItems.model.length > 0
property int maxWidth: 1000
property int fullWidth: {
var result = 0;
@ -961,7 +962,7 @@ ApplicationWindow {
// 3D viewer
for (var i = 0; i < node.attributes.count; i++) {
var attr = node.attributes.at(i)
if(attr.isOutput && attr.desc.semantic != "image" && workspaceView.viewIn3D(attr, mouse))
if(attr.isOutput && attr.desc.semantic !== "image" && workspaceView.viewIn3D(attr, mouse))
break;
}
}