Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.11.0
-
None
Description
The following test program is intended for the bug reproducing. Run the program and click on its window. The assertion will fail. The reason is that after shrinking to zero size a XCB window loses ability to QXcbBackingStore proper initialization while resizing. This bug is absent in Qt version 5.6.
#include <QApplication> #include <QWidget> #include <QPainter> class TestWidget : public QWidget \{ public: TestWidget(QWidget *parent); protected: void paintEvent(QPaintEvent *ev); }; TestWidget::TestWidget(QWidget *parent) :QWidget(parent) \{ setWindowFlags(Qt::Window); } void TestWidget::paintEvent(QPaintEvent *ev) \{ QPainter P; int res=P.begin(this); Q_ASSERT(res); } static TestWidget *test_widget; void test() \{ test_widget->resize(50, 100); } class MainWidget : public QWidget \{ public: MainWidget():QWidget(0) \{ } protected: bool event(QEvent *ev) \{ QEvent::Type type=ev->type(); switch(type) \{ case QEvent::MouseButtonPress: test(); return 1; } return QWidget::event(ev); } }; int main(int argc, char *argv[]) \{ QApplication app(argc, argv); MainWidget widget; test_widget=new TestWidget(&widget); test_widget->show(); test_widget->move(100, 100); test_widget->resize(0, 0); widget.resize(640, 256); widget.show(); return app.exec(); }
Attachments
Issue Links
- relates to
-
QTBUG-69585 Setting WA_TranslucentBackground attribute results in a black window
- Open