Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes warnings about onFoo connections in Qt QML #493

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/gz/gui/qml/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ ApplicationWindow
// C++ signals to QML slots
Connections {
target: MainWindow
onNotify: {
function onNotify(_message) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, according to this commit message, this syntax is not available for Qt 5.12 which is the version for focal. A suggestion to look into is disable the warning or figure out how to call these functions from C++ code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we aren't planning on keeping focal support for harmonic, I can retarget to main, at least.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there have been discussions or decisions on this yet

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the commit message @jennuine linked, perhaps we can disable the warning using QLoggingCategory::setFilterRules("qt.qml.connections=false");?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative PR #534

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the commit message @jennuine linked, perhaps we can disable the warning using QLoggingCategory::setFilterRules("qt.qml.connections=false");?

Apologies, I missed this message but thanks for taking care of it 🙇‍♀️

notificationDialog.setTextDuration(_message, 0)
}
onNotifyWithDuration: {
notificationDialog.setTextDuration(_message, _duration)
function onNotifyWithDuration(_message_, _duration) {
notificationDialog.setTextDuration(_message, _duration);
}
}

Expand Down
2 changes: 1 addition & 1 deletion include/gz/gui/qml/PluginMenu.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Popup {

Connections {
target: MainWindow
onConfigChanged: {
function onConfigChanged() {
filteredModel.model = MainWindow.PluginListModel()
}
}
Expand Down
6 changes: 3 additions & 3 deletions include/gz/gui/qml/StyleDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grid_config/GridConfig.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/plugins/image_display/ImageDisplay.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ Rectangle {

Connections {
target: ImageDisplay
onNewImage: image.reload();
function onNewImage() {
image.reload();
}
}

ColumnLayout {
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/world_control/WorldControl.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ RowLayout {

Connections {
target: WorldControl
onPlaying: {
function onPlaying() {
paused = false;
}
onPaused: {
function onPaused() {
paused = true;
}
}
Expand Down