Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QBluetoothTransfer not sending File

    General and Desktop
    2
    2
    40
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      reddy9pp last edited by reddy9pp

      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?

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        From the QBluetoothTransferManager::put documentation:

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

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • First post
          Last post