Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-71216

Resizing widget with Qt::WA_StaticContents triggers QPainter errors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.6.3, 5.9.6, 5.12.0 Beta 2
    • None
    • Windows

      If a QWidget is set with the attribute Qt::WA_StaticContents, and then the widget's height is reduced to 0, errors appear (on Windows only):

      QPainter::begin: Paint device returned engine == 0, type: 3
      QPainter::setCompositionMode: Painter not active

       

      Reproduction steps

      1. Build and run the following code:

      #include <QApplication>
      #include <QWidget>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QWidget* widget = new QWidget();
          widget->setAttribute(Qt::WA_StaticContents);
          widget->show();
      
          return a.exec();
      }
      

      2. Reduce the window height until its height is 0.

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            christian.aguilera.foundry Christian Aguilera
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes