From 63f1ce29468c8c218ed14c8ffad0426c8b41a95d Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Tue, 3 Sep 2024 18:04:17 +0200 Subject: [PATCH] - Fixes some binding loops (QML). - Fixes some deprecated callback uses (QML). - Fixes missing namespace (QML). - Fixes warnings on potential null values (QML). --- qmlui/js/Math3DView.js | 2 ++ qmlui/qml/ActionsMenu.qml | 2 ++ qmlui/qml/CustomComboBox.qml | 2 +- qmlui/qml/FunctionDelegate.qml | 6 +++--- qmlui/qml/GenericButton.qml | 2 +- qmlui/qml/SimpleDesk.qml | 2 +- qmlui/qml/TreeNodeDelegate.qml | 6 +++--- qmlui/qml/fixtureeditor/FixtureEditor.qml | 8 +++++--- qmlui/qml/fixturesfunctions/2DView.qml | 10 +++++----- qmlui/qml/fixturesfunctions/3DView/3DView.qml | 10 +++++----- .../qml/fixturesfunctions/3DView/Fixture3DItem.qml | 13 +++++++------ .../qml/fixturesfunctions/3DView/Generic3DItem.qml | 2 +- .../fixturesfunctions/3DView/MultiBeams3DItem.qml | 6 +++--- .../qml/fixturesfunctions/3DView/PixelBar3DItem.qml | 8 ++++---- .../3DView/RenderShadowMapFilter.qml | 2 +- .../fixturesfunctions/3DView/SelectionEntity.qml | 2 +- .../fixturesfunctions/3DView/SelectionGeometry.qml | 2 -- .../3DView/SpotlightConeEntity.qml | 4 ++-- qmlui/qml/fixturesfunctions/3DView/StageBox.qml | 12 ++++++------ qmlui/qml/fixturesfunctions/3DView/StageRock.qml | 6 +++--- qmlui/qml/fixturesfunctions/3DView/StageSimple.qml | 6 +++--- qmlui/qml/fixturesfunctions/3DView/StageTheatre.qml | 6 +++--- qmlui/qml/fixturesfunctions/Fixture2DItem.qml | 2 +- qmlui/qml/fixturesfunctions/FixtureBrowser.qml | 4 ++-- .../fixturesfunctions/FixtureBrowserDelegate.qml | 12 ++++++++---- qmlui/qml/fixturesfunctions/FixtureNodeDelegate.qml | 6 +++--- .../qml/fixturesfunctions/FixturesAndFunctions.qml | 2 +- qmlui/qml/fixturesfunctions/LeftPanel.qml | 4 ++-- qmlui/qml/fixturesfunctions/PaletteManager.qml | 2 +- qmlui/qml/fixturesfunctions/UniverseGridView.qml | 1 + qmlui/qml/showmanager/HeaderAndCursor.qml | 2 +- qmlui/qml/showmanager/ShowManager.qml | 4 ++-- 32 files changed, 84 insertions(+), 74 deletions(-) diff --git a/qmlui/js/Math3DView.js b/qmlui/js/Math3DView.js index 2cf8d79617..a328184d9b 100644 --- a/qmlui/js/Math3DView.js +++ b/qmlui/js/Math3DView.js @@ -88,6 +88,8 @@ function lookAt(eye, center, up) function getLightDirection(transform, panTransform, tiltTransform) { + if (!transform) return Qt.vector3d(0.0,0.0,0.0) + var m = transform.matrix; if (panTransform) { m = transform.matrix.times(panTransform.matrix); diff --git a/qmlui/qml/ActionsMenu.qml b/qmlui/qml/ActionsMenu.qml index 713a28fabb..7c1251242b 100644 --- a/qmlui/qml/ActionsMenu.qml +++ b/qmlui/qml/ActionsMenu.qml @@ -109,6 +109,7 @@ Popup CustomPopupDialog { id: saveFirstPopup + width: menuRoot.width // Set width to avoid binding loops on implicit sizes title: qsTr("Your project has changes") message: qsTr("Do you wish to save the current project first?\nChanges will be lost if you don't save them.") standardButtons: Dialog.Yes | Dialog.No | Dialog.Cancel @@ -581,6 +582,7 @@ Popup PopupAbout { id: infoPopup + width: menuRoot.width // Set width to avoid binding loops on implicit sizes } } } diff --git a/qmlui/qml/CustomComboBox.qml b/qmlui/qml/CustomComboBox.qml index 691790c6e3..3162052b36 100644 --- a/qmlui/qml/CustomComboBox.qml +++ b/qmlui/qml/CustomComboBox.qml @@ -113,7 +113,7 @@ ComboBox delegate: ItemDelegate { - width: parent.width + width: parent?.width implicitHeight: delegateHeight highlighted: control.highlightedIndex === index hoverEnabled: control.hoverEnabled diff --git a/qmlui/qml/FunctionDelegate.qml b/qmlui/qml/FunctionDelegate.qml index 090ee63c8a..892fee6a56 100644 --- a/qmlui/qml/FunctionDelegate.qml +++ b/qmlui/qml/FunctionDelegate.qml @@ -103,9 +103,9 @@ Rectangle drag.target: dragItem - onPressed: funcDelegate.mouseEvent(App.Pressed, cRef.id, cRef.type, funcDelegate, mouse.modifiers) - onClicked: funcDelegate.mouseEvent(App.Clicked, cRef.id, cRef.type, funcDelegate, mouse.modifiers) - onDoubleClicked: funcDelegate.mouseEvent(App.DoubleClicked, cRef.id, cRef.type, funcDelegate, mouse.modifiers) + onPressed: (mouse) => funcDelegate.mouseEvent(App.Pressed, cRef.id, cRef.type, funcDelegate, mouse.modifiers) + onClicked: (mouse) => funcDelegate.mouseEvent(App.Clicked, cRef.id, cRef.type, funcDelegate, mouse.modifiers) + onDoubleClicked: (mouse) => funcDelegate.mouseEvent(App.DoubleClicked, cRef.id, cRef.type, funcDelegate, mouse.modifiers) } DropArea diff --git a/qmlui/qml/GenericButton.qml b/qmlui/qml/GenericButton.qml index 7a62f5db08..b1fc6bf52e 100644 --- a/qmlui/qml/GenericButton.qml +++ b/qmlui/qml/GenericButton.qml @@ -94,7 +94,7 @@ Rectangle anchors.fill: parent hoverEnabled: true acceptedButtons: Qt.LeftButton | Qt.RightButton - onClicked: btnRoot.clicked(mouse.button) + onClicked: (mouse) => btnRoot.clicked(mouse.button) onPressAndHold: { if (repetition == true) diff --git a/qmlui/qml/SimpleDesk.qml b/qmlui/qml/SimpleDesk.qml index 6b34d16b31..f63e4ab8ac 100644 --- a/qmlui/qml/SimpleDesk.qml +++ b/qmlui/qml/SimpleDesk.qml @@ -39,7 +39,7 @@ Rectangle id: channelToolLoader z: 2 - onValueChanged: simpleDesk.setValue(fixtureID, channelIndex, value) + onValueChanged: (fixtureID, channelIndex, value) => simpleDesk.setValue(fixtureID, channelIndex, value) } SplitView diff --git a/qmlui/qml/TreeNodeDelegate.qml b/qmlui/qml/TreeNodeDelegate.qml index 6d3a14d493..9ad853c5ea 100644 --- a/qmlui/qml/TreeNodeDelegate.qml +++ b/qmlui/qml/TreeNodeDelegate.qml @@ -126,9 +126,9 @@ Column drag.target: dragItem - onPressed: nodeContainer.mouseEvent(App.Pressed, cRef ? cRef.id : -1, nodeContainer.itemType, + onPressed: (mouse) => nodeContainer.mouseEvent(App.Pressed, cRef ? cRef.id : -1, nodeContainer.itemType, nodeContainer, mouse.modifiers) - onClicked: + onClicked: (mouse) => { nodeLabel.forceActiveFocus() nodeContainer.mouseEvent(App.Clicked, cRef ? cRef.id : -1, nodeContainer.itemType, @@ -143,7 +143,7 @@ Column anchors.fill: parent keys: [ nodeContainer.dropKeys ] - onDropped: + onDropped: (drop) => { console.log("Item dropped here. x: " + drop.x + " y: " + drop.y + ", items: " + drop.source.itemsList.length) nodeContainer.itemsDropped(nodePath) diff --git a/qmlui/qml/fixtureeditor/FixtureEditor.qml b/qmlui/qml/fixtureeditor/FixtureEditor.qml index 8775cb1c32..485a3a4240 100644 --- a/qmlui/qml/fixtureeditor/FixtureEditor.qml +++ b/qmlui/qml/fixtureeditor/FixtureEditor.qml @@ -49,7 +49,8 @@ Rectangle id: openDialog visible: false title: qsTr("Open a fixture definition") - currentFolder: "file://" + fixtureEditor.workingPath + // fixtureEditor may be null on exit + currentFolder: "file://" + fixtureEditor?.workingPath nameFilters: [ qsTr("Fixture definition files") + " (*.qxf)", qsTr("All files") + " (*)" ] onAccepted: @@ -70,7 +71,8 @@ Rectangle id: saveDialog visible: false title: qsTr("Save definition as...") - currentFolder: "file://" + fixtureEditor.workingPath + // fixtureEditor may be null on exit + currentFolder: "file://" + fixtureEditor?.workingPath fileMode: FileDialog.SaveFile nameFilters: [ qsTr("Fixture definition files") + " (*.qxf)", qsTr("All files") + " (*)" ] defaultSuffix: "qxf" @@ -266,7 +268,7 @@ Rectangle id: editorsRepeater model: fixtureEditor ? fixtureEditor.editorsList : null - onItemAdded: item.clicked() + onItemAdded: (index,item) => item.clicked() delegate: MenuBarEntry diff --git a/qmlui/qml/fixturesfunctions/2DView.qml b/qmlui/qml/fixturesfunctions/2DView.qml index 6c9ec0ca06..c79fce0b91 100644 --- a/qmlui/qml/fixturesfunctions/2DView.qml +++ b/qmlui/qml/fixturesfunctions/2DView.qml @@ -222,7 +222,7 @@ Rectangle property int initialXPos property int initialYPos - onPressed: + onPressed: (mouse) => { console.log("button: " + mouse.button + ", mods: " + mouse.modifiers) var itemID = View2D.itemIDAtPos(Qt.point(mouse.x, mouse.y)) @@ -256,7 +256,7 @@ Rectangle } } - onPositionChanged: + onPositionChanged: (mouse) => { if (selectionRect.visible == true) { @@ -294,7 +294,7 @@ Rectangle } } - onReleased: + onReleased: (mouse) => { if (selectionRect.visible === true && selectionRect.width && selectionRect.height) { @@ -317,7 +317,7 @@ Rectangle } } - onWheel: + onWheel: (wheel)=> { //console.log("Wheel delta: " + wheel.angleDelta.y) if (wheel.angleDelta.y > 0) @@ -353,7 +353,7 @@ Rectangle drag.threshold: 10 drag.target: parent - onReleased: + onReleased: (mouse) => { if (drag.active) { diff --git a/qmlui/qml/fixturesfunctions/3DView/3DView.qml b/qmlui/qml/fixturesfunctions/3DView/3DView.qml index 19e2aef0f9..d236c366e5 100644 --- a/qmlui/qml/fixturesfunctions/3DView/3DView.qml +++ b/qmlui/qml/fixturesfunctions/3DView/3DView.qml @@ -330,7 +330,7 @@ Rectangle projectionType: CameraLens.PerspectiveProjection fieldOfView: 45 - aspectRatio: viewSize.width / viewSize.height + aspectRatio: viewCamera.width / viewCamera.height nearPlane: 1.0 farPlane: 1000.0 position: View3D.cameraPosition @@ -360,7 +360,7 @@ Rectangle property int selGenericCount: View3D.genericSelectedCount sourceDevice: mDevice - onPressed: + onPressed: (mouse) => { directionCounter = 0 dx = 0 @@ -368,7 +368,7 @@ Rectangle startPoint = Qt.point(mouse.x, mouse.y) } - onPositionChanged: + onPositionChanged: (mouse) => { if (directionCounter < 3) { @@ -444,7 +444,7 @@ Rectangle if (!mouse.modifiers || (mouse.modifiers & Qt.ShiftModifier && direction == Qt.Horizontal)) viewCamera.panAboutViewCenter(-xDelta, Qt.vector3d(0, 1, 0)) if (!mouse.modifiers || (mouse.modifiers & Qt.ShiftModifier && direction == Qt.Vertical)) - viewCamera.tiltAboutViewCenter(yDelta, Qt.vector3d(1, 0, 0)) + viewCamera.tiltAboutViewCenter(yDelta) View3D.cameraPosition = viewCamera.position View3D.cameraUpVector = viewCamera.upVector @@ -464,7 +464,7 @@ Rectangle startPoint = Qt.point(mouse.x, mouse.y) } - onWheel: + onWheel: (wheel) => { if (wheel.angleDelta.y > 0) viewCamera.setZoom(-1) diff --git a/qmlui/qml/fixturesfunctions/3DView/Fixture3DItem.qml b/qmlui/qml/fixturesfunctions/3DView/Fixture3DItem.qml index 1ec83f1294..d0414496a1 100644 --- a/qmlui/qml/fixturesfunctions/3DView/Fixture3DItem.qml +++ b/qmlui/qml/fixturesfunctions/3DView/Fixture3DItem.qml @@ -82,10 +82,11 @@ Entity readonly property Layer spotlightScatteringLayer: Layer { } property real coneBottomRadius: distCutoff * Math.tan(cutoffAngle) + coneTopRadius - property real coneTopRadius: (0.24023 / 2) * transform.scale3D.x * 0.7 // (diameter / 2) * scale * magic number + property real coneTopRadius: !transform ? 0.0 : (0.24023 / 2) * transform.scale3D.x * 0.7 // (diameter / 2) * scale * magic number property real headLength: { + if(!transform) return 0.0; switch(meshType) { case MainView3D.NoMeshType: return 0; @@ -232,14 +233,14 @@ Entity { id: panAnim running: false - easing.type: Easing.Linear + easing.type: QQ2.Easing.Linear } QQ2.NumberAnimation on tiltRotation { id: tiltAnim running: false - easing.type: Easing.Linear + easing.type: QQ2.Easing.Linear } property Texture2D depthTex: @@ -292,7 +293,7 @@ Entity id: goboAnim running: false duration: 0 - easing.type: Easing.Linear + easing.type: QQ2.Easing.Linear from: 0 to: 360 loops: QQ2.Animation.Infinite @@ -323,7 +324,7 @@ Entity { id: eSceneLoader - onStatusChanged: + onStatusChanged: (status) => { if (status === SceneLoader.Ready) View3D.initializeFixture(itemID, fixtureEntity, eSceneLoader) @@ -341,7 +342,7 @@ Entity property var lastPos - onClicked: + onClicked: (pick) => { console.log("3D item clicked") isSelected = !isSelected diff --git a/qmlui/qml/fixturesfunctions/3DView/Generic3DItem.qml b/qmlui/qml/fixturesfunctions/3DView/Generic3DItem.qml index a4c05576c2..f7a6400f40 100644 --- a/qmlui/qml/fixturesfunctions/3DView/Generic3DItem.qml +++ b/qmlui/qml/fixturesfunctions/3DView/Generic3DItem.qml @@ -55,7 +55,7 @@ Entity id: eObjectPicker dragEnabled: true - onClicked: + onClicked: (pick) => { console.log("3D item clicked") isSelected = !isSelected diff --git a/qmlui/qml/fixturesfunctions/3DView/MultiBeams3DItem.qml b/qmlui/qml/fixturesfunctions/3DView/MultiBeams3DItem.qml index 5878c2560f..0dc4bf322e 100644 --- a/qmlui/qml/fixturesfunctions/3DView/MultiBeams3DItem.qml +++ b/qmlui/qml/fixturesfunctions/3DView/MultiBeams3DItem.qml @@ -223,8 +223,8 @@ Entity effect: sceneEffect parameters: [ - Parameter { name: "diffuse"; value: "gray" }, - Parameter { name: "specular"; value: "black" }, + Parameter { name: "diffuse"; value: Qt.color("gray") }, + Parameter { name: "specular"; value: Qt.color("black") }, Parameter { name: "shininess"; value: 1.0 }, Parameter { name: "bloom"; value: 0 } ] @@ -275,7 +275,7 @@ Entity property var lastPos - onClicked: + onClicked: (pick) => { console.log("3D item clicked") isSelected = !isSelected diff --git a/qmlui/qml/fixturesfunctions/3DView/PixelBar3DItem.qml b/qmlui/qml/fixturesfunctions/3DView/PixelBar3DItem.qml index ce85ec0ace..b529afd9da 100644 --- a/qmlui/qml/fixturesfunctions/3DView/PixelBar3DItem.qml +++ b/qmlui/qml/fixturesfunctions/3DView/PixelBar3DItem.qml @@ -82,8 +82,8 @@ Entity effect: sceneEffect parameters: [ - Parameter { name: "diffuse"; value: "gray" }, - Parameter { name: "specular"; value: "black" }, + Parameter { name: "diffuse"; value: Qt.color("gray") }, + Parameter { name: "specular"; value: Qt.color("black") }, Parameter { name: "shininess"; value: 1.0 }, Parameter { name: "bloom"; value: 0 } ] @@ -154,7 +154,7 @@ Entity name: "diffuse" value: Qt.rgba(lightColor.r * lightIntensity, lightColor.g * lightIntensity, lightColor.b * lightIntensity, 1) }, - Parameter { name: "specular"; value: "black" }, + Parameter { name: "specular"; value: Qt.color("black") }, Parameter { name: "shininess"; value: 1.0 }, Parameter { name: "bloom"; value: 1 } ] @@ -177,7 +177,7 @@ Entity property var lastPos - onClicked: + onClicked: (pick) => { console.log("3D item clicked") isSelected = !isSelected diff --git a/qmlui/qml/fixturesfunctions/3DView/RenderShadowMapFilter.qml b/qmlui/qml/fixturesfunctions/3DView/RenderShadowMapFilter.qml index 386e7a1766..76ac24273d 100644 --- a/qmlui/qml/fixturesfunctions/3DView/RenderShadowMapFilter.qml +++ b/qmlui/qml/fixturesfunctions/3DView/RenderShadowMapFilter.qml @@ -39,7 +39,7 @@ LayerFilter RenderPassFilter { id: geometryPass - matchAny: FilterKey { name: "pass"; value: { return fixtureItem.lightIntensity ? "shadows" : "invalid" } } + matchAny: FilterKey { name: "pass"; value: { return fixtureItem && fixtureItem.lightIntensity ? "shadows" : "invalid" } } parameters: [ Parameter { name: "lightViewMatrix"; value: fixtureItem ? fixtureItem.lightViewMatrix : Qt.matrix4x4() }, diff --git a/qmlui/qml/fixturesfunctions/3DView/SelectionEntity.qml b/qmlui/qml/fixturesfunctions/3DView/SelectionEntity.qml index 4a3c9525aa..cc2f0b619f 100644 --- a/qmlui/qml/fixturesfunctions/3DView/SelectionEntity.qml +++ b/qmlui/qml/fixturesfunctions/3DView/SelectionEntity.qml @@ -49,7 +49,7 @@ Entity parameters: [ Parameter { name: "diffuse"; value: color }, - Parameter { name: "specular"; value: "black" }, + Parameter { name: "specular"; value: Qt.color("black") }, Parameter { name: "shininess"; value: 1.0 }, Parameter { name: "bloom"; value: 0 } ] diff --git a/qmlui/qml/fixturesfunctions/3DView/SelectionGeometry.qml b/qmlui/qml/fixturesfunctions/3DView/SelectionGeometry.qml index f0071f5406..32d32264fe 100644 --- a/qmlui/qml/fixturesfunctions/3DView/SelectionGeometry.qml +++ b/qmlui/qml/fixturesfunctions/3DView/SelectionGeometry.qml @@ -70,14 +70,12 @@ GeometryRenderer Buffer { id: vertexBuffer - type: Buffer.VertexBuffer data: vertexBufferData() } Buffer { id: indexBuffer - type: Buffer.IndexBuffer data: indexBufferData() } diff --git a/qmlui/qml/fixturesfunctions/3DView/SpotlightConeEntity.qml b/qmlui/qml/fixturesfunctions/3DView/SpotlightConeEntity.qml index c6378ca7ed..00ec214989 100644 --- a/qmlui/qml/fixturesfunctions/3DView/SpotlightConeEntity.qml +++ b/qmlui/qml/fixturesfunctions/3DView/SpotlightConeEntity.qml @@ -42,8 +42,8 @@ Entity property Entity fxItem: null parameters: [ - Parameter { name: "diffuse"; value: "blue" }, - Parameter { name: "specular"; value: "black" }, + Parameter { name: "diffuse"; value: Qt.color("blue") }, + Parameter { name: "specular"; value: Qt.color("black") }, Parameter { name: "shininess"; value: 1.0 }, Parameter { name: "bloom"; value: 0 }, diff --git a/qmlui/qml/fixturesfunctions/3DView/StageBox.qml b/qmlui/qml/fixturesfunctions/3DView/StageBox.qml index c567f52b27..f1af18533c 100644 --- a/qmlui/qml/fixturesfunctions/3DView/StageBox.qml +++ b/qmlui/qml/fixturesfunctions/3DView/StageBox.qml @@ -37,8 +37,8 @@ Entity effect: stage.effect parameters: [ - Parameter { name: "diffuse"; value: "lightgray" }, - Parameter { name: "specular"; value: "black" }, + Parameter { name: "diffuse"; value: Qt.color("lightgray") }, + Parameter { name: "specular"; value: Qt.color("black") }, Parameter { name: "shininess"; value: 1.0 }, Parameter { name: "bloom"; value: 0 } ] @@ -76,7 +76,7 @@ Entity ObjectPicker { id: groundPicker - onClicked: contextManager.setPositionPickPoint(pick.worldIntersection) + onClicked: (pick) => contextManager.setPositionPickPoint(pick.worldIntersection) } components: [ @@ -98,7 +98,7 @@ Entity ObjectPicker { id: leftPicker - onClicked: contextManager.setPositionPickPoint(pick.worldIntersection) + onClicked: (pick) => contextManager.setPositionPickPoint(pick.worldIntersection) } components: [ @@ -119,7 +119,7 @@ Entity ObjectPicker { id: rightPicker - onClicked: contextManager.setPositionPickPoint(pick.worldIntersection) + onClicked: (pick) => contextManager.setPositionPickPoint(pick.worldIntersection) } components: [ @@ -140,7 +140,7 @@ Entity ObjectPicker { id: backPicker - onClicked: contextManager.setPositionPickPoint(pick.worldIntersection) + onClicked: (pick) => contextManager.setPositionPickPoint(pick.worldIntersection) } components: [ diff --git a/qmlui/qml/fixturesfunctions/3DView/StageRock.qml b/qmlui/qml/fixturesfunctions/3DView/StageRock.qml index ba8a6d3d1b..75d100ceac 100644 --- a/qmlui/qml/fixturesfunctions/3DView/StageRock.qml +++ b/qmlui/qml/fixturesfunctions/3DView/StageRock.qml @@ -42,8 +42,8 @@ Entity effect: stage.effect parameters: [ - Parameter { name: "diffuse"; value: "lightgray" }, - Parameter { name: "specular"; value: "black" }, + Parameter { name: "diffuse"; value: Qt.color("lightgray") }, + Parameter { name: "specular"; value: Qt.color("black") }, Parameter { name: "shininess"; value: 1.0 }, Parameter { name: "bloom"; value: 0 } ] @@ -203,7 +203,7 @@ Entity ObjectPicker { id: stagePicker - onClicked: contextManager.setPositionPickPoint(pick.worldIntersection) + onClicked: (pick) => contextManager.setPositionPickPoint(pick.worldIntersection) } components: [ diff --git a/qmlui/qml/fixturesfunctions/3DView/StageSimple.qml b/qmlui/qml/fixturesfunctions/3DView/StageSimple.qml index 4d95b451f0..23ae5e46bb 100644 --- a/qmlui/qml/fixturesfunctions/3DView/StageSimple.qml +++ b/qmlui/qml/fixturesfunctions/3DView/StageSimple.qml @@ -35,8 +35,8 @@ Entity { effect: stage.effect parameters: [ - Parameter { name: "diffuse"; value: "lightgray" }, - Parameter { name: "specular"; value: "black" }, + Parameter { name: "diffuse"; value: Qt.color("lightgray") }, + Parameter { name: "specular"; value: Qt.color("black") }, Parameter { name: "shininess"; value: 1.0 }, Parameter { name: "bloom"; value: 0 } ] @@ -56,7 +56,7 @@ Entity ObjectPicker { id: stagePicker - onClicked: contextManager.setPositionPickPoint(pick.worldIntersection) + onClicked: (pick) => contextManager.setPositionPickPoint(pick.worldIntersection) } components: [ diff --git a/qmlui/qml/fixturesfunctions/3DView/StageTheatre.qml b/qmlui/qml/fixturesfunctions/3DView/StageTheatre.qml index 5928940ffe..a2a2fd140a 100644 --- a/qmlui/qml/fixturesfunctions/3DView/StageTheatre.qml +++ b/qmlui/qml/fixturesfunctions/3DView/StageTheatre.qml @@ -45,8 +45,8 @@ Entity { effect: stage.effect parameters: [ - Parameter { name: "diffuse"; value: "lightgray" }, - Parameter { name: "specular"; value: "black" }, + Parameter { name: "diffuse"; value: Qt.color("lightgray") }, + Parameter { name: "specular"; value: Qt.color("black") }, Parameter { name: "shininess"; value: 1.0 }, Parameter { name: "bloom"; value: 0 } ] @@ -167,7 +167,7 @@ Entity ObjectPicker { id: stagePicker - onClicked: contextManager.setPositionPickPoint(pick.worldIntersection) + onClicked: (pick) => contextManager.setPositionPickPoint(pick.worldIntersection) } components: [ diff --git a/qmlui/qml/fixturesfunctions/Fixture2DItem.qml b/qmlui/qml/fixturesfunctions/Fixture2DItem.qml index 5f51ea5198..1db39e2085 100644 --- a/qmlui/qml/fixturesfunctions/Fixture2DItem.qml +++ b/qmlui/qml/fixturesfunctions/Fixture2DItem.qml @@ -301,7 +301,7 @@ Rectangle onEntered: fixtureLabel.visible = true onExited: showLabel ? fixtureLabel.visible = true : fixtureLabel.visible = false - onPressed: + onPressed: (mouse) => { // do not accept this event to propagate it to the drag rectangle mouse.accepted = false diff --git a/qmlui/qml/fixturesfunctions/FixtureBrowser.qml b/qmlui/qml/fixturesfunctions/FixtureBrowser.qml index e61af10d84..fff4bddad1 100644 --- a/qmlui/qml/fixturesfunctions/FixtureBrowser.qml +++ b/qmlui/qml/fixturesfunctions/FixtureBrowser.qml @@ -132,7 +132,7 @@ Rectangle width: modelsList.width - (manufScroll.visible ? manufScroll.width : 0) isManufacturer: true textLabel: modelData - onMouseEvent: + onMouseEvent: (type, iID, iType, qItem, mouseMods) => { if (type == App.Clicked) { @@ -239,7 +239,7 @@ Rectangle manufacturer: fixtureBrowser.selectedManufacturer textLabel: modelData - onMouseEvent: + onMouseEvent: (type, iID, iType, qItem, mouseMods) => { if (type == App.Clicked) { diff --git a/qmlui/qml/fixturesfunctions/FixtureBrowserDelegate.qml b/qmlui/qml/fixturesfunctions/FixtureBrowserDelegate.qml index 65cb03d18e..b8a320481a 100644 --- a/qmlui/qml/fixturesfunctions/FixtureBrowserDelegate.qml +++ b/qmlui/qml/fixturesfunctions/FixtureBrowserDelegate.qml @@ -111,11 +111,11 @@ Item id: fxMouseArea anchors.fill: parent hoverEnabled: true - onClicked: fxDraggableItem.mouseEvent(App.Clicked, 0, 0, fxDraggableItem, mouse.modifiers) + onClicked: (mouse) => fxDraggableItem.mouseEvent(App.Clicked, 0, 0, fxDraggableItem, mouse.modifiers) drag.target: FixtureDragItem { } drag.threshold: 30 - onPressed: + onPressed: (mouse) => { if (fxDraggableItem.isManufacturer == false) { @@ -124,11 +124,15 @@ Item FxDragJS.initProperties() } } - onPositionChanged: + onPositionChanged: (mouse) => + { if (fxDraggableItem.isManufacturer == false && drag.active == true) FxDragJS.handleDrag(mouse) - onReleased: + } + onReleased: (mouse) => + { if (fxDraggableItem.isManufacturer == false && drag.active == true) FxDragJS.endDrag(mouse) + } } } diff --git a/qmlui/qml/fixturesfunctions/FixtureNodeDelegate.qml b/qmlui/qml/fixturesfunctions/FixtureNodeDelegate.qml index fafc83b11c..5db3ea0943 100644 --- a/qmlui/qml/fixturesfunctions/FixtureNodeDelegate.qml +++ b/qmlui/qml/fixturesfunctions/FixtureNodeDelegate.qml @@ -305,13 +305,13 @@ Column drag.target: dragItem - onPressed: nodeContainer.mouseEvent(App.Pressed, cRef ? cRef.id : -1, -1, nodeContainer, mouse.modifiers) - onClicked: + onPressed: (mouse) => nodeContainer.mouseEvent(App.Pressed, cRef ? cRef.id : -1, -1, nodeContainer, mouse.modifiers) + onClicked: (mouse) => { nodeLabel.forceActiveFocus() nodeContainer.mouseEvent(App.Clicked, itemID, -1, nodeContainer, mouse.modifiers) } - onDoubleClicked: + onDoubleClicked: (mouse) => { nodeContainer.mouseEvent(App.DoubleClicked, itemID, -1, nodeContainer, mouse.modifiers) isExpanded = !isExpanded diff --git a/qmlui/qml/fixturesfunctions/FixturesAndFunctions.qml b/qmlui/qml/fixturesfunctions/FixturesAndFunctions.qml index 2c697d81fd..37d7bafb03 100644 --- a/qmlui/qml/fixturesfunctions/FixturesAndFunctions.qml +++ b/qmlui/qml/fixturesfunctions/FixturesAndFunctions.qml @@ -213,7 +213,7 @@ Rectangle height: viewToolbar.height - 4 anchors.margins: 1 model: ioManager.universesListModel - currValue: contextManager.universeFilter + currValue: contextManager?.universeFilter onValueChanged: { diff --git a/qmlui/qml/fixturesfunctions/LeftPanel.qml b/qmlui/qml/fixturesfunctions/LeftPanel.qml index 19d9f1382a..2b571411e3 100644 --- a/qmlui/qml/fixturesfunctions/LeftPanel.qml +++ b/qmlui/qml/fixturesfunctions/LeftPanel.qml @@ -31,7 +31,7 @@ SidePanel anchors.leftMargin: 0 panelAlignment: Qt.AlignLeft - onContentLoaded: + onContentLoaded: (item, ID) => { item.width = Qt.binding(function() { return leftSidePanel.width - collapseWidth }) item.height = Qt.binding(function() { return leftSidePanel.height }) @@ -339,7 +339,7 @@ SidePanel height: iconSize faSource: FontAwesome.fa_bolt tooltip: qsTr("Highlight") - counter: contextManager.selectedFixturesCount + counter: contextManager?.selectedFixturesCount onClicked: contextManager.highlightFixtureSelection() } diff --git a/qmlui/qml/fixturesfunctions/PaletteManager.qml b/qmlui/qml/fixturesfunctions/PaletteManager.qml index bd16502a8c..24ea94ebe5 100644 --- a/qmlui/qml/fixturesfunctions/PaletteManager.qml +++ b/qmlui/qml/fixturesfunctions/PaletteManager.qml @@ -224,7 +224,7 @@ Rectangle drag.target: pDragItem drag.threshold: height / 2 - onPressed: + onPressed: (mouse) => { if (model.isSelected) return diff --git a/qmlui/qml/fixturesfunctions/UniverseGridView.qml b/qmlui/qml/fixturesfunctions/UniverseGridView.qml index c1ea8bf4cc..0a57a60afc 100644 --- a/qmlui/qml/fixturesfunctions/UniverseGridView.qml +++ b/qmlui/qml/fixturesfunctions/UniverseGridView.qml @@ -19,6 +19,7 @@ import QtQuick import QtQuick.Layouts +import QtQuick.Controls import "." diff --git a/qmlui/qml/showmanager/HeaderAndCursor.qml b/qmlui/qml/showmanager/HeaderAndCursor.qml index d7d946cc74..224a0e16ea 100644 --- a/qmlui/qml/showmanager/HeaderAndCursor.qml +++ b/qmlui/qml/showmanager/HeaderAndCursor.qml @@ -212,6 +212,6 @@ Rectangle { enabled: showTimeMarkers anchors.fill: parent - onClicked: tlHeaderCursorLayer.clicked(mouse.x, mouse.y) + onClicked: (mouse) => tlHeaderCursorLayer.clicked(mouse.x, mouse.y) } } diff --git a/qmlui/qml/showmanager/ShowManager.qml b/qmlui/qml/showmanager/ShowManager.qml index d75ca2d4e1..8c59c4f1a7 100644 --- a/qmlui/qml/showmanager/ShowManager.qml +++ b/qmlui/qml/showmanager/ShowManager.qml @@ -448,7 +448,7 @@ Rectangle cursorHeight: showMgrContainer.height - topBar.height - (bottomPanel.visible ? bottomPanel.height : 0) duration: showManager.showDuration - onClicked: + onClicked: (mouseX, mouseY) => { if (timeDivision === Show.Time) showManager.currentTime = TimeUtils.posToMs(mouseX, timeScale, tickSize) @@ -543,7 +543,7 @@ Rectangle MouseArea { anchors.fill: parent - onClicked: + onClicked: (mouse) => { showManager.currentTime = TimeUtils.posToMs(mouse.x, timeScale, tickSize) showManager.resetItemsSelection()