summaryrefslogtreecommitdiffstats
path: root/examples/webenginewidgets
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2018-11-09 11:30:41 +0100
committerKai Koehne <kai.koehne@qt.io>2018-11-09 14:07:02 +0000
commit07098b5651caca90369af76e97ec1a0a95a39fe3 (patch)
tree00129ab4d66a58eae5be7f39b7c07fb5a641e27c /examples/webenginewidgets
parent3c88531c3d40c43cd9ac5dc9954668330dab52c1 (diff)
Fix documentation of WebEngine Widgets Minimal Example
The printing of the source code was broken in commit 0fe0b133b7410. Make sure that the whole source code is printed. Also document the commandLineUrlArgument() function. Task-number: QTBUG-71691 Change-Id: I0044fb6508c712eab91e8d342624df5ea23e2fdc Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Diffstat (limited to 'examples/webenginewidgets')
-rw-r--r--examples/webenginewidgets/minimal/doc/src/minimal.qdoc14
1 files changed, 10 insertions, 4 deletions
diff --git a/examples/webenginewidgets/minimal/doc/src/minimal.qdoc b/examples/webenginewidgets/minimal/doc/src/minimal.qdoc
index 05ec9ee79..a45a0fa02 100644
--- a/examples/webenginewidgets/minimal/doc/src/minimal.qdoc
+++ b/examples/webenginewidgets/minimal/doc/src/minimal.qdoc
@@ -42,18 +42,24 @@
\section1 The Code
+ We first define a \c commandLineUrlArgument function that returns the URL to open.
+ This is either the first positional argument given on the command line, or
+ \c https://www.qt.io as a fallback.
+
+ \quotefromfile webenginewidgets/minimal/main.cpp
+ \skipto #include
+
+ \printto int main
+
In the \c main function we first set the Qt::AA_EnableHighDpiScaling.
This lets the web view automatically scale on high-dpi displays.
Next, we instantiate a QApplication and a QWebEngineView. The URL
- to load is taken from the command-line in \c commandLineUrlArgument and
+ to load is taken from \c commandLineUrlArgument and
loaded by calling \l QWebEngineView::setUrl. The view widget is
given a reasonable default size, and shown.
Finally, QApplication::exec() launches the main event loop.
- \quotefromfile webenginewidgets/minimal/main.cpp
- \skipto #include
-
\printuntil }
\section1 Requirements