Do I need to tun QMQTT in different thread to keep responsive UI ?



  • I have several problems when I try to use qmqtt in another thread to keep my ui is responsive.

    DO I need to use it another thread or it is overhead is really small ? Is it asynchronous ?

    Main purpose is communicating between c++ and python messaging.

    Best


  • Qt Champions 2017

    @RahibeMeryem said in Do I need to tun QMQTT in different thread to keep responsive UI ?:

    DO I need to use it another thread or it is overhead is really small ? Is it asynchronous ?

    No, all Qt classes are asynchronous and work with signals&slots. If you do not use blocking functions like waitFor... or sleep, you can usually keep them in the main thread.

    Regards



  • Yes this what I finally decided to put qmqtt stuff in the main thread which is updating UI.

    So far working good.

    One of the thing that I want to ask is to re-connection.

    disconnection is detected by signal slot an I am asking to connect again from start but its crashing.

    so I create a timer say 5 sec, checking the connection state if its not = 2 that connecting again. This one is working.

    :)

    thanks


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.