Skip to content

Commit 51c3031

Browse files
committed
make qml handlers functions consistent
1 parent 8ff40aa commit 51c3031

26 files changed

+49
-49
lines changed

qmlui/qml/+qt5/ActionsMenu.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Popup
115115

116116
property string action: ""
117117

118-
onClicked: function (role) {
118+
onClicked: (role) => {
119119
if (role === Dialog.Yes)
120120
{
121121
if (qlcplus.fileName())

qmlui/qml/ActionsMenu.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Popup
117117

118118
property string action: ""
119119

120-
onClicked: function (role) {
120+
onClicked: (role) => {
121121
if (role === Dialog.Yes)
122122
{
123123
if (qlcplus.fileName())

qmlui/qml/CustomDoubleSpinBox.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ CustomSpinBox
4141
top: Math.max(controlRoot.from, controlRoot.to)
4242
}
4343

44-
textFromValue: function(value, locale) {
44+
textFromValue: (value, locale) => {
4545
return Number(value / Math.pow(10, decimals)).toLocaleString(locale, 'f', decimals) + suffix
4646
}
4747

48-
valueFromText: function(text, locale) {
48+
valueFromText: (text, locale) => {
4949
return Number.fromLocaleString(locale, text.replace(suffix, "")) * Math.pow(10, decimals)
5050
}
5151

qmlui/qml/CustomSpinBox.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ SpinBox
4949
if (focus) contentItem.selectAll()
5050
}
5151

52-
textFromValue: function(value) {
52+
textFromValue: (value) => {
5353
return value + suffix
5454
}
5555

56-
valueFromText: function(text) {
56+
valueFromText: (text) => {
5757
return parseInt(text.replace(suffix, ""))
5858
}
5959

qmlui/qml/FunctionDelegate.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ Rectangle
103103

104104
drag.target: dragItem
105105

106-
onPressed: function(mouse) {
106+
onPressed: (mouse) => {
107107
funcDelegate.mouseEvent(App.Pressed, cRef.id, cRef.type, funcDelegate, mouse.modifiers)
108108
}
109-
onClicked: function(mouse) {
109+
onClicked: (mouse) => {
110110
funcDelegate.mouseEvent(App.Clicked, cRef.id, cRef.type, funcDelegate, mouse.modifiers)
111111
}
112-
onDoubleClicked: function(mouse) {
112+
onDoubleClicked: (mouse) => {
113113
funcDelegate.mouseEvent(App.DoubleClicked, cRef.id, cRef.type, funcDelegate, mouse.modifiers)
114114
}
115115
}

qmlui/qml/SimpleDesk.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Rectangle
3939
id: channelToolLoader
4040
z: 2
4141

42-
onValueChanged: function (fixtureID, channelIndex, value) {
42+
onValueChanged: (fixtureID, channelIndex, value) => {
4343
simpleDesk.setValue(fixtureID, channelIndex, value)
4444
}
4545
}
@@ -87,7 +87,7 @@ Rectangle
8787
padding: 0
8888
model: simpleDesk.universesListModel
8989
currValue: simpleDesk.universeFilter
90-
onValueChanged: function (value) {
90+
onValueChanged: (value) => {
9191
simpleDesk.universeFilter = value
9292
}
9393
}

qmlui/qml/TreeNodeDelegate.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ Column
125125

126126
drag.target: dragItem
127127

128-
onPressed: function (mouse) {
128+
onPressed: (mouse) => {
129129
nodeContainer.mouseEvent(App.Pressed, cRef ? cRef.id : -1, nodeContainer.itemType,
130130
nodeContainer, mouse.modifiers)
131131
}
132-
onClicked: function (mouse) {
132+
onClicked: (mouse) => {
133133
nodeLabel.forceActiveFocus()
134134
nodeContainer.mouseEvent(App.Clicked, cRef ? cRef.id : -1, nodeContainer.itemType,
135135
nodeContainer, mouse.modifiers)

qmlui/qml/fixturesfunctions/2DView.qml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Rectangle
222222
property int initialXPos
223223
property int initialYPos
224224

225-
onPressed: function (mouse) {
225+
onPressed: (mouse) => {
226226
console.log("button: " + mouse.button + ", mods: " + mouse.modifiers)
227227
var itemID = View2D.itemIDAtPos(Qt.point(mouse.x, mouse.y))
228228

@@ -255,7 +255,7 @@ Rectangle
255255
}
256256
}
257257

258-
onPositionChanged: function (mouse) {
258+
onPositionChanged: (mouse) => {
259259
if (selectionRect.visible == true)
260260
{
261261
if (mouse.x !== initialXPos || mouse.y !== initialYPos)
@@ -292,7 +292,7 @@ Rectangle
292292
}
293293
}
294294

295-
onReleased: function (mouse) {
295+
onReleased: (mouse) => {
296296
if (selectionRect.visible === true && selectionRect.width && selectionRect.height)
297297
{
298298
var rx = selectionRect.x
@@ -314,7 +314,7 @@ Rectangle
314314
}
315315
}
316316

317-
onWheel: function (wheel) {
317+
onWheel: (wheel) => {
318318
//console.log("Wheel delta: " + wheel.angleDelta.y)
319319
if (wheel.angleDelta.y > 0)
320320
setZoom(0.5)
@@ -349,7 +349,7 @@ Rectangle
349349
drag.threshold: 10
350350
drag.target: parent
351351

352-
onReleased: function (mouse) {
352+
onReleased: (mouse) => {
353353
if (drag.active)
354354
{
355355
var units = View2D.gridUnits === MonitorProperties.Meters ? 1000.0 : 304.8

qmlui/qml/fixturesfunctions/3DView/3DView.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,14 @@ Rectangle
372372
property int selGenericCount: View3D.genericSelectedCount
373373

374374
sourceDevice: mDevice
375-
onPressed: function (mouse) {
375+
onPressed: (mouse) => {
376376
directionCounter = 0
377377
dx = 0
378378
dy = 0
379379
startPoint = Qt.point(mouse.x, mouse.y)
380380
}
381381

382-
onPositionChanged: function (mouse) {
382+
onPositionChanged: (mouse) => {
383383
if (directionCounter < 3)
384384
{
385385
dx += (Math.abs(mouse.x - startPoint.x))
@@ -474,7 +474,7 @@ Rectangle
474474
startPoint = Qt.point(mouse.x, mouse.y)
475475
}
476476

477-
onWheel: function (wheel) {
477+
onWheel: (wheel) => {
478478
if (wheel.angleDelta.y > 0)
479479
viewCamera.setZoom(-1)
480480
else

qmlui/qml/fixturesfunctions/3DView/Fixture3DItem.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ Entity
322322
{
323323
id: eSceneLoader
324324

325-
onStatusChanged: function (status) {
325+
onStatusChanged: (status) => {
326326
if (status === SceneLoader.Ready)
327327
View3D.initializeFixture(itemID, fixtureEntity, eSceneLoader)
328328
}
@@ -339,7 +339,7 @@ Entity
339339

340340
property var lastPos
341341

342-
onClicked: function (pick) {
342+
onClicked: (pick) => {
343343
console.log("3D item clicked")
344344
isSelected = !isSelected
345345
contextManager.setItemSelection(itemID, isSelected, pick.modifiers)

qmlui/qml/fixturesfunctions/3DView/Generic3DItem.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Entity
4141
{
4242
id: eSceneLoader
4343

44-
onStatusChanged: function (status) {
44+
onStatusChanged: (status) => {
4545
if (status === SceneLoader.Ready)
4646
View3D.initializeItem(itemID, genericEntity, eSceneLoader)
4747
}
@@ -54,7 +54,7 @@ Entity
5454
id: eObjectPicker
5555
dragEnabled: true
5656

57-
onClicked: function (pick) {
57+
onClicked: (pick) => {
5858
console.log("3D item clicked")
5959
isSelected = !isSelected
6060
View3D.setItemSelection(itemID, isSelected, pick.modifiers)

qmlui/qml/fixturesfunctions/3DView/MultiBeams3DItem.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ Entity
274274

275275
property var lastPos
276276

277-
onClicked: function (pick) {
277+
onClicked: (pick) => {
278278
console.log("3D item clicked")
279279
isSelected = !isSelected
280280
contextManager.setItemSelection(itemID, isSelected, pick.modifiers)

qmlui/qml/fixturesfunctions/3DView/PixelBar3DItem.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Entity
101101
id: headsRepeater
102102
//model: fixtureEntity.headsNumber
103103

104-
onObjectAdded: function (index, object) {
104+
onObjectAdded: (index, object) => {
105105
console.log("Head " + index + " added ----------------")
106106
if (index == fixtureEntity.headsNumber - 1)
107107
View3D.initializeFixture(itemID, fixtureEntity, null)
@@ -166,7 +166,7 @@ Entity
166166

167167
property var lastPos
168168

169-
onClicked: function (pick) {
169+
onClicked: (pick) => {
170170
console.log("3D item clicked")
171171
isSelected = !isSelected
172172
contextManager.setItemSelection(itemID, isSelected, pick.modifiers)

qmlui/qml/fixturesfunctions/3DView/StageBox.qml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Entity
7676
ObjectPicker
7777
{
7878
id: groundPicker
79-
onClicked: function(pick) {
79+
onClicked: (pick) => {
8080
contextManager.setPositionPickPoint(pick.worldIntersection)
8181
}
8282
}
@@ -100,7 +100,7 @@ Entity
100100
ObjectPicker
101101
{
102102
id: leftPicker
103-
onClicked: function (pick) {
103+
onClicked: (pick) => {
104104
contextManager.setPositionPickPoint(pick.worldIntersection)
105105
}
106106
}
@@ -123,7 +123,7 @@ Entity
123123
ObjectPicker
124124
{
125125
id: rightPicker
126-
onClicked: function (pick) {
126+
onClicked: (pick) => {
127127
contextManager.setPositionPickPoint(pick.worldIntersection)
128128
}
129129
}
@@ -146,7 +146,7 @@ Entity
146146
ObjectPicker
147147
{
148148
id: backPicker
149-
onClicked: function (pick) {
149+
onClicked: (pick) => {
150150
contextManager.setPositionPickPoint(pick.worldIntersection)
151151
}
152152
}

qmlui/qml/fixturesfunctions/3DView/StageRock.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Entity
203203
ObjectPicker
204204
{
205205
id: stagePicker
206-
onClicked: function (pick) {
206+
onClicked: (pick) => {
207207
contextManager.setPositionPickPoint(pick.worldIntersection)
208208
}
209209
}

qmlui/qml/fixturesfunctions/3DView/StageSimple.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Entity
5656
ObjectPicker
5757
{
5858
id: stagePicker
59-
onClicked: function (pick) {
59+
onClicked: (pick) => {
6060
contextManager.setPositionPickPoint(pick.worldIntersection)
6161
}
6262
}

qmlui/qml/fixturesfunctions/3DView/StageTheatre.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Entity
167167
ObjectPicker
168168
{
169169
id: stagePicker
170-
onClicked: function (pick) {
170+
onClicked: (pick) => {
171171
contextManager.setPositionPickPoint(pick.worldIntersection)
172172
}
173173
}

qmlui/qml/fixturesfunctions/Fixture2DItem.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ Rectangle
301301
onEntered: fixtureLabel.visible = true
302302
onExited: showLabel ? fixtureLabel.visible = true : fixtureLabel.visible = false
303303

304-
onPressed: function (mouse) {
304+
onPressed: (mouse) => {
305305
// do not accept this event to propagate it to the drag rectangle
306306
mouse.accepted = false
307307
}

qmlui/qml/fixturesfunctions/FixtureBrowser.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Rectangle
132132
width: modelsList.width - (manufScroll.visible ? manufScroll.width : 0)
133133
isManufacturer: true
134134
textLabel: modelData
135-
onMouseEvent: function (type, iID, iType, qItem, mouseMods) {
135+
onMouseEvent: (type, iID, iType, qItem, mouseMods) => {
136136
if (type == App.Clicked)
137137
{
138138
mfText.label = modelData
@@ -238,7 +238,7 @@ Rectangle
238238
manufacturer: fixtureBrowser.selectedManufacturer
239239
textLabel: modelData
240240

241-
onMouseEvent: function (type, iID, iType, qItem, mouseMods) {
241+
onMouseEvent: (type, iID, iType, qItem, mouseMods) => {
242242
if (type == App.Clicked)
243243
{
244244
modelsList.currentIndex = index

qmlui/qml/fixturesfunctions/FixtureBrowserDelegate.qml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,25 +111,25 @@ Item
111111
id: fxMouseArea
112112
anchors.fill: parent
113113
hoverEnabled: true
114-
onClicked: function (mouse) {
114+
onClicked: (mouse) => {
115115
fxDraggableItem.mouseEvent(App.Clicked, 0, 0, fxDraggableItem, mouse.modifiers)
116116
}
117117
drag.target: FixtureDragItem { }
118118
drag.threshold: 30
119119

120-
onPressed: function (mouse) {
120+
onPressed: (mouse) => {
121121
if (fxDraggableItem.isManufacturer == false)
122122
{
123123
fxDraggableItem.mouseEvent(App.Clicked, 0, 0, fxDraggableItem, mouse.modifiers)
124124
forceActiveFocus()
125125
FxDragJS.initProperties()
126126
}
127127
}
128-
onPositionChanged: function (mouse) {
128+
onPositionChanged: (mouse) => {
129129
if (fxDraggableItem.isManufacturer == false && drag.active == true)
130130
FxDragJS.handleDrag(mouse)
131131
}
132-
onReleased: function (mouse) {
132+
onReleased: (mouse) => {
133133
if (fxDraggableItem.isManufacturer == false && drag.active == true)
134134
FxDragJS.endDrag(mouse)
135135
}

qmlui/qml/fixturesfunctions/LeftPanel.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ SidePanel
3131
anchors.leftMargin: 0
3232
panelAlignment: Qt.AlignLeft
3333

34-
onContentLoaded: function (item, ID) {
34+
onContentLoaded: (item, ID) => {
3535
item.width = Qt.binding(function() { return leftSidePanel.width - collapseWidth })
3636
item.height = Qt.binding(function() { return leftSidePanel.height })
3737
}

qmlui/qml/fixturesfunctions/RightPanel.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ SidePanel
103103
animatePanel(true)
104104
}
105105

106-
onContentLoaded: function(item, ID) {
106+
onContentLoaded: (item, ID) => {
107107
if (item.hasOwnProperty("functionID"))
108108
item.functionID = itemID
109109
}

qmlui/qml/fixturesfunctions/SceneEditor.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Rectangle
119119
id: toolbar
120120
visible: !boundToSequence
121121
text: sceneEditor ? sceneEditor.functionName : ""
122-
onTextChanged: function(text) {
122+
onTextChanged: (text) => {
123123
sceneEditor.functionName = text
124124
}
125125

qmlui/qml/popup/CustomPopupDialog.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Dialog
9595

9696
contentItem.implicitHeight: UISettings.iconSizeDefault
9797

98-
onClicked: function (button) {
98+
onClicked: (button) => {
9999
if (button === standardButton(Dialog.Yes))
100100
control.clicked(Dialog.Yes)
101101
else if (button === standardButton(Dialog.No))

qmlui/qml/showmanager/HeaderAndCursor.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ Rectangle
212212
{
213213
enabled: showTimeMarkers
214214
anchors.fill: parent
215-
onClicked: function (mouse) {
215+
onClicked: (mouse) => {
216216
tlHeaderCursorLayer.clicked(mouse.x, mouse.y)
217217
}
218218
}

0 commit comments

Comments
 (0)