From 5b5a18c678f62e94b7387a52dc888f335c232cee Mon Sep 17 00:00:00 2001 From: Sergii Lisovenko <2522054+s-lisovenko@users.noreply.github.com> Date: Mon, 26 Feb 2024 21:07:31 +0100 Subject: [PATCH] Fixes for joystick event handling in QML This update changes the method signatures for "onAxisValueChanged", "onRawButtonPressedChanged", and "onAxisValues" events in QML according to Qt6 requirements. Each event now directly accepts the necessary arguments. --- src/VehicleSetup/JoystickConfigButtons.qml | 3 +-- src/VehicleSetup/JoystickConfigCalibration.qml | 2 +- src/VehicleSetup/JoystickConfigGeneral.qml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/VehicleSetup/JoystickConfigButtons.qml b/src/VehicleSetup/JoystickConfigButtons.qml index 65c62f2d00e..e76998e7ef4 100644 --- a/src/VehicleSetup/JoystickConfigButtons.qml +++ b/src/VehicleSetup/JoystickConfigButtons.qml @@ -27,7 +27,7 @@ ColumnLayout { Connections { target: _activeJoystick - onRawButtonPressedChanged: { + onRawButtonPressedChanged: (index, pressed) => { if (buttonActionRepeater.itemAt(index)) { buttonActionRepeater.itemAt(index).pressed = pressed } @@ -40,7 +40,6 @@ ColumnLayout { ColumnLayout { id: flowColumn width: parent.width - anchors.centerIn: parent spacing: ScreenTools.defaultFontPixelHeight // Note for reminding the use of multiple buttons for the same action diff --git a/src/VehicleSetup/JoystickConfigCalibration.qml b/src/VehicleSetup/JoystickConfigCalibration.qml index c1ee6283257..19f0d33ab02 100644 --- a/src/VehicleSetup/JoystickConfigCalibration.qml +++ b/src/VehicleSetup/JoystickConfigCalibration.qml @@ -99,7 +99,7 @@ Item { anchors.verticalCenter: parent.verticalCenter Connections { target: controller - onAxisValueChanged: { + onAxisValueChanged: (axis, value) => { if (axisMonitorRepeater.itemAt(axis)) { axisMonitorRepeater.itemAt(axis).axis.axisValue = value } diff --git a/src/VehicleSetup/JoystickConfigGeneral.qml b/src/VehicleSetup/JoystickConfigGeneral.qml index 8a479a110a8..76931e5a368 100644 --- a/src/VehicleSetup/JoystickConfigGeneral.qml +++ b/src/VehicleSetup/JoystickConfigGeneral.qml @@ -211,7 +211,7 @@ Item { Connections { target: _activeJoystick - onAxisValues: { + onAxisValues: (roll, pitch, yaw, throttle) => { rollAxis.axisValue = roll * 32768.0 pitchAxis.axisValue = pitch * 32768.0 yawAxis.axisValue = yaw * 32768.0