QXmppHttpUpload Class
| Header: | #include <QXmppHttpUpload> |
| Since: | QXmpp 1.5 |
Public Types
Properties
- bytesSent : const quint64
- bytesTotal : const quint64
- progress : const float
Public Functions
| quint64 | bytesSent() const |
| quint64 | bytesTotal() const |
| void | cancel() |
| bool | isFinished() const |
| float | progress() const |
| std::optional<QXmppHttpUpload::Result> | result() const |
Signals
| void | finished(const QXmppHttpUpload::Result &result) |
| void | progressChanged() |
Detailed Description
Object that represents an ongoing or finished upload.
Member Type Documentation
[alias] QXmppHttpUpload::Result
Represents the result of an upload. It can either be a url to the uploaded file, a QXmppHttpUpload::Cancelled unit struct, or an error as QXmppError.
Property Documentation
[read-only] bytesSent : const quint64
Number of bytes sent so far
Access functions:
| quint64 | bytesSent() const |
Notifier signal:
| void | progressChanged() |
[read-only] bytesTotal : const quint64
Number of bytes that need to be sent in total to complete the upload
Access functions:
| quint64 | bytesTotal() const |
Notifier signal:
| void | progressChanged() |
[read-only] progress : const float
The current progress of the upload as a floating point number between 0 and 1.
Access functions:
| float | progress() const |
Notifier signal:
| void | progressChanged() |
Member Function Documentation
quint64 QXmppHttpUpload::bytesSent() const
The number of bytes sent so far.
Note: Getter function for property bytesSent.
quint64 QXmppHttpUpload::bytesTotal() const
The number of bytes that need to be sent in total to complete the upload.
Note: Getter function for property bytesTotal.
void QXmppHttpUpload::cancel()
Cancels the upload.
[signal] void QXmppHttpUpload::finished(const QXmppHttpUpload::Result &result)
Emitted when the upload has finished for any reason (success, cancelled, error). result is the result of the upload.
bool QXmppHttpUpload::isFinished() const
Returns whether the upload is already finished.
float QXmppHttpUpload::progress() const
Returns the current progress of the upload as a floating point number between 0 and 1.
Note: Getter function for property progress.
[signal] void QXmppHttpUpload::progressChanged()
Emitted when the upload has made progress.
Note: Notifier signal for property bytesSent. Notifier signal for property bytesTotal. Notifier signal for property progress.
std::optional<QXmppHttpUpload::Result> QXmppHttpUpload::result() const
If the upload has already finished, returns the result of the upload as QXmppHttpUpload::Result, otherwise returns an empty std::optional.