Qt 6.11 is out! See what's new in the release
blog
How to pass `QQuickWheelEvent` to C++?
-
I've setup a
QQuickFramebufferObjectand now I'm trying to receive input from it. How do you pass events (like QMLWheelEvent) to C++ code?MouseArea { anchors.fill: parent z: 999 onClicked: (event) => appCanvas.onClicked(event)and then, in C++..
Q_INVOKABLE void onClicked(QMouseEvent* event);Which doesn't seem to work:
"Could not convert argument 0 from QQuickMouseEvent(0x57f228370c48) to QMouseEvent*" TypeError: Passing incompatible arguments to C++ functions from JavaScript is not allowed. -
I've setup a
QQuickFramebufferObjectand now I'm trying to receive input from it. How do you pass events (like QMLWheelEvent) to C++ code?MouseArea { anchors.fill: parent z: 999 onClicked: (event) => appCanvas.onClicked(event)and then, in C++..
Q_INVOKABLE void onClicked(QMouseEvent* event);Which doesn't seem to work:
"Could not convert argument 0 from QQuickMouseEvent(0x57f228370c48) to QMouseEvent*" TypeError: Passing incompatible arguments to C++ functions from JavaScript is not allowed. -
K kaixoo has marked this topic as solved
-
Hi,
One thing you could do is create a small wrapper class so you don't have a big function signature.