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

QWebPagePrivate::updateWindow crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.3.2
    • 5.3.0, 5.3.1
    • WebKit
    • f93fec1adcff7cb2afd1cbe4d3417983d9349257

    Description

      Set QWebView in QDockWidget and call QWebView->load("something url").
      Move the QDockWidget to top level( QDockWidget::setFloating(true) ) and then return back (QDockWidget::setFloating(false) ), will crash.

      Simple test:

      #include <QApplication>
      #include <QDockWidget>
      #include <QMainWindow>
      #include <QtWebKitWidgets/QWebView>
      #include <QTimer>
      
      class DoCrash : public QObject{
          Q_OBJECT
      public:
          DoCrash( QDockWidget* widget ) :m_dockWidget( widget ){}
      public slots:
          void startCrach(){
              m_dockWidget->setFloating( true );
              QTimer::singleShot( 100, this, SLOT(doCrash()) );
          }
      private slots:
          void doCrash(){
              m_dockWidget->setFloating( false );
          }
      private:
          QDockWidget* m_dockWidget;
      };
      
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QMainWindow mainWindow;
          QDockWidget* dockWidget = new QDockWidget( &mainWindow );
          dockWidget->setFeatures( QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetMovable );
          QWebView* view = new QWebView( dockWidget );
          view->load( QUrl("http://www.google.com") );
          dockWidget->setWidget( view );
          mainWindow.addDockWidget( Qt::BottomDockWidgetArea, dockWidget );
          DoCrash crash( dockWidget );
          mainWindow.show();
      
          QTimer::singleShot( 10, &crash, SLOT(startCrach()) );
      
          return a.exec();
      }
      

      My solution:

      class QWebPagePrivate{
        ....
        QWindow* window;  -> QPointer< QWindow > window; // It's work.
      };
      

      Attachments

        Issue Links

          Activity

            People

              allan.jensen Allan Sandfeld Jensen
              i.kashurnikov Ivan Kashurnikov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: