Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.4.0
-
None
-
Windows 7 x64 and Ubuntu 14.04 x64
Description
When there is a QOpenGLWidget besides other widgets, e.g. a QSlider in a QSplitter as central widget of a QMainWindow, the QOpenGLWidget is updated resp. repainted unnecessarily when the mouse is moved over the other widgets.
With QGLWidget this behavior did not occur. The attached small program demonstrates this. When started without a parameter, it generates a QMainWindow with a QOpenGLWidget and a QSlider. When the mouse is moved over the QSlider, the paintGL method is invoked and it prints a counter value to the console. When started with a parameter, QGLWidget is used instead and there are no paintGL invocations when moving the mouse over the QSlider.
I started to find out the reason for the different behavior by debugging QT sources. There is a different behavior in QWidgetBackingStore::doSync (qwidgetbackingstore.cpp). The method is invoked in both cases and determines the region to update. When using a QGLWidget it only takes the region of the QSlider, hence the QGLWidget is not updated. When using a QOpenGLWidget also the QOpenGLWidget's region is added to the region to update in line 1164 because the QOpenGLWidget is found as "widget texture" in line 1126 while the QGLWidget is not.
Attachments
Issue Links
- duplicates
-
QTBUG-43178 Unwanted QGraphicsView updates when using a QOpenGLWidget as viewport
- Closed