PDA

View Full Version : Concurrent progress reporting



chezifresh
23rd June 2008, 19:43
I was wondering if anyone wanted to share some good progress reporting practices.

Ideally I want a progress dialog that 'always' updates and can be canceled at any time during processing. The Qt implementation of the progress dialog kind of sucks. You can report progress, which triggers a repaint/update and you can poll the dialog to see if the cancel button has been pressed. Thats some lame old school CS thinking, that creates some pretty horrible user experiences with applications. There's nothing like an unresponsive application you can't cancel out of or tell if its still working to make you want to scream.

It would be nice if we had a really solid/simple class that fires off a thread to do some work and pops up the progress dialog in case the user wants to cancel the job. That would be an awesome class to have built into Qt.

Does anyone have an example of good progress reporting code? ie. fire off a worker thread to do the number crunching while keeping the progress dialog in the main thread so the user can cancel it at any time.

Thats the jist of it of course but its such a common problem in applications that it would be nice to have someone post a good implementation.

jpn
30th June 2008, 08:47
QtConcurrent Progress Dialog Example (http://doc.trolltech.com/4.4/qtconcurrent-progressdialog.html)