summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2020-04-14 12:37:14 +0200
committerMichal Klocek <michal.klocek@qt.io>2020-04-15 07:31:13 +0000
commitd47cad5ca5c3788fedc0a53930e47efb869f9315 (patch)
tree7d303d63df88571a735d68b8c6bb9e7eb5d65955
parentc6d4bb78fe59a55ffce526ff951e5c5270dd92cf (diff)
Fix WebView::initialize() call order
QWebEngine should be initialized before QGuiApplication. The other way around is deprecated. Update docs and example. Initialize call is also used by darwin plugin but it should not matter in this case. Fixes: QTBUG-80912 Task-number: QTBUG-76391 Change-Id: I1037346707a3f4e24286ccaba25f8e5c3301ef36 Reviewed-by: Christian Strømme <christian.stromme@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
-rw-r--r--examples/webview/minibrowser/doc/src/minibrowser.qdoc2
-rw-r--r--examples/webview/minibrowser/main.cpp2
-rw-r--r--src/webview/doc/src/qtwebview-overview.qdoc4
3 files changed, 4 insertions, 4 deletions
diff --git a/examples/webview/minibrowser/doc/src/minibrowser.qdoc b/examples/webview/minibrowser/doc/src/minibrowser.qdoc
index 3532861..20f03b0 100644
--- a/examples/webview/minibrowser/doc/src/minibrowser.qdoc
+++ b/examples/webview/minibrowser/doc/src/minibrowser.qdoc
@@ -37,7 +37,7 @@
couple of controls to navigate through the browsing history.
\note When using the Qt WebView module it is necessary to call QtWebView::initialize()
- right after creating the QGuiApplication instance. Calling QtWebView::initialize() will
+ before creating the QGuiApplication instance. Calling QtWebView::initialize() will
ensure that the necessary pre-setup steps are run.
\snippet minibrowser/main.cpp 0
diff --git a/examples/webview/minibrowser/main.cpp b/examples/webview/minibrowser/main.cpp
index 8f56731..8b4718f 100644
--- a/examples/webview/minibrowser/main.cpp
+++ b/examples/webview/minibrowser/main.cpp
@@ -79,8 +79,8 @@ QUrl Utils::fromUserInput(const QString& userInput)
int main(int argc, char *argv[])
{
//! [0]
- QGuiApplication app(argc, argv);
QtWebView::initialize();
+ QGuiApplication app(argc, argv);
//! [0]
QGuiApplication::setApplicationDisplayName(QCoreApplication::translate("main",
"QtWebView Example"));
diff --git a/src/webview/doc/src/qtwebview-overview.qdoc b/src/webview/doc/src/qtwebview-overview.qdoc
index 8ccadd9..0c2330b 100644
--- a/src/webview/doc/src/qtwebview-overview.qdoc
+++ b/src/webview/doc/src/qtwebview-overview.qdoc
@@ -46,8 +46,8 @@
\section1 Prerequisites
To make the Qt \WebView module function correctly across all platforms, it's necessary
- to call \l {qtwebview-initialize}{QtWebView::initialize}() right after creating the
- QGuiApplication instance.
+ to call \l {qtwebview-initialize}{QtWebView::initialize}() before creating the
+ QGuiApplication instance and before window's QPlatformOpenGLContext is created.
\section1 QML Types