I have the following class :
class Curve2DOpenGLWidget : public QOpenGLWidget, protected QOpenGLFunctions_3_3_Core {
Q_OBJECT
public:
Curve2DOpenGLWi
From Qt documentation
Mouse events occur when a mouse button is pressed or released inside a widget, or when the mouse cursor is moved.
Mouse move events will occur only when a mouse button is pressed down, unless mouse tracking has been enabled with QWidget::setMouseTracking().
So you need setMouseTracking(true) in your constructor
I did run into the same problem.
In my case it was a QTimer
based render loop which was updating 4 QOpenGLWidget
s and the window’s title bar (which was actually pretty CPU intensive) at 100 FPS.
It didn’t manifest on Windows, but on Linux.
The update events for the qoglwidgets and the mouse move events probably have higher priority in the event loop than the wheel events. The wheel events don’t seem to be dropped but are accumulated and arrive together with next event that »gets through«.
Luckily the use case allowed to replace this render loop with an event driven implementation avoiding this issue.
See Qt::AA_CompressHighFrequencyEvents and Qt::AA_CompressTabletEvents in http://doc.qt.io/qt-5/qt.html#ApplicationAttribute-enum
These are new attributes in Qt 5.