This commit is contained in:
Nyall Dawson 2019-02-01 12:33:03 +10:00
parent 630cd02121
commit 03a2a03dcf
2 changed files with 28 additions and 0 deletions

View File

@ -110,8 +110,22 @@ Returns the original network request.
%End
void setContent( const QByteArray &content );
%Docstring
Sets the reply content. This is not done by default, as reading network reply content
can only be done once.
.. seealso:: :py:func:`content`
%End
QByteArray content() const;
%Docstring
Returns the reply content. This is not available by default, as reading network reply content
can only be done once.
Blocking network requests (see :py:class:`QgsBlockingNetworkRequest`) will automatically populate this content.
.. seealso:: :py:func:`setContent`
%End
};

View File

@ -139,8 +139,22 @@ class CORE_EXPORT QgsNetworkReplyContent
*/
QNetworkRequest request() const { return mRequest; }
/**
* Sets the reply content. This is not done by default, as reading network reply content
* can only be done once.
*
* \see content()
*/
void setContent( const QByteArray &content ) { mContent = content; }
/**
* Returns the reply content. This is not available by default, as reading network reply content
* can only be done once.
*
* Blocking network requests (see QgsBlockingNetworkRequest) will automatically populate this content.
*
* \see setContent()
*/
QByteArray content() const { return mContent; }
private: