Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.2, 6.0.0
-
None
-
Windows 10
-
-
5aa3cf7b9a9d2932c95f9fbcd89011c968f7426a (qt/qtbase/6.0) 9f894788dda8407c6221aaa1491cd54a5a2b4cb7 (qt/tqtc-qtbase/6.1)
Description
There is ugly flickering observable when you resize window. See the attached GIF.
This is observable ONLY when the window is being resized by dragging lower right (or upper right or lower left) corner so that one dimension (e.g. width) is increasing and the other dimension (e.g. height) is decreasing. In that case the newly emerging areas are always filled in with white color which can be observed as terrible flickering. This is observable on Windows only. Not on MacOS, not on Linux.
Curiously the flickering does not happen:
- when you resize the window so that BOTH width and height are increasing (as also can be seen in the GIF)
- when you resize the window by dragging the upper left corner (but flickers hen dragging any other corner than upper left)
This is not a problem when you have light theme (then window background is probably white anyway). But this is a big issue when you have dark theme, in which case it is super ugly.
Notes:
1) There seems to be the same problem in QtWidgets and QtQuick applications, I have not found any Qt application which would not flicker.
2) This is not a problem of OS, drivers etc. Non-Qt applications which I have tested seem to behave correctly, i.e. no such flickering.
3) This is not a new issue. It has been in Qt for very long time. I only now found the time to explore it and report it.
[^qtbug89688.zip] #include <QApplication> #include <QWidget> #include <QPainter> #include <QThread> class Widget : public QWidget { public: Widget() { /* The following code was used for experiments. But nothing worked, I could not get rid of flickering. The documentation says: autoFillBackground : bool This property holds whether the widget background is filled automatically If enabled, this property will cause Qt to fill the background of the widget before invoking the paint event. The color used is defined by the QPalette::Window color role from the widget's palette. */ //setAttribute(Qt::WA_OpaquePaintEvent, true); //setAttribute(Qt::WA_NoSystemBackground, true); //setAutoFillBackground(false); //QPalette p = palette(); //p.setColor(QPalette::Window, Qt::blue); //setPalette(p); } void paintEvent(QPaintEvent *) override { QPainter p(this); p.fillRect(0, 0, width(), height(), Qt::blue); QThread::msleep(50); // just to simulate slower painting } }; int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget w; w.show(); return a.exec(); }
Attachments
Issue Links
- relates to
-
QTBUG-90628 [REG: 5.14.2->5.15.0]: When resizing a window that is translucent and using stylesheets then this can flicker quite a lot when the window is resized smaller
- Closed