Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.13.2
-
None
-
-
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 |
297006,3 | Fix WebView::initialize() call order | 5.15 | qt/qtwebview | Status: MERGED | +2 | 0 |