Skip to content

Commit 0dec65b

Browse files
committed
QML: use functions for Connections event handlers
The block statement style is deprecated in Qt 6 (but only in the Connections object, not other ones).
1 parent 00df30d commit 0dec65b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

DownloadInfo.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ Item {
189189
target: downloader
190190
ignoreUnknownSignals: true
191191

192-
onStateChanged: {
192+
function onStateChanged(state) {
193193
downloadInfo.visible = state !== QmlDownloader.COMPLETED;
194194
if (state === QmlDownloader.DOWNLOADING) {
195195
downloadAction.iconName = "av/pause";

main.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ ApplicationWindow {
3737
Connections {
3838
target: downloader
3939
ignoreUnknownSignals: true
40-
onStatusMessage: {
40+
function onStatusMessage(message) {
4141
console.log("Download status: " + message);
4242
infoBar.open(message);
4343
}
44-
onFatalMessage: {
44+
function onFatalMessage(message) {
4545
console.log("Installation failed: " + message);
4646
errorPopup.errorDetail = message;
4747
errorPopup.open();

splash.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ ApplicationWindow {
6060
Connections {
6161
target: splashController
6262

63-
onUpdateNeeded: { // game update only
63+
function onUpdateNeeded(updateNeeded) { // game update only
6464
if (updateNeeded) {
6565
showUpdater()
6666
} else {
@@ -69,7 +69,7 @@ ApplicationWindow {
6969
}
7070
}
7171

72-
onUpdaterUpdate: {
72+
function onUpdaterUpdate(version) {
7373
downloader.startUpdaterUpdate(version);
7474
updaterUpdateLabel.visible = true;
7575

@@ -95,7 +95,7 @@ ApplicationWindow {
9595
id: splashDownloaderConnections
9696
target: downloader
9797

98-
onFatalMessage: {
98+
function onFatalMessage(message) {
9999
updateFailed.errorDetail = message;
100100
updateFailedWindow.show();
101101
updateFailed.open();

0 commit comments

Comments
 (0)