Browse Source

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.
QGC4.4
Sergii Lisovenko 1 year ago committed by Julian Oes
parent
commit
5b5a18c678
No known key found for this signature in database
GPG Key ID: F0ED380FEA56DE41
  1. 3
      src/VehicleSetup/JoystickConfigButtons.qml
  2. 2
      src/VehicleSetup/JoystickConfigCalibration.qml
  3. 2
      src/VehicleSetup/JoystickConfigGeneral.qml

3
src/VehicleSetup/JoystickConfigButtons.qml

@ -27,7 +27,7 @@ ColumnLayout { @@ -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 { @@ -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

2
src/VehicleSetup/JoystickConfigCalibration.qml

@ -99,7 +99,7 @@ Item { @@ -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
}

2
src/VehicleSetup/JoystickConfigGeneral.qml

@ -211,7 +211,7 @@ Item { @@ -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

Loading…
Cancel
Save