From dde2277e6332fcae572db34ed5b44aa3616d50fd Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 27 Sep 2022 20:02:51 -0500 Subject: [PATCH] Fixes warnings about onFoo connections in Qt QML Signed-off-by: Michael Carroll --- include/gz/gui/qml/Main.qml | 6 +++--- include/gz/gui/qml/PluginMenu.qml | 2 +- include/gz/gui/qml/StyleDialog.qml | 6 +++--- src/plugins/grid_config/GridConfig.qml | 2 +- src/plugins/image_display/ImageDisplay.qml | 4 +++- src/plugins/world_control/WorldControl.qml | 4 ++-- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/include/gz/gui/qml/Main.qml b/include/gz/gui/qml/Main.qml index 132bac2bf..eb5ece04e 100644 --- a/include/gz/gui/qml/Main.qml +++ b/include/gz/gui/qml/Main.qml @@ -101,11 +101,11 @@ ApplicationWindow // C++ signals to QML slots Connections { target: MainWindow - onNotify: { + function onNotify(_message) { notificationDialog.setTextDuration(_message, 0) } - onNotifyWithDuration: { - notificationDialog.setTextDuration(_message, _duration) + function onNotifyWithDuration(_message_, _duration) { + notificationDialog.setTextDuration(_message, _duration); } } diff --git a/include/gz/gui/qml/PluginMenu.qml b/include/gz/gui/qml/PluginMenu.qml index 53d1f0d37..890a7e7d4 100644 --- a/include/gz/gui/qml/PluginMenu.qml +++ b/include/gz/gui/qml/PluginMenu.qml @@ -26,7 +26,7 @@ Popup { Connections { target: MainWindow - onConfigChanged: { + function onConfigChanged() { filteredModel.model = MainWindow.PluginListModel() } } diff --git a/include/gz/gui/qml/StyleDialog.qml b/include/gz/gui/qml/StyleDialog.qml index 7845f2ed2..c5f841c5c 100644 --- a/include/gz/gui/qml/StyleDialog.qml +++ b/include/gz/gui/qml/StyleDialog.qml @@ -97,21 +97,21 @@ Dialog { // Connections (C++ signal to QML slot) Connections { target: MainWindow - onMaterialThemeChanged: { + function onMaterialThemeChanged() { updateTheme(MainWindow.materialTheme); } } Connections { target: MainWindow - onMaterialPrimaryChanged: { + function onMaterialPrimaryChanged() { updatePrimary(MainWindow.materialPrimary); } } Connections { target: MainWindow - onMaterialAccentChanged: { + function onMaterialAccentChanged () { updateAccent(MainWindow.materialAccent); } } diff --git a/src/plugins/grid_config/GridConfig.qml b/src/plugins/grid_config/GridConfig.qml index 649b1d80e..788e177e5 100644 --- a/src/plugins/grid_config/GridConfig.qml +++ b/src/plugins/grid_config/GridConfig.qml @@ -42,7 +42,7 @@ GridLayout { Connections { target: GridConfig - onNewParams: { + onNewParams(_hCellCount, _vCellCount, _cellLength, _pos, _rot, _color) { horizontalCellCount.value = _hCellCount; verticalCellCount.value = _vCellCount; cellLength.value = _cellLength; diff --git a/src/plugins/image_display/ImageDisplay.qml b/src/plugins/image_display/ImageDisplay.qml index fa78102e1..6fc7f3c9f 100644 --- a/src/plugins/image_display/ImageDisplay.qml +++ b/src/plugins/image_display/ImageDisplay.qml @@ -49,7 +49,9 @@ Rectangle { Connections { target: ImageDisplay - onNewImage: image.reload(); + function onNewImage() { + image.reload(); + } } ColumnLayout { diff --git a/src/plugins/world_control/WorldControl.qml b/src/plugins/world_control/WorldControl.qml index b66864064..6b7b19140 100644 --- a/src/plugins/world_control/WorldControl.qml +++ b/src/plugins/world_control/WorldControl.qml @@ -29,10 +29,10 @@ RowLayout { Connections { target: WorldControl - onPlaying: { + function onPlaying() { paused = false; } - onPaused: { + function onPaused() { paused = true; } }