diff options
author | Christian Strømme <christian.stromme@theqtcompany.com> | 2015-08-10 16:56:07 +0200 |
---|---|---|
committer | Christian Stromme <christian.stromme@theqtcompany.com> | 2015-09-24 13:00:02 +0000 |
commit | aecb233776acd141ca1b46dfd7a0e74f1b17efa7 (patch) | |
tree | c9997be71896bc91df3aac861282e594f19a909e /examples/webview | |
parent | b51601aa598afc4ab1830d053c1e9f4a87478f27 (diff) |
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 <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'examples/webview')
-rw-r--r-- | examples/webview/minibrowser/doc/src/minibrowser.qdoc | 6 | ||||
-rw-r--r-- | examples/webview/minibrowser/main.cpp | 4 |
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()); |