diff options
27 files changed, 86 insertions, 75 deletions
diff --git a/examples/quickcontrols/controls/uiforms/qml/History.qml b/examples/quickcontrols/controls/uiforms/qml/History.qml index be7a5808..031f35be 100644 --- a/examples/quickcontrols/controls/uiforms/qml/History.qml +++ b/examples/quickcontrols/controls/uiforms/qml/History.qml @@ -79,7 +79,7 @@ HistoryForm { Connections { target: CustomerModel.selection - onSelectionChanged: form.readData() + function onSelectionChanged() { form.readData() } } Component.onCompleted: readData() diff --git a/examples/quickcontrols/controls/uiforms/qml/Notes.qml b/examples/quickcontrols/controls/uiforms/qml/Notes.qml index c7f326f7..ae89482f 100644 --- a/examples/quickcontrols/controls/uiforms/qml/Notes.qml +++ b/examples/quickcontrols/controls/uiforms/qml/Notes.qml @@ -79,7 +79,7 @@ NotesForm { Connections { target: CustomerModel.selection - onSelectionChanged: form.readData() + function onSelectionChanged() { form.readData() } } Component.onCompleted: readData() diff --git a/examples/quickcontrols/controls/uiforms/qml/Settings.qml b/examples/quickcontrols/controls/uiforms/qml/Settings.qml index eefab2a1..1c3741ac 100644 --- a/examples/quickcontrols/controls/uiforms/qml/Settings.qml +++ b/examples/quickcontrols/controls/uiforms/qml/Settings.qml @@ -99,7 +99,7 @@ SettingsForm { Connections { target: CustomerModel.selection - onSelectionChanged: form.readData() + function onSelectionChanged() { form.readData() } } Component.onCompleted: readData() diff --git a/examples/quickcontrols/extras/gallery/qml/CircularGaugeView.qml b/examples/quickcontrols/extras/gallery/qml/CircularGaugeView.qml index bfb7a0c7..63e51355 100644 --- a/examples/quickcontrols/extras/gallery/qml/CircularGaugeView.qml +++ b/examples/quickcontrols/extras/gallery/qml/CircularGaugeView.qml @@ -115,9 +115,9 @@ ControlView { // Called to update the style after the user has edited a property. Connections { target: customizerItem - onMinimumValueAngleChanged: __style.minimumValueAngle = customizerItem.minimumValueAngle - onMaximumValueAngleChanged: __style.maximumValueAngle = customizerItem.maximumValueAngle - onLabelStepSizeChanged: __style.tickmarkStepSize = __style.labelStepSize = customizerItem.labelStepSize + function onMinimumValueAngleChanged() { __style.minimumValueAngle = customizerItem.minimumValueAngle } + function onMaximumValueAngleChanged() { __style.maximumValueAngle = customizerItem.maximumValueAngle } + function onLabelStepSizeChanged() { __style.tickmarkStepSize = __style.labelStepSize = customizerItem.labelStepSize } } Behavior on value { diff --git a/examples/quickcontrols/extras/gallery/qml/gallery.qml b/examples/quickcontrols/extras/gallery/qml/gallery.qml index 0f4d2b71..c7d0a194 100644 --- a/examples/quickcontrols/extras/gallery/qml/gallery.qml +++ b/examples/quickcontrols/extras/gallery/qml/gallery.qml @@ -290,7 +290,10 @@ Window { Connections { target: recordingFlashTimer - onTriggered: if (name == "Recording") indicator.active = !indicator.active + function onTriggered() { + if (name == "Recording") + indicator.active = !indicator.active + } } } ControlLabel { diff --git a/src/controls/Button.qml b/src/controls/Button.qml index 73b3b349..c3f29238 100644 --- a/src/controls/Button.qml +++ b/src/controls/Button.qml @@ -110,11 +110,11 @@ BasicButton { Connections { target: __behavior - onEffectivePressedChanged: { + function onEffectivePressedChanged() { if (!Settings.hasTouchScreen && __behavior.effectivePressed && menu) popupMenuTimer.start() } - onReleased: { + function onReleased() { if (Settings.hasTouchScreen && __behavior.containsMouse && menu) popupMenuTimer.start() } diff --git a/src/controls/MenuBar.qml b/src/controls/MenuBar.qml index 2628d064..78fd7cc7 100644 --- a/src/controls/MenuBar.qml +++ b/src/controls/MenuBar.qml @@ -291,7 +291,7 @@ MenuBarPrivate { Connections { target: __menuItem - onAboutToHide: { + function onAboutToHide() { if (d.openedMenuIndex === index) { d.openMenuAtIndex(-1) menuMouseArea.hoveredItem = null @@ -301,7 +301,7 @@ MenuBarPrivate { Connections { target: __menuItem.__action - onTriggered: d.openMenuAtIndex(__menuItemIndex) + function onTriggered() { d.openMenuAtIndex(__menuItemIndex) } } Component.onCompleted: { diff --git a/src/controls/Private/BasicButton.qml b/src/controls/Private/BasicButton.qml index 0206c72f..d5c5d28f 100644 --- a/src/controls/Private/BasicButton.qml +++ b/src/controls/Private/BasicButton.qml @@ -163,7 +163,7 @@ Control { Connections { target: __action - onTriggered: button.clicked() + function onTriggered() { button.clicked() } } activeFocusOnTab: true diff --git a/src/controls/Private/EditMenu.qml b/src/controls/Private/EditMenu.qml index 843ccb00..fde124ea 100644 --- a/src/controls/Private/EditMenu.qml +++ b/src/controls/Private/EditMenu.qml @@ -54,7 +54,7 @@ Loader { Connections { target: control - onMenuChanged: { + function onMenuChanged() { if (menuInstance !== null) { menuInstance.destroy() menuInstance = null diff --git a/src/controls/Private/EditMenu_base.qml b/src/controls/Private/EditMenu_base.qml index 2ffbfdb2..346eba2d 100644 --- a/src/controls/Private/EditMenu_base.qml +++ b/src/controls/Private/EditMenu_base.qml @@ -154,7 +154,7 @@ Item { Connections { target: mouseArea - onClicked: { + function onClicked() { if (input.selectionStart === input.selectionEnd) { var cursorPos = input.positionAt(mouse.x, mouse.y) input.moveHandles(cursorPos, cursorPos) diff --git a/src/controls/Private/ScrollViewHelper.qml b/src/controls/Private/ScrollViewHelper.qml index c16c55b8..f5ef5b17 100644 --- a/src/controls/Private/ScrollViewHelper.qml +++ b/src/controls/Private/ScrollViewHelper.qml @@ -86,19 +86,19 @@ Item { Connections { target: viewport - onWidthChanged: layoutTimer.running = true - onHeightChanged: layoutTimer.running = true + function onWidthChanged() { layoutTimer.running = true } + function onHeightChanged() { layoutTimer.running = true } } Connections { target: flickableItem - onContentWidthChanged: layoutTimer.running = true - onContentHeightChanged: layoutTimer.running = true - onContentXChanged: { + function onContentWidthChanged() { layoutTimer.running = true } + function onContentHeightChanged() { layoutTimer.running = true } + function onContentXChanged() { hscrollbar.flash() vscrollbar.flash() } - onContentYChanged: { + function onContentYChanged() { hscrollbar.flash() vscrollbar.flash() } diff --git a/src/controls/ScrollView.qml b/src/controls/ScrollView.qml index 951fe65e..f79cfc8e 100644 --- a/src/controls/ScrollView.qml +++ b/src/controls/ScrollView.qml @@ -244,13 +244,13 @@ FocusScope { Connections { target: flickableItem - onContentYChanged: { + function onContentYChanged() { scroller.blockUpdates = true scroller.verticalScrollBar.value = flickableItem.contentY - flickableItem.originY scroller.blockUpdates = false } - onContentXChanged: { + function onContentXChanged() { scroller.blockUpdates = true scroller.horizontalScrollBar.value = flickableItem.contentX - flickableItem.originX scroller.blockUpdates = false @@ -309,12 +309,12 @@ FocusScope { Connections { target: flickableItem - onContentYChanged: { + function onContentYChanged() { wheelArea.verticalRecursionGuard = true wheelArea.verticalValue = flickableItem.contentY - flickableItem.originY wheelArea.verticalRecursionGuard = false } - onContentXChanged: { + function onContentXChanged() { wheelArea.horizontalRecursionGuard = true wheelArea.horizontalValue = flickableItem.contentX - flickableItem.originX wheelArea.horizontalRecursionGuard = false diff --git a/src/controls/Styles/Android/CursorHandleStyle.qml b/src/controls/Styles/Android/CursorHandleStyle.qml index 636e3688..a4b772c5 100644 --- a/src/controls/Styles/Android/CursorHandleStyle.qml +++ b/src/controls/Styles/Android/CursorHandleStyle.qml @@ -69,7 +69,7 @@ DrawableLoader { Connections { target: styleData onActivated: idle.restart() - onPressedChanged: { + function onPressedChanged() { if (!styleData.pressed) idle.restart() } @@ -82,9 +82,9 @@ DrawableLoader { Connections { target: editor ignoreUnknownSignals: true - onTextChanged: if (!ignore.running) idle.stop() - onDisplayTextChanged: if (!ignore.running) idle.stop() - onInputMethodComposing: if (!ignore.running) idle.stop() + function onTextChanged() { if (!ignore.running) idle.stop() } + function onDisplayTextChanged() { if (!ignore.running) idle.stop() } + function onInputMethodComposing() { if (!ignore.running) idle.stop() } } Timer { diff --git a/src/controls/Styles/Base/CalendarStyle.qml b/src/controls/Styles/Base/CalendarStyle.qml index ef0cb779..bde2f2cc 100644 --- a/src/controls/Styles/Base/CalendarStyle.qml +++ b/src/controls/Styles/Base/CalendarStyle.qml @@ -467,13 +467,21 @@ Style { Connections { target: control - onVisibleMonthChanged: __weekNumber = control.__model.weekNumberAt(index) - onVisibleYearChanged: __weekNumber = control.__model.weekNumberAt(index) + + function onVisibleMonthChanged() { + __weekNumber = control.__model.weekNumberAt(index) + } + + function onVisibleYearChanged() { + __weekNumber = control.__model.weekNumberAt(index) + } } Connections { target: control.__model - onCountChanged: __weekNumber = control.__model.weekNumberAt(index) + function onCountChanged() { + __weekNumber = control.__model.weekNumberAt(index) + } } property QtObject styleData: QtObject { @@ -638,7 +646,7 @@ Style { Connections { target: control - onSelectedDateChanged: view.selectedDateChanged() + function onSelectedDateChanged() { view.selectedDateChanged() } } Repeater { diff --git a/src/controls/Styles/Base/CircularButtonStyle.qml b/src/controls/Styles/Base/CircularButtonStyle.qml index 4aa4e5e6..b2324e0e 100644 --- a/src/controls/Styles/Base/CircularButtonStyle.qml +++ b/src/controls/Styles/Base/CircularButtonStyle.qml @@ -75,7 +75,7 @@ ButtonStyle { Connections { target: control - onPressedChanged: backgroundCanvas.requestPaint() + function onPressedChanged() { backgroundCanvas.requestPaint() } } onPaint: { diff --git a/src/controls/Styles/Base/CircularTickmarkLabelStyle.qml b/src/controls/Styles/Base/CircularTickmarkLabelStyle.qml index d44d9cb2..494a7f28 100644 --- a/src/controls/Styles/Base/CircularTickmarkLabelStyle.qml +++ b/src/controls/Styles/Base/CircularTickmarkLabelStyle.qml @@ -246,10 +246,10 @@ Style { Connections { target: control - onMinimumValueChanged: valueTextModel.update() - onMaximumValueChanged: valueTextModel.update() - onTickmarkStepSizeChanged: valueTextModel.update() - onLabelStepSizeChanged: valueTextModel.update() + function onMinimumValueChanged() { valueTextModel.update() } + function onMaximumValueChanged() { valueTextModel.update() } + function onTickmarkStepSizeChanged() { valueTextModel.update() } + function onLabelStepSizeChanged() { valueTextModel.update() } } Repeater { diff --git a/src/controls/Styles/Base/DelayButtonStyle.qml b/src/controls/Styles/Base/DelayButtonStyle.qml index 853c8cff..00a1716a 100644 --- a/src/controls/Styles/Base/DelayButtonStyle.qml +++ b/src/controls/Styles/Base/DelayButtonStyle.qml @@ -94,8 +94,8 @@ CircularButtonStyle { Connections { target: control - onPressedChanged: backgroundCanvas.requestPaint() - onCheckedChanged: backgroundCanvas.requestPaint() + function onPressedChanged() { backgroundCanvas.requestPaint() } + function onCheckedChanged() { backgroundCanvas.requestPaint() } } onPaint: { @@ -157,8 +157,8 @@ CircularButtonStyle { Connections { target: control - onActivated: state = "activated" - onCheckedChanged: if (!control.checked) state = "normal" + function onActivated() { state = "activated" } + function onCheckedChanged() { if (!control.checked) state = "normal" } } CircularProgressBar { @@ -187,7 +187,7 @@ CircularButtonStyle { Connections { target: delayButtonStyle - onProgressBarGradientChanged: progressBar.updateGradient() + function onProgressBarGradientChanged() { progressBar.updateGradient() } } } diff --git a/src/controls/Styles/Base/PieMenuStyle.qml b/src/controls/Styles/Base/PieMenuStyle.qml index d1aa341d..ddeb4edd 100644 --- a/src/controls/Styles/Base/PieMenuStyle.qml +++ b/src/controls/Styles/Base/PieMenuStyle.qml @@ -312,13 +312,13 @@ Style { Connections { target: pieMenuStyle - onStartAngleChanged: actionCanvas.requestPaint() - onEndAngleChanged: actionCanvas.requestPaint() + function onStartAngleChanged() { actionCanvas.requestPaint() } + function onEndAngleChanged() { actionCanvas.requestPaint() } } Connections { target: control - onCurrentIndexChanged: actionCanvas.requestPaint() + function onCurrentIndexChanged() { actionCanvas.requestPaint() } } onPaint: { diff --git a/src/controls/Styles/Base/StatusIndicatorStyle.qml b/src/controls/Styles/Base/StatusIndicatorStyle.qml index a334aa62..ae9f2110 100644 --- a/src/controls/Styles/Base/StatusIndicatorStyle.qml +++ b/src/controls/Styles/Base/StatusIndicatorStyle.qml @@ -92,8 +92,8 @@ Style { Connections { target: control - onActiveChanged: backgroundCanvas.requestPaint() - onColorChanged: backgroundCanvas.requestPaint() + function onActiveChanged() { backgroundCanvas.requestPaint() } + function onColorChanged() { backgroundCanvas.requestPaint() } } onPaint: { @@ -124,8 +124,8 @@ Style { Connections { target: control - onActiveChanged: colorCanvas.requestPaint() - onColorChanged: colorCanvas.requestPaint() + function onActiveChanged() { colorCanvas.requestPaint() } + function onColorChanged() { colorCanvas.requestPaint() } } onPaint: { @@ -157,8 +157,8 @@ Style { Connections { target: control - onActiveChanged: foregroundCanvas.requestPaint() - onColorChanged: foregroundCanvas.requestPaint() + function onActiveChanged() { foregroundCanvas.requestPaint() } + function onColorChanged() { foregroundCanvas.requestPaint() } } onPaint: { diff --git a/src/controls/Styles/Base/ToggleButtonStyle.qml b/src/controls/Styles/Base/ToggleButtonStyle.qml index a5561f29..2c47b4bf 100644 --- a/src/controls/Styles/Base/ToggleButtonStyle.qml +++ b/src/controls/Styles/Base/ToggleButtonStyle.qml @@ -139,11 +139,11 @@ CircularButtonStyle { Connections { target: control - onPressedChanged: { + function onPressedChanged() { backgroundCanvas.requestPaint(); } - onCheckedChanged: { + function onCheckedChanged() { uncheckedCanvas.requestPaint(); checkedCanvas.requestPaint(); } @@ -152,11 +152,11 @@ CircularButtonStyle { Connections { target: circularButtonStyle - onCheckedGradientChanged: checkedCanvas.requestPaint() - onCheckedDropShadowColorChanged: checkedCanvas.requestPaint() - onUncheckedGradientChanged: uncheckedCanvas.requestPaint() - onUncheckedDropShadowColorChanged: uncheckedCanvas.requestPaint() - onInactiveGradientChanged: { + function onCheckedGradientChanged() { checkedCanvas.requestPaint() } + function onCheckedDropShadowColorChanged() { checkedCanvas.requestPaint() } + function onUncheckedGradientChanged() { uncheckedCanvas.requestPaint() } + function onUncheckedDropShadowColorChanged() { uncheckedCanvas.requestPaint() } + function onInactiveGradientChanged() { checkedCanvas.requestPaint(); uncheckedCanvas.requestPaint(); } @@ -164,17 +164,17 @@ CircularButtonStyle { Connections { target: circularButtonStyle.checkedGradient - onUpdated: checkedCanvas.requestPaint() + function onUpdated() { checkedCanvas.requestPaint() } } Connections { target: circularButtonStyle.uncheckedGradient - onUpdated: uncheckedCanvas.requestPaint() + function onUpdated() { uncheckedCanvas.requestPaint() } } Connections { target: circularButtonStyle.inactiveGradient - onUpdated: { + function onUpdated() { uncheckedCanvas.requestPaint(); checkedCanvas.requestPaint(); } diff --git a/src/controls/Styles/iOS/CursorDelegate.qml b/src/controls/Styles/iOS/CursorDelegate.qml index 5312398c..37577cd4 100644 --- a/src/controls/Styles/iOS/CursorDelegate.qml +++ b/src/controls/Styles/iOS/CursorDelegate.qml @@ -53,7 +53,7 @@ Rectangle { Connections { target: input - onCursorPositionChanged: { + function onCursorPositionChanged() { state = "on" timer.restart() } diff --git a/src/controls/TextArea.qml b/src/controls/TextArea.qml index 89877314..59280833 100644 --- a/src/controls/TextArea.qml +++ b/src/controls/TextArea.qml @@ -765,8 +765,8 @@ ScrollView { Connections { target: area.viewport - onWidthChanged: edit.doLayout() - onHeightChanged: edit.doLayout() + function onWidthChanged() { edit.doLayout() } + function onHeightChanged() { edit.doLayout() } } onContentWidthChanged: edit.doLayout() onContentHeightChanged: edit.doLayout() diff --git a/src/extras/Styles/Flat/CircularGaugeStyle.qml b/src/extras/Styles/Flat/CircularGaugeStyle.qml index be969ad8..64eb176d 100644 --- a/src/extras/Styles/Flat/CircularGaugeStyle.qml +++ b/src/extras/Styles/Flat/CircularGaugeStyle.qml @@ -76,10 +76,10 @@ Base.CircularGaugeStyle { Connections { target: control - onValueChanged: thickArc.requestPaint() - onMinimumValueChanged: thickArc.requestPaint() - onMaximumValueChanged: thickArc.requestPaint() - onEnabledChanged: { + function onValueChanged() { thickArc.requestPaint() } + function onMinimumValueChanged() { thickArc.requestPaint() } + function onMaximumValueChanged() { thickArc.requestPaint() } + function onEnabledChanged() { thickArc.requestPaint(); thinArc.requestPaint(); } diff --git a/src/extras/Styles/Flat/DelayButtonStyle.qml b/src/extras/Styles/Flat/DelayButtonStyle.qml index 4cebe477..d90fb4e9 100644 --- a/src/extras/Styles/Flat/DelayButtonStyle.qml +++ b/src/extras/Styles/Flat/DelayButtonStyle.qml @@ -236,7 +236,7 @@ Base.DelayButtonStyle { Connections { target: privateScope - onProgressBarColorChanged: { + function onProgressBarColorChanged() { progressBar.clearStops() progressBar.addStop(0, privateScope.progressBarColor) progressBar.redraw() diff --git a/src/extras/Styles/Flat/DialStyle.qml b/src/extras/Styles/Flat/DialStyle.qml index 5e64f3c9..7a418652 100644 --- a/src/extras/Styles/Flat/DialStyle.qml +++ b/src/extras/Styles/Flat/DialStyle.qml @@ -74,8 +74,8 @@ Base.DialStyle { Connections { target: control - onEnabledChanged: progressBar.updateColor() - onActiveFocusChanged: progressBar.updateColor() + function onEnabledChanged() { progressBar.updateColor() } + function onActiveFocusChanged() { progressBar.updateColor() } } } diff --git a/src/extras/Styles/Flat/GaugeStyle.qml b/src/extras/Styles/Flat/GaugeStyle.qml index 1019f7ce..5e903360 100644 --- a/src/extras/Styles/Flat/GaugeStyle.qml +++ b/src/extras/Styles/Flat/GaugeStyle.qml @@ -127,7 +127,7 @@ Base.GaugeStyle { // We don't want that, as we want the label's y pos to be at zero when it's not anchored. // Using a binding here whose when property is true when control.orientation === Qt.Horizontal // doesn't work. - onOrientationChanged: textLabel.y = 0 + function onOrientationChanged() { textLabel.y = 0 } } anchors.baseline: control.orientation === Qt.Vertical ? parent.verticalCenter : undefined } diff --git a/src/extras/Styles/Flat/PieMenuStyle.qml b/src/extras/Styles/Flat/PieMenuStyle.qml index cdea064c..69bb66b7 100644 --- a/src/extras/Styles/Flat/PieMenuStyle.qml +++ b/src/extras/Styles/Flat/PieMenuStyle.qml @@ -69,13 +69,13 @@ Base.PieMenuStyle { Connections { target: pieMenuStyle - onStartAngleChanged: actionCanvas.requestPaint() - onEndAngleChanged: actionCanvas.requestPaint() + function onStartAngleChanged() { actionCanvas.requestPaint() } + function onEndAngleChanged() { actionCanvas.requestPaint() } } Connections { target: __styleData - onPressedChanged: actionCanvas.requestPaint() + function onPressedChanged() { actionCanvas.requestPaint() } } readonly property bool stroke: !__styleData.hovered |