Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QBluetoothTransfer not sending File

QBluetoothTransfer not sending File

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 138 Views
  • 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 Offline
    R Offline
    reddy9pp
    wrote on last edited by reddy9pp
    #1
    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved