QBluetoothTransferManager Class
The QBluetoothTransferManager class transfers data to another device using Object Push Profile (OPP). More...
| Header: | #include <QBluetoothTransferManager> |
| qmake: | QT += bluetooth |
| Since: | Qt 5.2 |
| Inherits: | QObject |
This class was introduced in Qt 5.2.
Public Functions
| QBluetoothTransferManager(QObject *parent = nullptr) | |
| virtual | ~QBluetoothTransferManager() |
- 16 public functions inherited from QObject
Related Non-Members
| typedef | QObjectList |
Macros
| QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
| Q_CLASSINFO(Name, Value) | |
| Q_DISABLE_COPY(Class) | |
| Q_DISABLE_COPY_MOVE(Class) | |
| Q_DISABLE_MOVE(Class) | |
| Q_EMIT | |
| Q_ENUM(...) | |
| Q_ENUM_NS(...) | |
| Q_FLAG(...) | |
| Q_FLAG_NS(...) | |
| Q_GADGET | |
| Q_INTERFACES(...) | |
| Q_INVOKABLE | |
| Q_NAMESPACE | |
| Q_OBJECT | |
| Q_PROPERTY(...) | |
| Q_REVISION | |
| Q_SET_OBJECT_NAME(Object) | |
| Q_SIGNAL | |
| Q_SIGNALS | |
| Q_SLOT | |
| Q_SLOTS |
Additional Inherited Members
- 1 property inherited from QObject
- 1 public slot inherited from QObject
- 1 signal inherited from QObject
- 5 static public members inherited from QObject
- 8 protected functions inherited from QObject
Detailed Description
QBluetoothTransferManager uses OBEX to send put commands to remote devices. A typical OBEX transfer is initialized as follows:
// Create a transfer manager QBluetoothTransferManager *transferManager = new QBluetoothTransferManager(this); // Create the transfer request and file to be sent QBluetoothAddress remoteAddress("00:11:22:33:44:55:66"); QBluetoothTransferRequest request(remoteAddress); QFile *file = new QFile("testfile.txt"); // Ask the transfer manager to send it QBluetoothTransferReply *reply = transferManager->put(request, file); if (reply->error() == QBluetoothTransferReply::NoError) { // Connect to the reply's signals to be informed about the status and do cleanups when done QObject::connect(reply, SIGNAL(finished(QBluetoothTransferReply*)), this, SLOT(transferFinished(QBluetoothTransferReply*))); QObject::connect(reply, SIGNAL(error(QBluetoothTransferReply::TransferError)), this, SLOT(error(QBluetoothTransferReply::TransferError))); } else { qWarning() << "Cannot push testfile.txt:" << reply->errorString(); }
Note that this API is not currently supported on Android.
Member Function Documentation
QBluetoothTransferManager::QBluetoothTransferManager(QObject *parent = nullptr)
Constructs a new QBluetoothTransferManager with parent.
[virtual] QBluetoothTransferManager::~QBluetoothTransferManager()
Destroys the QBluetoothTransferManager.