summaryrefslogtreecommitdiffstats
path: root/examples/network/doc
diff options
context:
space:
mode:
Diffstat (limited to 'examples/network/doc')
-rw-r--r--examples/network/doc/images/blockingfortuneclient-example.pngbin9199 -> 7013 bytes
-rw-r--r--examples/network/doc/images/dnslookup-example.webpbin0 -> 7532 bytes
-rw-r--r--examples/network/doc/images/fortuneclient-example.pngbin8282 -> 7814 bytes
-rw-r--r--examples/network/doc/images/fortuneserver-example.pngbin7883 -> 6167 bytes
-rw-r--r--examples/network/doc/images/googlesuggest-example.pngbin21272 -> 0 bytes
-rw-r--r--examples/network/doc/images/http-example.pngbin8099 -> 0 bytes
-rw-r--r--examples/network/doc/images/http-example.webpbin0 -> 8250 bytes
-rw-r--r--examples/network/doc/images/loopback-example.pngbin6195 -> 0 bytes
-rw-r--r--examples/network/doc/images/multi-stream-client-example.webpbin0 -> 27060 bytes
-rw-r--r--examples/network/doc/images/multi-stream-server-example.webpbin0 -> 19164 bytes
-rw-r--r--examples/network/doc/images/multicastreceiver-example.pngbin13042 -> 0 bytes
-rw-r--r--examples/network/doc/images/multicastreceiver-example.webpbin0 -> 3280 bytes
-rw-r--r--examples/network/doc/images/multicastsender-example.pngbin21092 -> 0 bytes
-rw-r--r--examples/network/doc/images/multicastsender-example.webpbin0 -> 3502 bytes
-rw-r--r--examples/network/doc/images/network-chat-example.pngbin17453 -> 0 bytes
-rw-r--r--examples/network/doc/images/network-chat-example.webpbin0 -> 11864 bytes
-rw-r--r--examples/network/doc/images/rsslisting.pngbin0 -> 19739 bytes
-rw-r--r--examples/network/doc/images/securesocketclient-example.webpbin0 -> 86522 bytes
-rw-r--r--examples/network/doc/images/securesocketclient.pngbin12056 -> 0 bytes
-rw-r--r--examples/network/doc/images/securesocketclient2.pngbin15532 -> 0 bytes
-rw-r--r--examples/network/doc/images/threadedfortuneserver-example.pngbin16232 -> 5558 bytes
-rw-r--r--examples/network/doc/images/torrent-example.pngbin18915 -> 11343 bytes
-rw-r--r--examples/network/doc/src/blockingfortuneclient.qdoc40
-rw-r--r--examples/network/doc/src/broadcastreceiver.qdoc32
-rw-r--r--examples/network/doc/src/broadcastsender.qdoc32
-rw-r--r--examples/network/doc/src/dnslookup.qdoc17
-rw-r--r--examples/network/doc/src/fortuneclient.qdoc38
-rw-r--r--examples/network/doc/src/fortuneserver.qdoc38
-rw-r--r--examples/network/doc/src/googlesuggest.qdoc177
-rw-r--r--examples/network/doc/src/http.qdoc35
-rw-r--r--examples/network/doc/src/loopback.qdoc38
-rw-r--r--examples/network/doc/src/multicastreceiver.qdoc36
-rw-r--r--examples/network/doc/src/multicastsender.qdoc34
-rw-r--r--examples/network/doc/src/multistreamclient.qdoc15
-rw-r--r--examples/network/doc/src/multistreamserver.qdoc16
-rw-r--r--examples/network/doc/src/network-chat.qdoc34
-rw-r--r--examples/network/doc/src/network-download.qdoc41
-rw-r--r--examples/network/doc/src/network-downloadmanager.qdoc41
-rw-r--r--examples/network/doc/src/rsslisting.qdoc129
-rw-r--r--examples/network/doc/src/securesocketclient.qdoc35
-rw-r--r--examples/network/doc/src/secureudpclient.qdoc29
-rw-r--r--examples/network/doc/src/secureudpserver.qdoc29
-rw-r--r--examples/network/doc/src/threadedfortuneserver.qdoc35
-rw-r--r--examples/network/doc/src/torrent.qdoc29
44 files changed, 259 insertions, 691 deletions
diff --git a/examples/network/doc/images/blockingfortuneclient-example.png b/examples/network/doc/images/blockingfortuneclient-example.png
index cdb7cac0d3..ab918e791d 100644
--- a/examples/network/doc/images/blockingfortuneclient-example.png
+++ b/examples/network/doc/images/blockingfortuneclient-example.png
Binary files differ
diff --git a/examples/network/doc/images/dnslookup-example.webp b/examples/network/doc/images/dnslookup-example.webp
new file mode 100644
index 0000000000..c835cf1af3
--- /dev/null
+++ b/examples/network/doc/images/dnslookup-example.webp
Binary files differ
diff --git a/examples/network/doc/images/fortuneclient-example.png b/examples/network/doc/images/fortuneclient-example.png
index b34a98736d..cae0b066dc 100644
--- a/examples/network/doc/images/fortuneclient-example.png
+++ b/examples/network/doc/images/fortuneclient-example.png
Binary files differ
diff --git a/examples/network/doc/images/fortuneserver-example.png b/examples/network/doc/images/fortuneserver-example.png
index 73f27d5653..55ea8b1c29 100644
--- a/examples/network/doc/images/fortuneserver-example.png
+++ b/examples/network/doc/images/fortuneserver-example.png
Binary files differ
diff --git a/examples/network/doc/images/googlesuggest-example.png b/examples/network/doc/images/googlesuggest-example.png
deleted file mode 100644
index c704f5b2b4..0000000000
--- a/examples/network/doc/images/googlesuggest-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/network/doc/images/http-example.png b/examples/network/doc/images/http-example.png
deleted file mode 100644
index c5f3ef1649..0000000000
--- a/examples/network/doc/images/http-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/network/doc/images/http-example.webp b/examples/network/doc/images/http-example.webp
new file mode 100644
index 0000000000..4f6269ec8b
--- /dev/null
+++ b/examples/network/doc/images/http-example.webp
Binary files differ
diff --git a/examples/network/doc/images/loopback-example.png b/examples/network/doc/images/loopback-example.png
deleted file mode 100644
index 2b1bd4a0f2..0000000000
--- a/examples/network/doc/images/loopback-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/network/doc/images/multi-stream-client-example.webp b/examples/network/doc/images/multi-stream-client-example.webp
new file mode 100644
index 0000000000..6ec651ae9e
--- /dev/null
+++ b/examples/network/doc/images/multi-stream-client-example.webp
Binary files differ
diff --git a/examples/network/doc/images/multi-stream-server-example.webp b/examples/network/doc/images/multi-stream-server-example.webp
new file mode 100644
index 0000000000..95610e7267
--- /dev/null
+++ b/examples/network/doc/images/multi-stream-server-example.webp
Binary files differ
diff --git a/examples/network/doc/images/multicastreceiver-example.png b/examples/network/doc/images/multicastreceiver-example.png
deleted file mode 100644
index 8de11cda63..0000000000
--- a/examples/network/doc/images/multicastreceiver-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/network/doc/images/multicastreceiver-example.webp b/examples/network/doc/images/multicastreceiver-example.webp
new file mode 100644
index 0000000000..2dd0c28036
--- /dev/null
+++ b/examples/network/doc/images/multicastreceiver-example.webp
Binary files differ
diff --git a/examples/network/doc/images/multicastsender-example.png b/examples/network/doc/images/multicastsender-example.png
deleted file mode 100644
index a619b047e3..0000000000
--- a/examples/network/doc/images/multicastsender-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/network/doc/images/multicastsender-example.webp b/examples/network/doc/images/multicastsender-example.webp
new file mode 100644
index 0000000000..b06da08351
--- /dev/null
+++ b/examples/network/doc/images/multicastsender-example.webp
Binary files differ
diff --git a/examples/network/doc/images/network-chat-example.png b/examples/network/doc/images/network-chat-example.png
deleted file mode 100644
index 949bb07d87..0000000000
--- a/examples/network/doc/images/network-chat-example.png
+++ /dev/null
Binary files differ
diff --git a/examples/network/doc/images/network-chat-example.webp b/examples/network/doc/images/network-chat-example.webp
new file mode 100644
index 0000000000..9b8cc1fd8a
--- /dev/null
+++ b/examples/network/doc/images/network-chat-example.webp
Binary files differ
diff --git a/examples/network/doc/images/rsslisting.png b/examples/network/doc/images/rsslisting.png
new file mode 100644
index 0000000000..0b05375f93
--- /dev/null
+++ b/examples/network/doc/images/rsslisting.png
Binary files differ
diff --git a/examples/network/doc/images/securesocketclient-example.webp b/examples/network/doc/images/securesocketclient-example.webp
new file mode 100644
index 0000000000..658f93d053
--- /dev/null
+++ b/examples/network/doc/images/securesocketclient-example.webp
Binary files differ
diff --git a/examples/network/doc/images/securesocketclient.png b/examples/network/doc/images/securesocketclient.png
deleted file mode 100644
index 8736cbc264..0000000000
--- a/examples/network/doc/images/securesocketclient.png
+++ /dev/null
Binary files differ
diff --git a/examples/network/doc/images/securesocketclient2.png b/examples/network/doc/images/securesocketclient2.png
deleted file mode 100644
index 23db851e61..0000000000
--- a/examples/network/doc/images/securesocketclient2.png
+++ /dev/null
Binary files differ
diff --git a/examples/network/doc/images/threadedfortuneserver-example.png b/examples/network/doc/images/threadedfortuneserver-example.png
index 701a0ca035..72315e0b79 100644
--- a/examples/network/doc/images/threadedfortuneserver-example.png
+++ b/examples/network/doc/images/threadedfortuneserver-example.png
Binary files differ
diff --git a/examples/network/doc/images/torrent-example.png b/examples/network/doc/images/torrent-example.png
index 1032716e04..485bc7f719 100644
--- a/examples/network/doc/images/torrent-example.png
+++ b/examples/network/doc/images/torrent-example.png
Binary files differ
diff --git a/examples/network/doc/src/blockingfortuneclient.qdoc b/examples/network/doc/src/blockingfortuneclient.qdoc
index d1c0aa79bf..ec99447b4b 100644
--- a/examples/network/doc/src/blockingfortuneclient.qdoc
+++ b/examples/network/doc/src/blockingfortuneclient.qdoc
@@ -1,33 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example blockingfortuneclient
- \title Blocking Fortune Client Example
+ \title Blocking Fortune Client
+ \examplecategory {Networking}
+ \meta tags {tcp,network,threading,synchronous-io}
\ingroup examples-network
\brief Demonstrates how to create a client for a network service.
@@ -131,7 +109,7 @@
Now we can create a QDataStream object, passing the socket to
QDataStream's constructor, and as in the other client examples we set
- the stream protocol version to QDataStream::Qt_4_0.
+ the stream protocol version to QDataStream::Qt_6_5.
\snippet blockingfortuneclient/fortunethread.cpp 12
@@ -147,7 +125,7 @@
The final part of our loop is that we acquire the mutex so that we can
safely read from our member data. We then let the thread go to sleep by
calling QWaitCondition::wait(). At this point, we can go back to
- requestNewFortune() and look closed at the call to wakeOne():
+ requestNewFortune() and look closely at the call to wakeOne():
\snippet blockingfortuneclient/fortunethread.cpp 1
\dots
@@ -184,7 +162,7 @@
\snippet blockingfortuneclient/blockingclient.cpp 1
The requestNewFortune() slot calls FortuneThread::requestNewFortune(),
- which \e shedules the request. When the thread has received a new fortune
+ which \e schedules the request. When the thread has received a new fortune
and emits newFortune(), our showFortune() slot is called:
\snippet blockingfortuneclient/blockingclient.cpp 2
@@ -193,5 +171,5 @@
Here, we simply display the fortune we received as the argument.
- \sa {Fortune Client Example}, {Fortune Server Example}
+ \sa {Fortune Client}, {Fortune Server}
*/
diff --git a/examples/network/doc/src/broadcastreceiver.qdoc b/examples/network/doc/src/broadcastreceiver.qdoc
index f53358e936..cb134c699d 100644
--- a/examples/network/doc/src/broadcastreceiver.qdoc
+++ b/examples/network/doc/src/broadcastreceiver.qdoc
@@ -1,33 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example broadcastreceiver
- \title Broadcast Receiver Example
+ \title Broadcast Receiver
+ \examplecategory {Networking}
+ \meta tags {network,broadcast,udp}
\ingroup examples-network
\brief Demonstrates how to receive information broadcasted over a local network.
diff --git a/examples/network/doc/src/broadcastsender.qdoc b/examples/network/doc/src/broadcastsender.qdoc
index fece94e2cb..d02b179b77 100644
--- a/examples/network/doc/src/broadcastsender.qdoc
+++ b/examples/network/doc/src/broadcastsender.qdoc
@@ -1,33 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example broadcastsender
- \title Broadcast Sender Example
+ \title Broadcast Sender
+ \examplecategory {Networking}
+ \meta tags {network,broadcast,udp}
\ingroup examples-network
\brief Demonstrates how to broadcast information to multiple clients on a local network.
diff --git a/examples/network/doc/src/dnslookup.qdoc b/examples/network/doc/src/dnslookup.qdoc
new file mode 100644
index 0000000000..0a5a69f70a
--- /dev/null
+++ b/examples/network/doc/src/dnslookup.qdoc
@@ -0,0 +1,17 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \example dnslookup
+ \title DNS lookup
+ \examplecategory {Networking}
+ \meta tags {network,dns,command line parser,command line,console}
+ \ingroup examples-network
+ \brief Demonstrates how to lookup a host name using QDnsLookup.
+
+ This example uses QDnsLookup to demonstrate how to look up a host
+ name and print the results on the command line. As well as how you can
+ use QCommandLineParser to parse command line arguments.
+
+ \image dnslookup-example.webp
+*/
diff --git a/examples/network/doc/src/fortuneclient.qdoc b/examples/network/doc/src/fortuneclient.qdoc
index 4cb7544fc0..054937e893 100644
--- a/examples/network/doc/src/fortuneclient.qdoc
+++ b/examples/network/doc/src/fortuneclient.qdoc
@@ -1,33 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example fortuneclient
- \title Fortune Client Example
+ \title Fortune Client
+ \examplecategory {Networking}
+ \meta tags {tcp,network}
\ingroup examples-network
\brief Demonstrates how to create a client for a network service.
@@ -62,7 +40,7 @@
\endlist
In this example, we will demonstrate the asynchronous approach. The
- \l{blockingfortuneclient}{Blocking Fortune Client Example}
+ \l{blockingfortuneclient}{Blocking Fortune Client} example
illustrates the synchronous approach.
Our class contains some data and a few private slots:
@@ -83,7 +61,7 @@
The protocol is based on QDataStream, so we set the stream device to the
newly created socket. We then explicitly set the protocol version of the
- stream to QDataStream::Qt_4_0 to ensure that we're using the same version
+ stream to QDataStream::Qt_6_5 to ensure that we're using the same version
as the fortune server, no matter which version of Qt the client and
server use.
@@ -156,5 +134,5 @@
After a successful read transaction, we call QLabel::setText() to display
the fortune.
- \sa {Fortune Server Example}, {Blocking Fortune Client Example}
+ \sa {Fortune Server}, {Blocking Fortune Client}
*/
diff --git a/examples/network/doc/src/fortuneserver.qdoc b/examples/network/doc/src/fortuneserver.qdoc
index acd05da696..1973f372ce 100644
--- a/examples/network/doc/src/fortuneserver.qdoc
+++ b/examples/network/doc/src/fortuneserver.qdoc
@@ -1,39 +1,17 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example fortuneserver
- \title Fortune Server Example
+ \title Fortune Server
+ \examplecategory {Networking}
+ \meta tags {tcp,network,server}
\ingroup examples-network
\brief Demonstrates how to create a server for a network service.
This example is intended to be run alongside the
\l{fortuneclient}{Fortune Client} example or the
- \l{blockingfortuneclient}{Blocking Fortune Client Example}.
+ \l{blockingfortuneclient}{Blocking Fortune Client} example.
\image fortuneserver-example.png Screenshot of the Fortune Server example
@@ -72,7 +50,7 @@
to the connecting socket. This is a common way to transfer binary data
using QTcpSocket. First we create a QByteArray and a QDataStream object,
passing the bytearray to QDataStream's constructor. We then explicitly set
- the protocol version of QDataStream to QDataStream::Qt_4_0 to ensure that
+ the protocol version of QDataStream to QDataStream::Qt_5_10 to ensure that
we can communicate with clients from future versions of Qt (see
QDataStream::setVersion()). We continue by streaming in a random fortune.
@@ -93,5 +71,5 @@
will then close, which in turn will cause QObject::deleteLater() to delete
it.
- \sa {Fortune Client Example}, {Threaded Fortune Server Example}
+ \sa {Fortune Client}, {Threaded Fortune Server}
*/
diff --git a/examples/network/doc/src/googlesuggest.qdoc b/examples/network/doc/src/googlesuggest.qdoc
deleted file mode 100644
index adb87f4b66..0000000000
--- a/examples/network/doc/src/googlesuggest.qdoc
+++ /dev/null
@@ -1,177 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example googlesuggest
- \title Google Suggest Example
- \ingroup examples-network
- \brief Obtains the list of search recommendations by the Google search engine.
-
- The example uses the QNetworkAccessManager to obtain the list of search
- recommendations by Google as the user types into a QLineEdit.
-
- \image googlesuggest-example.png
-
- The application makes use of the \c get function in
- QNetworkAccessManager to post a request and obtain the result of the search
- query sent to the Google search engine. The results returned are listed as
- clickable links appearing below the search box as a drop-down menu.
-
- The widget is built up by a QLineEdit as the search box, and a QTreeView
- used as a popup menu below the search box.
-
- \section1 GSuggestCompletion Class Declaration
-
- This class implements an event filter and a number of functions to display
- the search results and to determent when and how to perform the search.
-
- \snippet googlesuggest/googlesuggest.h 1
-
- The class connects to a QLineEdit and uses a QTreeWidget to display the
- results. A QTimer controls the start of the network requests that are
- executed using a QNetworkAccessManager.
-
- \section1 GSuggestCompletion Class Implementation
-
- We start by defining a constant containing the URL to be used in the Google
- queries. This is the basis for the query. The letters typed into the search
- box will be added to the query to perform the search itself.
-
- \snippet googlesuggest/googlesuggest.cpp 1
-
- In the constructor, we set the parent of this GSuggestCompletion instance
- to be the QLineEdit passed in. For simplicity, the QLineEdit is also stored
- in the explicit \c editor member variable.
-
- We then create a QTreeWidget as a toplevel widget and configure the various
- properties to give it the look of a popup widget. The widget is populated
- with the results by Google Suggest API request.
-
- Furthermore, we install the GSuggestCompletion instance as an event filter
- on the QTreeWidget, and connect the \c itemClicked() signal with the \c
- doneCompletion() slot.
-
- A single-shot QTimer is used to start the request when the user has stopped
- typing for 500 ms.
-
- Finally, we connect the networkManagers \c finished() signal with the \c
- handleNetworkData() slot to handle the incoming data.
-
- \snippet googlesuggest/googlesuggest.cpp 2
-
- Since the QTreeWidget popup has been instantiated as a toplevel widget, the
- destructor has to delete it explicitly from memory to avoid a memory leak.
-
- \snippet googlesuggest/googlesuggest.cpp 3
-
- The event filter handles mouse press and key press events that are
- delivered to the popup. For mouse press events we just hide the popup and
- return focus to the editor widget, and then return true to prevent further
- event processing.
-
- Key event handling is implemented so that Enter and Return execute the
- selected link, while the Escape key hides the popup. Since we want to be
- able to navigate the list of suggestions using the different navigation
- keys on the keyboard we let Qt continue regular event processing for those
- by returning false from the eventFilter reimplementation.
-
- For all other keys, the event will be passed on to the editor widget and the
- popup is hidden. This way the user's typing will not be interrupted by the
- popping up of the completion list.
-
- \snippet googlesuggest/googlesuggest.cpp 4
-
- The \c showCompletion() function populates the QTreeWidget with the results
- returned from the query. It takes a QStringList of the suggested search
- terms.
-
- \snippet googlesuggest/googlesuggest.cpp 5
-
- A QTreeWidgetItem is created for each index in the list and inserted into
- the QTreeWidget. Finally, we adjust position and size of the popup to make
- sure that it pops up in the correct position below the editor, and show it.
-
- The \c doneCompletion() function, which is called by the event filter when
- either Enter or Return keys are pressed, stops the timer to prevent further
- requests and passes the text of the selected item to the editor. We then
- make the \c editor QLineEdit emit the returnPressed() signal, to which the
- application can connect to open the respective web page.
-
- \snippet googlesuggest/googlesuggest.cpp 6
-
- The \c autoSuggest() slot is called when the timer times out, and uses the
- text in the editor to build the complete search query. The query is then
- passed to the QNetworkAccessManager's \c get() function to start the
- request.
-
- \snippet googlesuggest/googlesuggest.cpp 7
-
- The function \c preventSuggest() stops the timer to prevent further
- requests from being started.
-
- \snippet googlesuggest/googlesuggest.cpp 8
-
- When the network request is finished, the QNetworkAccessManager delivers the
- data received from the server through the networkReply object.
-
- \snippet googlesuggest/googlesuggest.cpp 9
-
- To extract the data from the reply we use the \c readAll() function, which
- is inherited from QIODevice and returns a QByteArray. Since this data is
- encoded in XML we can use a QXmlStreamReader to traverse the data and
- extract the search result as QStrings, which we can stream into two
- QStringLists used to populate the popup.
-
- Finally, we schedule the QNetworkReply object for deletion using the \c
- deleteLater function.
-
- \section1 SearchBox Class Declaration
-
- The SearchBox class inherits QLineEdit and adds the protected slot \c
- doSearch().
-
- A \c GSuggestCompletion member provides the SearchBox with the request
- functionality and the suggestions returned from the Google search engine.
-
- \snippet googlesuggest/searchbox.h 1
-
- \section1 SearchBox Class Implementation
-
- The search box constructor instantiates the GSuggestCompletion object and
- connects the returnPressed() signal to the doSearch() slot.
-
- \snippet googlesuggest/searchbox.cpp 1
-
- The function \c doSearch() stops the completer from sending any further
- queries to the search engine.
-
- Further, the function extracts the selected search phrase and opens it
- in the default web browser using QDesktopServices.
-
- \snippet googlesuggest/searchbox.cpp 2
-
-*/
diff --git a/examples/network/doc/src/http.qdoc b/examples/network/doc/src/http.qdoc
index 815775c51d..c155997394 100644
--- a/examples/network/doc/src/http.qdoc
+++ b/examples/network/doc/src/http.qdoc
@@ -1,40 +1,19 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example http
- \title HTTP Example
+ \examplecategory {Networking}
+ \examplecategory {Web Technologies}
+ \meta tags {http,network,https,proxy}
+ \title HTTP Client
\ingroup examples-network
\brief Demonstrates a simple HTTP client.
This example demonstrates how a simple HTTP client can fetch files
from remote hosts.
- \image http-example.png
+ \image http-example.webp
The main work of this example is done in the HttpWindow class.
Thus we will focus on that.
diff --git a/examples/network/doc/src/loopback.qdoc b/examples/network/doc/src/loopback.qdoc
deleted file mode 100644
index f97c9f9c71..0000000000
--- a/examples/network/doc/src/loopback.qdoc
+++ /dev/null
@@ -1,38 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example loopback
- \title Loopback Example
- \ingroup examples-network
- \brief Demonstrates the client-server communication on a local host.
-
- The example demonstrates how the clients and servers on a local host
- communicate with each other.
-
- \image loopback-example.png
-*/
diff --git a/examples/network/doc/src/multicastreceiver.qdoc b/examples/network/doc/src/multicastreceiver.qdoc
index 3709750436..16c7235c17 100644
--- a/examples/network/doc/src/multicastreceiver.qdoc
+++ b/examples/network/doc/src/multicastreceiver.qdoc
@@ -1,36 +1,14 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example multicastreceiver
- \title Multicast Receiver Example
+ \title Multicast Receiver
+ \examplecategory {Networking}
+ \meta tags {network,multicast,ipv6,ipv4,udp}
\ingroup examples-network
\brief Demonstrates how to receive information sent to a multicast group.
- This example demonstrates how to receive messages sent to a multicast group
- \image multicastreceiver-example.png
+ This example demonstrates how to receive messages sent to a multicast group.
+ \image multicastreceiver-example.webp
*/
diff --git a/examples/network/doc/src/multicastsender.qdoc b/examples/network/doc/src/multicastsender.qdoc
index 72558eb062..26e0d951fe 100644
--- a/examples/network/doc/src/multicastsender.qdoc
+++ b/examples/network/doc/src/multicastsender.qdoc
@@ -1,38 +1,16 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example multicastsender
- \title Multicast Sender Example
+ \title Multicast Sender
+ \examplecategory {Networking}
+ \meta tags {network,multicast,ipv6,ipv4,udp}
\ingroup examples-network
\brief Demonstrates how to send messages to a multicast group.
This example demonstrates how to send messages to the clients of a
multicast group.
- \image multicastsender-example.png
+ \image multicastsender-example.webp
*/
diff --git a/examples/network/doc/src/multistreamclient.qdoc b/examples/network/doc/src/multistreamclient.qdoc
new file mode 100644
index 0000000000..bb70eac741
--- /dev/null
+++ b/examples/network/doc/src/multistreamclient.qdoc
@@ -0,0 +1,15 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \example multistreamclient
+ \title Multi-stream Client
+ \examplecategory {Networking}
+ \meta tags {network,sctp}
+ \ingroup examples-network
+ \brief Demonstrates how to use SCTP on the client side.
+
+ This example demonstrates how to use SCTP, with multiple channels,
+ to interact with other clients through a server.
+ \image multi-stream-client-example.webp
+*/
diff --git a/examples/network/doc/src/multistreamserver.qdoc b/examples/network/doc/src/multistreamserver.qdoc
new file mode 100644
index 0000000000..9e498be3c9
--- /dev/null
+++ b/examples/network/doc/src/multistreamserver.qdoc
@@ -0,0 +1,16 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \example multistreamserver
+ \title Multi-stream Server
+ \examplecategory {Networking}
+ \meta tags {network,sctp}
+ \ingroup examples-network
+ \brief Demonstrates how to use SCTP on the server side.
+
+ This example demonstrates how to use SCTP, with multiple channels,
+ on the server side, receiving multiple connections and sending
+ messages to connected clients.
+ \image multi-stream-server-example.webp
+*/
diff --git a/examples/network/doc/src/network-chat.qdoc b/examples/network/doc/src/network-chat.qdoc
index 85edf611b6..6a8f0024e3 100644
--- a/examples/network/doc/src/network-chat.qdoc
+++ b/examples/network/doc/src/network-chat.qdoc
@@ -1,38 +1,16 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example network-chat
- \title Network Chat Example
+ \title Network Chat
\ingroup examples-network
+ \examplecategory {Networking}
+ \meta tag {network,serialization}
\brief Demonstrates a stateful peer-to-peer Chat client.
This example uses broadcasting with QUdpSocket and QNetworkInterface to
discover its peers.
- \image network-chat-example.png
+ \image network-chat-example.webp
*/
diff --git a/examples/network/doc/src/network-download.qdoc b/examples/network/doc/src/network-download.qdoc
deleted file mode 100644
index 9d171e4142..0000000000
--- a/examples/network/doc/src/network-download.qdoc
+++ /dev/null
@@ -1,41 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example download
- \title Network Download Example
- \brief Demonstrates how to use networking APIs for multiple downloads.
- \ingroup examples-network
-
- The Network Download example shows how to perform multiple downloads in
- parallel using the QNetworkAccessManager class.
-
- This example is designed to be run from the command-line.
-
- The \l{Network Download Manager Example} implements a more complex system
- that places files in a queue for sequential downloading.
-*/
diff --git a/examples/network/doc/src/network-downloadmanager.qdoc b/examples/network/doc/src/network-downloadmanager.qdoc
deleted file mode 100644
index f89ed66616..0000000000
--- a/examples/network/doc/src/network-downloadmanager.qdoc
+++ /dev/null
@@ -1,41 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example downloadmanager
- \title Network Download Manager Example
- \brief Demonstrates how to use the networking APIs for multiple downloads.
- \ingroup examples-network
-
- The Network Download example shows how to implement a queue for multiple
- downloads using the QNetworkAccessManager class.
-
- This example is designed to be run from the command-line.
-
- See the \l{Network Download Example} for a simpler version of this example
- that obtains multiple files in parallel.
-*/
diff --git a/examples/network/doc/src/rsslisting.qdoc b/examples/network/doc/src/rsslisting.qdoc
new file mode 100644
index 0000000000..a1e91932f6
--- /dev/null
+++ b/examples/network/doc/src/rsslisting.qdoc
@@ -0,0 +1,129 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+ \example rsslisting
+ \examplecategory {Networking}
+ \meta tag {serialization}
+ \title A minimal RSS listing application
+
+ \brief A demonstration of how to fetch and display a network resource.
+
+ This example shows how to fetch a resource the user has requested and
+ display data contained in the response, illustrated by an RSS listing
+ application. (RDF Site Summary, or Really Simple Syndication, is a standard
+ format for communicating updates to web sites. See
+ https://www.rssboard.org/rss-specification for details.) The user inferface
+ in the illustration is simple, as the focus of this example is on how to use
+ networking, but naturally a more sophisticated interface would be wanted for
+ a serious RSS reader.
+
+ The example also illustrates how to do asynchronous parsing of data as it is
+ received, preserving state in member variables so that an incremental parser
+ can consume chunks of data as they arrive over the network. Constituents of
+ the parsed content may start in one chunk of data but not be completed until
+ a later chunk, requiring the parser to retain state between calls.
+
+ \image rsslisting.png
+
+ The main program is fairly minimal. It simply instantiates a \l QApplication
+ and the \c RSSListing widget, shows the latter and hands over control to the
+ former. For the sake of illustration, it gives the widget the Qt blog's URL
+ as default value for the resource to check.
+
+ \snippet rsslisting/main.cpp 0
+
+ \section1 The RSSListing class
+
+ \snippet rsslisting/rsslisting.h 0
+
+ The widget itself provides a simple user interface for specifying the URL to
+ fetch and, once available updates are displayed, controlling the downloading
+ of updated items. A \l QLineEdit provides for input of the URL, and a
+ \l QTreeWidget for display of the results once fetched.
+
+ The widget downloads and parses the RSS (a form of XML) asynchronously,
+ feeding the data to an XML reader as it arrives. This supports reading of
+ very large data sources. Because the data is streamed from the network
+ through the XML reader, there is no need to retain the full text of the XML
+ in memory. In other context, a similar approach can allow the user to
+ interrupt such incremental loading.
+
+ \section2 Construction
+
+ \snippet rsslisting/rsslisting.cpp setup
+
+ The constructor sets up the assorted components of the widget and connects
+ their various signals to the slots it shall use to handle them.
+
+ The user interface consists of a line edit, a push button, and a list view
+ widget. The line edit is used for entering the URL to fetch; the push button
+ starts the process of fetching updates. The line edit is empty by default,
+ but the constructor's caller can override that, as our \c main() has done.
+ In any case, the user can replace the default with the URL of another RSS
+ feed.
+
+ The list view shows the updated items reported in the RSS feed.
+ Double-clicking on one of these sends its URL to the user's browser or other
+ user agent using \l QDesktopServices::openUrl().
+
+ \section2 The slots
+
+ \snippet rsslisting/rsslisting.cpp slots
+
+ All slots are kept simple by delegating any hard work to private methods.
+
+ When the user completes input of a URL, either by clicking the "Fetch"
+ button or by pressing the return key in the line edit, the \c fetch() slot
+ disables the "Fetch" button and disables further editing of the line edit.
+ It clears the display of available updates and delegates to \c get() the
+ initiating of an HTTP GET request.
+
+ When data is received, the network reply triggers its \l {QNetworkReply::}
+ {readyRead()} signal, which \c get() connects to the \c consumeData()
+ slot. This checks the response got a successful status code and, if it did,
+ calls \c parseXml() to consume the data.
+
+ If the network reply gets an error, this is delivered to the \c error()
+ slot, which reports the error, clears the XML stream reader then disconnects
+ from the reply and deletes it.
+
+ On completion (whether successful or otherwise) of a network reply, the \c
+ finished() slot restores the UI to be ready to accept a new URL to fetch by
+ re-enabling the line edit and "Fetch" button.
+
+ \section2 The get() method
+
+ \snippet rsslisting/rsslisting.cpp get
+
+ The private \c get() method is used by the \c fetch() slot to initiate an
+ HTTP GET request. It first clears the XML stream reader and, if a reply is
+ currently active, disconnects and deletes it. If the URL it has been passed
+ is valid, it asks the network access manager to GET it. It connects its
+ relevant slots to signals of the resulting reply (if any) and sets up its
+ XML stream reader to read data from the reply - a network reply object is
+ also a \c QIODevice, from which data can be read.
+
+ \section2 The parseXml() method
+
+ \snippet rsslisting/rsslisting.cpp parse
+
+ When data is received, and thus made available to the XML stream reader, \c
+ parseXml() reads from the XML stream, checking for \c item elements and,
+ within them, \c title and \c link elements. It will use the \c{rss:about}
+ attribute of an \c item as URL in the Link column of the tree-view, failing
+ that the content of its \c link element; and it uses the content of the \c
+ title element in the Title column of the tree-view. As each \c item element
+ closes, its details are turned into a new row in the tree widget, with the
+ extracted title and URL in the Title and Link columns.
+
+ The variables that keep track of the parsing state - \c linkString, \c
+ titleString and \c currentTag - are member variables of the \c RSSListing
+ class, even though they are only accessed from this method, because this
+ method may be called repeatedly, as new data arrives, and one chunk of
+ received data may start an element that isn't completed until a later chunk
+ arrives. This enables the parser to operate asynchronously as the data
+ arrives, instead of having to wait until all the data has arrived.
+
+ \sa QNetworkReply, QXmlStreamReader
+*/
diff --git a/examples/network/doc/src/securesocketclient.qdoc b/examples/network/doc/src/securesocketclient.qdoc
index 78cfab7af4..7ff3ae6da5 100644
--- a/examples/network/doc/src/securesocketclient.qdoc
+++ b/examples/network/doc/src/securesocketclient.qdoc
@@ -1,33 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example securesocketclient
- \title Secure Socket Client Example
+ \title Secure Socket Client
+ \examplecategory {Networking}
+ \meta tags {tcp,network,tls,ssl}
\ingroup examples-network
\brief Demonstrates how to communicate over an encrypted (SSL) connection.
@@ -35,6 +13,5 @@
encrypted connection, deal with authenticity problems, and display security
and certificate information.
- \image securesocketclient.png
- \image securesocketclient2.png
+ \image securesocketclient-example.webp
*/
diff --git a/examples/network/doc/src/secureudpclient.qdoc b/examples/network/doc/src/secureudpclient.qdoc
index dc8538cf85..b7a51c0814 100644
--- a/examples/network/doc/src/secureudpclient.qdoc
+++ b/examples/network/doc/src/secureudpclient.qdoc
@@ -1,33 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example secureudpclient
\title DTLS client
+ \examplecategory {Networking}
\ingroup examples-network
\brief This example demonstrates how to implement client-side DTLS connections.
diff --git a/examples/network/doc/src/secureudpserver.qdoc b/examples/network/doc/src/secureudpserver.qdoc
index 0857f7065f..3d224d91bc 100644
--- a/examples/network/doc/src/secureudpserver.qdoc
+++ b/examples/network/doc/src/secureudpserver.qdoc
@@ -1,33 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example secureudpserver
\title DTLS server
+ \examplecategory {Networking}
\ingroup examples-network
\brief This examples demonstrates how to implement a simple DTLS server.
diff --git a/examples/network/doc/src/threadedfortuneserver.qdoc b/examples/network/doc/src/threadedfortuneserver.qdoc
index 9ba76c8a0b..51198061e6 100644
--- a/examples/network/doc/src/threadedfortuneserver.qdoc
+++ b/examples/network/doc/src/threadedfortuneserver.qdoc
@@ -1,33 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example threadedfortuneserver
- \title Threaded Fortune Server Example
+ \title Threaded Fortune Server
+ \examplecategory {Networking}
+ \meta tags {tcp,network,threading,server,synchronous-io}
\ingroup examples-network
\brief The Threaded Fortune Server example shows how to create a server for a
@@ -103,6 +81,5 @@
the socket has disconnected. Because we are running in a separate thread,
the GUI will remain responsive.
- \sa {Fortune Server Example}, {Fortune Client Example}, {Blocking Fortune
- Client Example}
+ \sa {Fortune Server}, {Fortune Client}, {Blocking Fortune Client}
*/
diff --git a/examples/network/doc/src/torrent.qdoc b/examples/network/doc/src/torrent.qdoc
index 8d69bee6d1..124a697293 100644
--- a/examples/network/doc/src/torrent.qdoc
+++ b/examples/network/doc/src/torrent.qdoc
@@ -1,33 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example torrent
\title Torrent Example
+ \examplecategory {Networking}
\ingroup examples-network
\brief Demonstrates complex TCP/IP operations.