Help with Gamepad connection
-
Hi guys,
i need some Help for implementing my xbox controller in QT.
i started the QT Example simple for Gamepad ... i run it but my gamepad doesn't get recognized by the code.auto gamepads = QGamepadManager::instance()->connectedGamepads(); qDebug() << "Number of gamepads:" << gamepads.size();
i tried the gamepad with the QML examples and here the gamepad get recognized... so it should has sth to do with the qgamepadmanager and not my gamepad...
has anybody an idea ?
Thanks in advancegreetz
-
Hi
What Qt version?
Maybe its related to
https://bugreports.qt.io/browse/QTBUG-61553
you could try the hax. -
Or is it maybe possible to get the gamepad via qml ... because this iss working in the example and then use it in the c++ code ?
Hmm. Sad. IT really sounds like that.
Hi yes in theory you can forward most from QML to c++ via the normal integration methods.
More work but maybe you can use QML for something else also. -
Hmm okay ... do you know how to do that ... i m really new to QML
what i have done now is this in QML:
Gamepad { id: gamepad1 deviceId: GamepadManager.connectedGamepads.length > 0 ? GamepadManager.connectedGamepads[0] : -1 }
Ho do i transfer now that "connection" to c++
-
Hmm okay ... do you know how to do that ... i m really new to QML
what i have done now is this in QML:
Gamepad { id: gamepad1 deviceId: GamepadManager.connectedGamepads.length > 0 ? GamepadManager.connectedGamepads[0] : -1 }
Ho do i transfer now that "connection" to c++
@BadHombre
I dont think you can export whole object but i could be wrong.Im not into QML so lets see if others have better ideas.
-
@BadHombre
I dont think you can export whole object but i could be wrong.Im not into QML so lets see if others have better ideas.
-
@BadHombre
Np :)
I think you will use some of these methods
http://doc.qt.io/qt-5/qtqml-cppintegration-interactqmlfromcpp.htmlMaybe its as easy to just find the object and cast it.