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

Reusing a page in a QWebEngineView causes the view to go blank

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.12.1, 5.13.0, 5.15.4
    • 5.12
    • WebEngine
    • None
    • Ubuntu 16.04 with GCC 64-bit
    • Linux/X11
    • f661543d54c4bb453c3f01e11544b39c98d32e95 (qt/qtwebengine/5.12.1)

    Description

      Reusing a page in a QWebEngineView will cause the view to go blank. If you enlarge the view you will see the page being rendered around what used to be the previous widget rectangle. Hovering over this blank area will also reveal that the mouse is responsive to the text that should've been shown on the same respective points.

      This is a program to help reproduce the bug:

      #include <QApplication>
      #include <QMainWindow>
      #include <QWebEngineView>
      #include <QWebEnginePage>
      #include <QVBoxLayout>
      #include <QPushButton>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QMainWindow w;
      
          w.setCentralWidget(new QWidget);
          w.centralWidget()->setLayout(new QVBoxLayout);
      
          auto page1 = new QWebEnginePage;
          page1->setHtml("page #1");
          auto page2 = new QWebEnginePage;
          page2->setHtml("page #2");
      
          QWebEngineView *webView = new QWebEngineView();
      
          QPushButton *button1 = new QPushButton("Page 1");
          w.centralWidget()->layout()->addWidget(button1);
          QPushButton *button2 = new QPushButton("Page 2");
          w.centralWidget()->layout()->addWidget(button2);
      
          w.connect(button1, &QPushButton::clicked, &w, [webView, page1] () {
              webView->setPage(page1);
          });
          w.connect(button2, &QPushButton::clicked, &w, [webView, page2] () {
              webView->setPage(page2);
          });
      
          w.centralWidget()->layout()->addWidget(webView);
          w.show();
      
          a.exec();
          delete page1;
          delete page2;
          return 0;
      }
      

      Attachments

        For Gerrit Dashboard: QTBUG-72299
        # Subject Branch Project Status CR V

        Activity

          People

            michal Michal Klocek
            vuxen Mazen Mardini
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes