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

QtWebView no longer creates GUI after initiaze()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.6.2
    • WebView
    • None
    • Windows 10 64x,
      Qt Creator 12.0.2
    • Windows

    Description

      Hello, very strange thing!

      Up to yesterday, I worked normaly, no issue what so ever,

      this morning my application just was not running with MSVC2019 as it always was just fine.

      So I have tested and found out that QtWebView::initialize(); makes this happen...

       

      so if I run new Qt Quick project, and I ONLY add to CMakeLists:

       

      find_package(Qt6 REQUIRED COMPONENTS WebView)
      target_link_libraries(${TARGET_NAME} PRIVATE Qt6::WebView)
      

       

       

      and then to main.cpp I only add:

       

      #include <QtWebView>
      QtWebView::initialize();     // of course before QGuiApplication app(argc, argv); but it does not matter, same issue happens even when i put this initialize() after engine.load(url);
      

       

       

      then nothing happens... so If I go futher, and put debug lines to main.cpp, like:

       

      int main(int argc, char *argv[])
      {
      qDebug() << "debug 1";
          QtWebView::initialize();
      qDebug() << "debug 2";
          QGuiApplication app(argc, argv);
      qDebug() << "debug 3";
          QQmlApplicationEngine engine;
      qDebug() << "debug 4";
          const QUrl url(u"qrc:/untitled/Main.qml"_qs);
      qDebug() << "debug 5";
          QObject::connect(
              &engine,
              &QQmlApplicationEngine::objectCreationFailed,
              &app,
              []() { QCoreApplication::exit(-1); },
              Qt::QueuedConnection);
      qDebug() << "debug 6";
          engine.load(url);
      qDebug() << "debug 7";
          return app.exec();
      }
      

       

       

      then I only see "debug 1" and "debug 2"... then nothing more happens... but if I comment out the QtWebView::initialize(); then my application starts

       - it gives me following error, however QML WebView works anyway just fine:

           - here I very much wonder where path "C:\Users\qt\work\qt\qtwebendine\..." came from because this path/file does not exist... i install Qt to C:\Qt, my project Source DIR is: C\Qt\Projects\Sources\untitled and build dir is: C\Qt\Projects\build\build-untitled-Desktop_Qt_6_6_2_MSVC2019_64bit-Debug

      • this file is actually at path c:\Qt\6.6.2\Src\qtwebengine\src\core\api\qtwebenginecoreglobal.cpp 

       

      As saying, yesteray to me all worked fine, today it wont open not even the new minimal example... do I missing something here?

       

      all new project attached as example

       

      When build with MinGW all builds fine with no problem, only WebView does not work as expected because its not supported by MinGW

      Attachments

        Issue Links

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

          Activity

            People

              stromme Christian
              shokarta Jiri Zaloudek
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes