Skip to content

Commit 07098b5

Browse files
committed
Fix documentation of WebEngine Widgets Minimal Example
The printing of the source code was broken in commit 0fe0b13. 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 <[email protected]> Reviewed-by: Leena Miettinen <[email protected]>
1 parent 3c88531 commit 07098b5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

examples/webenginewidgets/minimal/doc/src/minimal.qdoc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,24 @@
4242

4343
\section1 The Code
4444

45+
We first define a \c commandLineUrlArgument function that returns the URL to open.
46+
This is either the first positional argument given on the command line, or
47+
\c https://www.qt.io as a fallback.
48+
49+
\quotefromfile webenginewidgets/minimal/main.cpp
50+
\skipto #include
51+
52+
\printto int main
53+
4554
In the \c main function we first set the Qt::AA_EnableHighDpiScaling.
4655
This lets the web view automatically scale on high-dpi displays.
4756

4857
Next, we instantiate a QApplication and a QWebEngineView. The URL
49-
to load is taken from the command-line in \c commandLineUrlArgument and
58+
to load is taken from \c commandLineUrlArgument and
5059
loaded by calling \l QWebEngineView::setUrl. The view widget is
5160
given a reasonable default size, and shown.
5261
Finally, QApplication::exec() launches the main event loop.
5362

54-
\quotefromfile webenginewidgets/minimal/main.cpp
55-
\skipto #include
56-
5763
\printuntil }
5864

5965
\section1 Requirements

0 commit comments

Comments
 (0)