QXmpp Version: 1.7.0
Loading...
Searching...
No Matches
QXmppHttpUpload Class Reference

Inherits QObject.

Public Types

using Result = std::variant<QUrl, QXmpp::Cancelled, QXmppError>
 

Public Member Functions

float progress () const
 
quint64 bytesSent () const
 
quint64 bytesTotal () const
 
void cancel ()
 
bool isFinished () const
 
std::optional< Resultresult () const
 
Q_SIGNAL void progressChanged ()
 
Q_SIGNAL void finished (const QXmppHttpUpload::Result &result)
 

Properties

float progress
 
quint64 bytesSent
 
quint64 bytesTotal
 

Friends

class QXmppHttpUploadManager
 

Detailed Description

Object that represents an ongoing or finished upload.

Since
QXmpp 1.5

Member Typedef Documentation

◆ Result

using QXmppHttpUpload::Result = std::variant<QUrl, QXmpp::Cancelled, QXmppError>

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.

Member Function Documentation

◆ bytesSent()

quint64 QXmppHttpUpload::bytesSent ( ) const

The number of bytes sent so far.

◆ bytesTotal()

quint64 QXmppHttpUpload::bytesTotal ( ) const

The number of bytes that need to be sent in total to complete the upload.

◆ cancel()

void QXmppHttpUpload::cancel ( )

Cancels the upload.

◆ finished()

Q_SIGNAL void QXmppHttpUpload::finished ( const QXmppHttpUpload::Result & result)

Emitted when the upload has finished for any reason (success, cancelled, error).

Parameters
resultResult of the upload

◆ isFinished()

bool QXmppHttpUpload::isFinished ( ) const

Returns whether the upload is already finished.

◆ progress()

float QXmppHttpUpload::progress ( ) const

Returns the current progress of the upload as a floating point number between 0 and 1.

◆ progressChanged()

Q_SIGNAL void QXmppHttpUpload::progressChanged ( )

Emitted when the upload has made progress.

◆ result()

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.

Property Documentation

◆ bytesSent

quint64 QXmppHttpUpload::bytesSent
read

Number of bytes sent so far

◆ bytesTotal

quint64 QXmppHttpUpload::bytesTotal
read

Number of bytes that need to be sent in total to complete the upload

◆ progress

float QXmppHttpUpload::progress
read

The current progress of the upload as a floating point number between 0 and 1.


The documentation for this class was generated from the following files: