What is the best way to run and update progress of external function in QT app?



  • I have the interface for my shared library implemented in QT. The library is programmed by me, so I can change whatever I want.

    I was wondering how can I start a process in my library and update a progress bar in my GUI. What would be the best way of doing this in QT? I would not like to use QT inside the shared library. What is the standard way to report progress to QT from a external library? Is it possible?



  • Hi

    for instance QWebPage can emit the loadProgress signal to report the loading status

    so basically the solutions would be:

    1. by a QTimer checking a shared status variable
    2. your lib should emit signals providing the progress as parameter by connecting it to your GUI slot handling the progress bar

    Cheers!



  • Thanks for the answer.

    I'm interested in method 1, because the 2nd would require to emit signals from my librery and i'm gessing that would need QT.

    By shared variable you are referring to a pointer?

    And would it be possible to have the task running on a separate thread so the app interface does not freeze?


Log in to reply
 

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