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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.6.2, 5.7.1, 5.8.0 Beta
    • Fix Version/s: 5.6.3, 5.7.2, 5.8.0
    • Component/s: WebChannel, WebEngine
    • Labels:
      None
    • Environment:
      macos 10.12
    • Commits:
      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. 2.png
          2.png
          431 kB
        2. demobrowser2.zip
          383 kB
        3. demobrowser5.6.2.zip
          366 kB
        4. Screen Shot 2016.png
          Screen Shot 2016.png
          288 kB
        For Gerrit Dashboard: QTBUG-56643
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            mibrunin Michael Bruning
            Reporter:
            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