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

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.13.2
    • Fix Version/s: 5.15.0 Beta4
    • Component/s: WebEngine, WebView
    • Labels:
      None
    • Platform/s:
      All, Linux/X11
    • Commits:
      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

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

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes