Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QBluetoothTransfer not sending File



  • QBluetoothTransferManager *transferManager = new QBluetoothTransferManager(this);
    QBluetoothAddress remoteAddress("00:11:22:33:44:55:66");
    QBluetoothTransferRequest request(remoteAddress);
    QFile *file = new QFile("testfile.txt");
    
    QBluetoothTransferReply *reply = transferManager->put(request, file);
    if (reply->error() == QBluetoothTransferReply::NoError) 
    {  
        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();
    }
    

    I tried this, but could not send the file.
    And moreover the reply->error() says this

    Exception thrown: read access violation.
    reply was nullptr.

    Please, help me out
    How to transfer a File from Desktop to a Printer?


  • Lifetime Qt Champion

    Hi,

    From the QBluetoothTransferManager::put documentation:

    If the platform does not support the Object Push profile, this function will return 0.
    

Log in to reply