Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Generic progress reporting system design
aureshinite last edited by
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:
- 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?