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

"qt is not defined" error when to create second QWebEngineView window

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.6.3, 5.7.2, 5.8.0
    • 5.6.2, 5.7.1, 5.8.0 Beta
    • WebChannel, WebEngine
    • None
    • macos 10.12
    • ff26fa899f095eff9b3265b462e97c7e48ab06f5 (5.6) dd80dd0e4efcdfcc33f71a4f964aa9d2d40c4af0 (5.7) 39f7ce19dbce34dfa7e730d6fa743d88109c3369(5.8)

    Description

      The second QWebEngineView window occurs "qt is not defined" error when you create second QWebEngineView and show it in WebPage::createWindow(WebWindowType type) function.

      I guess related to https://bugreports.qt.io/browse/QTBUG-53411 and https://bugreports.qt.io/browse/QTBUG-54107.
      5.6.2 does not effect.

      Can reproduce by fix markdowneditor demo code as following:

      bool PreviewPage::acceptNavigationRequest(const QUrl &url,
                                                QWebEnginePage::NavigationType /type/,
                                                bool /isMainFrame/)
      {
          // Only allow qrc:/index.html.
          if (url.scheme() == QString("qrc"))
              return true;
          QWebEngineView   *v=new QWebEngineView();
          PreviewPage *page = new PreviewPage(v);
          v->setPage(page);
          v->setUrl(QUrl("qrc:/index.html"));
          v->show();
          //QDesktopServices::openUrl(url);
          return false;
      }
      

      Attachments

        1. Screen Shot 2016.png
          Screen Shot 2016.png
          288 kB
        2. 2.png
          2.png
          431 kB
        3. demobrowser2.zip
          383 kB
        4. demobrowser5.6.2.zip
          366 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mibrunin Michael Bruning
            vidarxu Carter Davies
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes