QBluetoothTransferReply Class

The QBluetoothTransferReply class stores the response for a data transfer request. 更多...

头文件: #include <QBluetoothTransferReply>
qmake: QT += bluetooth
开始支持版本: Qt 5.2
基类: QObject

公有类型

enum TransferError { NoError, UnknownError, FileNotFoundError, HostNotFoundError, ..., SessionError }

公有函数

~QBluetoothTransferReply()
virtual TransferError error() const = 0
virtual QString errorString() const = 0
virtual bool isFinished() const = 0
virtual bool isRunning() const = 0
QBluetoothTransferManager *manager() const
QBluetoothTransferRequest request() const
  • 32 个公有函数继承自 QObject

公有槽函数

void abort()
  • 1 个公有槽函数继承自 QObject

信号

void error(QBluetoothTransferReply::TransferError errorType)
void finished(QBluetoothTransferReply *reply)
void transferProgress(qint64 bytesTransferred, qint64 bytesTotal)

受保护的函数

QBluetoothTransferReply(QObject *parent = Q_NULLPTR)
void setManager(QBluetoothTransferManager *manager)
void setRequest(const QBluetoothTransferRequest &request)
  • 9 个受保护的函数继承自 QObject

其他继承的成员

  • 1 个属性继承自 QObject
  • 1 个公有变量继承自 QObject
  • 10 个静态公有成员继承自 QObject
  • 2 个受保护的变量继承自 QObject

详细描述

The QBluetoothTransferReply class stores the response for a data transfer request.

In additional to a copy of the QBluetoothTransferRequest object used to create the request, QBluetoothTransferReply contains the contents of the reply itself.

After the file transfer has started, QBluetoothTransferReply emits the transferProgress() signal, which indicates the progress of the file transfer.

成员类型

enum QBluetoothTransferReply::TransferError

This enum describes the type of error that occurred

ConstantValueDescription
QBluetoothTransferReply::NoError0No error.
QBluetoothTransferReply::UnknownError1Unknown error, no better enum available.
QBluetoothTransferReply::FileNotFoundError2Unable to open the file specified.
QBluetoothTransferReply::HostNotFoundError3Unable to connect to the target host.
QBluetoothTransferReply::UserCanceledTransferError4User terminated the transfer.
QBluetoothTransferReply::IODeviceNotReadableError5File was not open before initiating the sending command.
QBluetoothTransferReply::ResourceBusyError6Unable to access the resource..
QBluetoothTransferReply::SessionError7An error occurred during the handling of the session. This enum was introduced by Qt 5.4.

成员函数

[protected] QBluetoothTransferReply::QBluetoothTransferReply(QObject *parent = Q_NULLPTR)

Constructs a new QBluetoothTransferReply with parent.

QBluetoothTransferReply::~QBluetoothTransferReply()

Destroys the QBluetoothTransferReply object.

[slot] void QBluetoothTransferReply::abort()

Aborts this reply.

[pure virtual] TransferError QBluetoothTransferReply::error() const

The error code of the error that occurred.

参见 errorString().

[signal] void QBluetoothTransferReply::error(QBluetoothTransferReply::TransferError errorType)

This signal is emitted whenever an error has occurred. The errorType parameter indicates the type of error.

To avoid the loss of signal emissions it is recommend to immidiately connect to this signal once a QBluetoothTransferReply instance has been created.

Note: Signal error is overloaded in this class. To connect to this one using the function pointer syntax, you must specify the signal type in a static cast, as shown in this example:


  connect(bluetoothTransferReply, static_cast<void(QBluetoothTransferReply::*)(QBluetoothTransferReply::TransferError)>(&QBluetoothTransferReply::error),
      [=](QBluetoothTransferReply::TransferError errorType){ /* ... */ });

This function was introduced in Qt 5.4.

参见 error() and errorString().

[pure virtual] QString QBluetoothTransferReply::errorString() const

String describing the error. Can be displayed to the user.

参见 error().

[signal] void QBluetoothTransferReply::finished(QBluetoothTransferReply *reply)

This signal is emitted when the transfer is complete for reply.

To avoid the loss of signal emissions it is recommend to immidiately connect to this signal once a QBluetoothTransferReply instance has been created.

[pure virtual] bool QBluetoothTransferReply::isFinished() const

Returns true if this reply has finished, otherwise false.

[pure virtual] bool QBluetoothTransferReply::isRunning() const

Returns true if this reply is running, otherwise false.

QBluetoothTransferManager *QBluetoothTransferReply::manager() const

Returns the QBluetoothTransferManager that was used to create this QBluetoothTransferReply object. Initially, it is also the parent object.

参见 setManager().

QBluetoothTransferRequest QBluetoothTransferReply::request() const

Returns the QBluetoothTransferRequest that was used to create this QBluetoothTransferReply object.

参见 setRequest().

[protected] void QBluetoothTransferReply::setManager(QBluetoothTransferManager *manager)

Set the reply's manager to the manager.

参见 manager().

[protected] void QBluetoothTransferReply::setRequest(const QBluetoothTransferRequest &request)

Set the reply's request to request.

参见 request().

[signal] void QBluetoothTransferReply::transferProgress(qint64 bytesTransferred, qint64 bytesTotal)

This signal is emitted whenever data is transferred. The bytesTransferred parameter contains the total number of bytes transferred so far out of bytesTotal.

To avoid the loss of signal emissions it is recommend to immidiately connect to this signal once a QBluetoothTransferReply instance has been created.