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

Crash floating QDockWidget with Qt::WA_StaticContents on delete

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Not Evaluated
    • None
    • 4.7.0, 4.7.1, 4.7.2, 4.7.3, 4.7.4, 4.8.0, 5.4.2
    • GUI: Window management
    • None

    Description

      The bug in backingstore_p.h

       
          inline void QWidgetBackingStore::updateStaticContentsSize()
          {
              for (int i = 0; i < staticWidgets.size(); ++i) {
                  QWidgetPrivate *wd = staticWidgets.at(i)->d_func();
      >           if (!wd->extra)
                      wd->createExtra();
                  wd->extra->staticContentsSize = wd->data.crect.size();
              }
          }
      

      After this code:

       
      class MainWindow: public QMainWindow
      {
      Q_OBJECT
      public:
          MainWindow(){
              QDockWidget *dock=new QDockWidget(this);
              {
                  view=new QWidget(dock);
                  view->setAttribute(Qt::WA_StaticContents,true);
                  dock->setWidget(view);
              }
              dock->setFloating(true);
          }
      public slots:
          void bug()
          {
              QMessageBox::information(this,"Don't doit!","Ok");
              delete view;
          }
      protected:
          QWidget *view;
      };
      
      #include "main.moc"
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          MainWindow *w=new MainWindow();
          w->show();
          w->bug();
      
          return a.exec();
      }
      

      wd is undefined!

      Attachments

        1. main.cpp
          2 kB
        2. staticbug.png
          staticbug.png
          214 kB
        3. crash.tar.gz
          1 kB
        4. qtbug22605_orig.zip
          1 kB

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              cemehehko Andrew Semenenko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes