Generic progress reporting system design



  • I am currently writing several GUI applications which have lengthy operations (like installation, import of data, remote execution, etc...) and I want to report the progress for each operation (let's say using a QProgressDialog). The progress information consists of:

    • started
    • stopped
    • progress value
    • progress text

    Basically, what you can obtain asynchronously via a "QFutureWatcher":http://doc.qt.digia.com/qt/qfuturewatcher.html
    I was thinking about QtConcurrent::run first but It seems its future cannot report progress.

    So my idea is to subclass QObject instead and create a class which have the desired signals and functions. This class will be the superclass of my program components, and my components will be running in their own thread.This way, I have a uniform way of reporting progress to the user interface. Is it a good design ? Is there a way to achieve this without replicating QFuture interface?


Log in to reply
 

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