From aecb233776acd141ca1b46dfd7a0e74f1b17efa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Mon, 10 Aug 2015 16:56:07 +0200 Subject: Add a note about QtWebView::initialize() on the example page. Users should call QtWebView::initialize() in their application to ensure that the WebView module works correctly on all platforms. The initialize() function is already mentioned on the landing page, so this is just to make the requirement is even more visible. Change-Id: Ieb1e916c8e155171a9330c5f36cb9198fdb5a9e0 Reviewed-by: Eskil Abrahamsen Blomfeldt --- examples/webview/minibrowser/doc/src/minibrowser.qdoc | 6 ++++++ examples/webview/minibrowser/main.cpp | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'examples/webview') 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()); -- cgit v1.2.3