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

Call QtWebView::initialize() write Warning: QtWebEngine::initialize() called with QCoreApplication object already created and should be call before. This is depreciated and may fail in the future.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.15.0 Beta4
    • 5.13.2
    • WebEngine, WebView
    • None
    • All, Linux/X11
    • d47cad5ca5c3788fedc0a53930e47efb869f9315 (qt/qtwebview/5.15)

    Description

      If I run application with call 

      QtWebEngine::initialize();

      It generate this message in console:

       

      QtWebEngine::initialize() called with QCoreApplication object already created and should be call before. This is depreciated and may fail in the future.
      Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created.

      I can reproduce it on WebView Example from Qt, so it can be used as minimal code for reproducing. 

       Looks like WebView plugin instance init call QtWebEngine::initialize() method, but it has check in his body:

       

      void initialize()
          {
              QCoreApplication *app = QCoreApplication::instance();
              if (app) {
                  qWarning("QtWebEngine::initialize() called with QCoreApplication object already created and should be call before. "\
                       "This is depreciated and may fail in the future.");
                  QtWebEngineCore::initialize();
                  return;
              }
              // call initialize the same way as widgets do
              qAddPreRoutine(QtWebEngineCore::initialize);
          }
      

       

       So we have inconsistency: QtWebView::initialize() must be called after application instance creation, but QtWebEngine::initialize() must be called before.

       

       

      Attachments

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

        Activity

          People

            michal Michal Klocek
            vass Vasiliy Sorokin
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes