Skip to content

Commit c3e35ca

Browse files
committed
QML: use function instead of block for event with params
Use arrow functions instead of block statements for event handlers that are not in a Connections element and use event parameters, because the implicit parameter passing is deprecated in Qt 6. onLinkActivated is the only event we have like this.
1 parent 0dec65b commit c3e35ca

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

NewsCard.qml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,7 @@ Flickable {
201201
font.pixelSize: 21
202202
lineHeight: 24
203203

204-
onLinkActivated: {
205-
Qt.openUrlExternally(link);
206-
}
204+
onLinkActivated: (link) => Qt.openUrlExternally(link);
207205

208206
MouseArea {
209207
anchors.fill: parent

UpdateFailed.qml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ Popup {
4747
wrapMode: Text.WordWrap
4848
font.pixelSize: 21
4949
lineHeight: 24
50-
onLinkActivated: {
51-
Qt.openUrlExternally(link);
52-
}
50+
onLinkActivated: (link) => Qt.openUrlExternally(link);
5351
MouseArea {
5452
anchors.fill: parent
5553
acceptedButtons: Qt.NoButton

0 commit comments

Comments
 (0)