summaryrefslogtreecommitdiffstats
path: root/src/network/access/qrestreply.cpp
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@qt.io>2024-01-25 09:46:34 +0200
committerJuha Vuolle <juha.vuolle@qt.io>2024-01-29 19:02:37 +0200
commitefa178d42c5e9e8c6dc526430f201f16a67149c3 (patch)
tree321385e7a7bea734372d21fde72ede0c506a5c73 /src/network/access/qrestreply.cpp
parent9ba5c7ff6aa42c5701cf950d2137467a2d178833 (diff)
Update QRestReply documentation
To accommodate the deduplication and non-owning changes in previous commit. Resulted from API-review Pick-to: 6.7 Change-Id: Ie1c4e9959c1ba7e8ed2be6607d9f6497ae15af39 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/network/access/qrestreply.cpp')
-rw-r--r--src/network/access/qrestreply.cpp46
1 files changed, 38 insertions, 8 deletions
diff --git a/src/network/access/qrestreply.cpp b/src/network/access/qrestreply.cpp
index 2cf8e19cb54..7cf9975ecc4 100644
--- a/src/network/access/qrestreply.cpp
+++ b/src/network/access/qrestreply.cpp
@@ -19,8 +19,7 @@ Q_DECLARE_LOGGING_CATEGORY(lcQrest)
/*!
\class QRestReply
\since 6.7
- \brief QRestReply is the class for following up the requests sent with
- QRestAccessManager.
+ \brief QRestReply is a convenience wrapper for QNetworkReply.
\reentrant
\ingroup network
@@ -28,13 +27,23 @@ Q_DECLARE_LOGGING_CATEGORY(lcQrest)
\preliminary
- QRestReply is a convenience class for typical RESTful client
- applications. It wraps the more detailed QNetworkReply and provides
- convenience methods for data and status handling.
+ QRestReply wraps a QNetworkReply and provides convenience methods for data
+ and status handling. The methods provide convenience for typical RESTful
+ client applications.
- \sa QRestAccessManager, QNetworkReply
+ QRestReply doesn't take ownership of the wrapped QNetworkReply, and the
+ lifetime and ownership of the reply is as defined by QNetworkAccessManager
+ documentation.
+
+ QRestReply object is not copyable, but is movable.
+
+ \sa QRestAccessManager, QNetworkReply, QNetworkAccessManager,
+ QNetworkAccessManager::setAutoDeleteReplies()
*/
+/*!
+ Creates a QRestReply and initializes the wrapped QNetworkReply to \a reply.
+*/
QRestReply::QRestReply(QNetworkReply *reply)
: wrapped(reply)
{
@@ -51,6 +60,26 @@ QRestReply::~QRestReply()
}
/*!
+ \fn QRestReply::QRestReply(QRestReply &&other) noexcept
+
+ Move-constructs the reply from \a other.
+
+ \note The moved-from object \a other is placed in a
+ partially-formed state, in which the only valid operations are
+ destruction and assignment of a new value.
+*/
+
+/*!
+ \fn QRestReply &QRestReply::operator=(QRestReply &&other) noexcept
+
+ Move-assigns \a other and returns a reference to this reply.
+
+ \note The moved-from object \a other is placed in a
+ partially-formed state, in which the only valid operations are
+ destruction and assignment of a new value.
+*/
+
+/*!
Returns a pointer to the underlying QNetworkReply wrapped by this object.
*/
QNetworkReply *QRestReply::networkReply() const
@@ -106,7 +135,8 @@ std::optional<QJsonDocument> QRestReply::json(QJsonParseError *error)
calls to get response data will return empty until further data has been
received.
- \sa json(), text(), bytesAvailable(), readyRead()
+ \sa json(), text(), QNetworkReply::bytesAvailable(),
+ QNetworkReply::readyRead()
*/
QByteArray QRestReply::body()
{
@@ -127,7 +157,7 @@ QByteArray QRestReply::body()
decoding is not supported by \l QStringConverter, or if the decoding
has errors (for example invalid characters).
- \sa json(), body(), isFinished(), finished()
+ \sa json(), body(), QNetworkReply::readyRead()
*/
QString QRestReply::text()
{