How to switch mouse interaction in QVTKOpenGLNativeWidget

114 views Asked by At

for my application, I want to use Qt5 along with VTK 9 (Ubuntu 22.04). For this case, I am using a QVTKOpenGLNativeWidget, which is the standard type of widget to combine these two libs. For some tests, I ran the minimal qt-vtk-example which is shown here.
However, when interacting with the vtk widget in this minimal example, I noticed that the left mouse button (LMB) interaction is a bit off. When hovering the mouse over the vtk widget and pressing LMB, I would expect that the camera rotated around the sphere visualized in this widget. Instead, pressing LMB starts to move the entire application. Then, if LMB is released again, I can rotate freely around the sphere.
Another thing: When pressing LMB and the Alt key at the same time, everything works as I would expect it to be without the Alt key.
I put a small gif in this question so you might understand my question more easily. In this gif, I try to interact with the vtk widget using only LMB. You might see that the application starts to move and after releasing LMB, the sphere rotates. Then, after a small break, I retry it with the Alt key, where everything works as I want it to be.

Example gif

My question is now: Is this wanted behaviour? And if so, is there a way to switch it around? So basically, I want to have the behaviour of LMB + Alt key inside the QVTKOpenGLNativeWidget, but without actually pressing the Alt key. Is there a simple way to do that?

0

There are 0 answers