Skip to content
  • 0 Votes
    2 Posts
    389 Views
    JonBJ

    @TokaraForest
    I don't see that it will make any difference whether you stick with asynchronous approach (which does not block) in UI thread or use synchronous approach with waitFor...() in a thread (which will block that thread but not the Ui thread). Either way scanning 100 ports will take some time because each port has to have time to timeout. It will be "slow". You might as well use asynchronous and not get involved with threads if this is what you have to do.

    But why do you want to scan ports, and at which side? Client should be able to be set to use any available port to connect to server (this is fast). And server needs to specify which port it will be listening on, there is no point it finding a free one as client will not know which one it picked to connect on.

  • 0 Votes
    9 Posts
    1k Views
    O

    i had same error in my project.
    this page helped me -> https://forum.qt.io/topic/117241/why-qlowenergyservice-unknownerror/2

    i have changed my code from

    connect(controller, &QLowEnergyController::discoveryFinished, this, &Device::serviceScanDone);

    to

    connect(controller, &QLowEnergyController::discoveryFinished, this, &Device::serviceScanDone,Qt::QueuedConnection);

    and problem disappeared.

  • 0 Votes
    2 Posts
    3k Views
    raven-worxR

    @M4RZB4Ni
    this actually has nothing todo with Qt.
    You need to check how to use the Twain API.
    Then after building it integrate it into your project like any other 3rd party lib.,

    Edit:
    I just noticed that the TWAIN example app already builds upon Qt. Qt 4 though, but definitely something to start with.