diff options
Diffstat (limited to 'src/core/api/qwebengineurlrequestjob.cpp')
-rw-r--r-- | src/core/api/qwebengineurlrequestjob.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/api/qwebengineurlrequestjob.cpp b/src/core/api/qwebengineurlrequestjob.cpp index a071adbd5..47aab48a0 100644 --- a/src/core/api/qwebengineurlrequestjob.cpp +++ b/src/core/api/qwebengineurlrequestjob.cpp @@ -115,12 +115,20 @@ QByteArray QWebEngineUrlRequestJob::requestMethod() const /*! Replies to the request with \a device and the MIME type \a contentType. + The user has to be aware that \a device will be used on another thread until the job is deleted. In case simultaneous access from the main thread is desired, the user is reponsible for making access to \a device thread-safe for example by using QMutex. Note that the \a device object is not owned by the web engine. Therefore, the signal QObject::destroyed() of QWebEngineUrlRequestJob must be monitored. + + The device should remain available at least as long as the job exists. + When calling this method with a newly constructed device, one solution is to + make the device delete itself when closed, like this: + \code + connect(device, &QIODevice::aboutToClose, device, &QObject::deleteLater); + \endcode */ void QWebEngineUrlRequestJob::reply(const QByteArray &contentType, QIODevice *device) { |