Is it possible to send mouse input from QFrame to Qt3DWindow?
-
Hi there,
Is it possible to take the mouse input information gathered from a QFrame object and send it to a Qt3DWindow object with similar size (width and height), in a way that will make possible for the Qt3DWindow object to perform object picking.
Something like a touchpad and a screen. -
Hi there,
Is it possible to take the mouse input information gathered from a QFrame object and send it to a Qt3DWindow object with similar size (width and height), in a way that will make possible for the Qt3DWindow object to perform object picking.
Something like a touchpad and a screen. -
Thanks for the response @Pl45m4
But where exactly should I send the coords, to a Qt3DWindow method or to the method of some object somewhere inside the Qt3DWindow object?It's up to you and depends on your structure and how your input looks like.
For example, you can have a function/slot in your
Qt3DWindow
and create aQRayCaster
/QScreenRayCaster
there with your point / vector.- https://doc.qt.io/qt-5/qt3drender-qscreenraycaster.html
- https://doc.qt.io/qt-5/qt3drender-qraycaster.html
- https://doc.qt.io/qt-5/qt3drender-qobjectpicker.html
Probably you have to convert your
QFrame
point to some vector / direction to make it work, sinceQObjectPicker
as well asQRayCaster
both take vectors to fire the ray in this direction and check for collisions afterwards. -
It's up to you and depends on your structure and how your input looks like.
For example, you can have a function/slot in your
Qt3DWindow
and create aQRayCaster
/QScreenRayCaster
there with your point / vector.- https://doc.qt.io/qt-5/qt3drender-qscreenraycaster.html
- https://doc.qt.io/qt-5/qt3drender-qraycaster.html
- https://doc.qt.io/qt-5/qt3drender-qobjectpicker.html
Probably you have to convert your
QFrame
point to some vector / direction to make it work, sinceQObjectPicker
as well asQRayCaster
both take vectors to fire the ray in this direction and check for collisions afterwards.