How do I use QT3D's QMouseDevice and QMouseHandler

475 views Asked by At

I have a simple Qt3DCore::QEntity (sphere mesh, material, and transform) that I'm showing in a Qt3DExtras::Qt3DWindow view. I'd like to handle events for mouse clicks on this entity in the view. Ideally, I want to stay in the Qt3D framework for doing this. I've tried various combinations of QMouseDevice + QMouseHandler, but I can't seem to receive notifications from the QMouseHandler slots (entered, exited, pressed, clicked).

I have not found any examples online and the documentation is seriously lacking. I'm on windows, using vs 2017 with qt 5.9.1.

1

There are 1 answers

0
Jeffrey Faust On BEST ANSWER

I was able to use Qt3DRender::QObjectPicker instead. It also has better documentation.