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

Crash when set QGraphicsOpacityEffect opacity to 1.0 if child widgets have graphics effect

XMLWordPrintable

      Use the simple code below to create a new application. The application crashes when starting. The reason is that the child widgets have graphics effect, and the paint device will fail to be created when the second graphics effect acquiring the context. So a null painterdevice is used and the application crashes.

      Note that this happens only when set opacity of QGraphicsOpacityEffect to 1.0. When effect is full opacity, QGraphicsOpacityEffect uses a different code path than translucent.

      #include <QtGui>
      int main(int argc, char **argv)
      {
          QApplication app(argc, argv);
      
          QWidget* w1 = new QWidget();
          QWidget* w2 = new QWidget( w1 );
      
          QGraphicsOpacityEffect* e1 = new  QGraphicsOpacityEffect();
          QGraphicsDropShadowEffect* e2 = new  QGraphicsDropShadowEffect();
          e1->setOpacity( 1.0 ); // 0.9 works
          w1->setGraphicsEffect( e1 );
          w2->setGraphicsEffect( e2 );
          w1->show();
          
          return app.exec();
      }
      

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

            bjnilsen Bjørn Erik Nilsen
            aladdina Mason Chang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes