I need to show the progress of a slow operation , but I doesn´t have a loop to set the values for a qprogressdialog.
I have only a call to a method compute(); but I don´t have get access to his internal code.
I need to show the progress of a slow operation , but I doesn´t have a loop to set the values for a qprogressdialog.
I have only a call to a method compute(); but I don´t have get access to his internal code.
I believe threading is your only option then:
http://doc.qt.nokia.com/4.6/threads.html
throw compute() into a seperate thread, and then do some animation until the thread returns.
but , the thread can pass or set the value of the q?progressdialog?
No, you set the volume of the progress dialog in your main gui loop using a timer.
Ok, but my problem is that the operation sometimes is fast (depending of his entries) and other times is very slow , so predefined a time is very difficult.
QProgressDialog supports marquee style which just moves the progess back and forth to show that something is happening but it is unknown how long it will take.
The thread will send you a signal when it is completed, so you can remove the progress bar. Therefore it doesn't matter if the task takes long time or short time.
Bookmarks