summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/webview/minibrowser/doc/src/minibrowser.qdoc6
-rw-r--r--examples/webview/minibrowser/main.cpp4
2 files changed, 9 insertions, 1 deletions
diff --git a/examples/webview/minibrowser/doc/src/minibrowser.qdoc b/examples/webview/minibrowser/doc/src/minibrowser.qdoc
index 54b6c74..fc6887e 100644
--- a/examples/webview/minibrowser/doc/src/minibrowser.qdoc
+++ b/examples/webview/minibrowser/doc/src/minibrowser.qdoc
@@ -36,5 +36,11 @@
browsing experience. Besides the addressbar for the URL, it has a
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
+ ensure that the necessary pre-setup steps are run.
+
+ \snippet minibrowser/main.cpp 0
+
\include examples-run.qdocinc
*/
diff --git a/examples/webview/minibrowser/main.cpp b/examples/webview/minibrowser/main.cpp
index 390d591..f79ec31 100644
--- a/examples/webview/minibrowser/main.cpp
+++ b/examples/webview/minibrowser/main.cpp
@@ -68,10 +68,12 @@ QUrl Utils::fromUserInput(const QString& userInput)
int main(int argc, char *argv[])
{
+//! [0]
QGuiApplication app(argc, argv);
+ QtWebView::initialize();
+//! [0]
QGuiApplication::setApplicationDisplayName(QCoreApplication::translate("main",
"QtWebView Example"));
- QtWebView::initialize();
QCommandLineParser parser;
QCoreApplication::setApplicationVersion(QT_VERSION_STR);
parser.setApplicationDescription(QGuiApplication::applicationDisplayName());