PDA

View Full Version : Lacking interactivity



Cheps
6th June 2006, 11:53
Hello,

I'm new to this forum and to Qt, enjoying it so far.

I have interactivity problems with my applications. Basically, I have a "start button" that starts huge calculations (I'm doing geological simulations), and I want to show the progress with a progress bar and offer the possibility to pause/stop anytime.

So far, my calculations pause regularly to manualy set the value of the QProgressBar and then call repaint() on the main window (I know it's not very good, but otherwise the display never refresh until the simulation ends).

My big problem is with the "stop" button. I can't click while running calculations (I get the sand glass and my application seems to freeze, although it never crash and ends up normally). Is there a way to "wait" and check for inputs? Then I could do like I do to refresh the progress bar.

Any help is welcome :cool:

munna
6th June 2006, 11:56
try QProgressDialog

wysota
6th June 2006, 12:32
Hello,

I'm new to this forum and to Qt, enjoying it so far.

I have interactivity problems with my applications. Basically, I have a "start button" that starts huge calculations (I'm doing geological simulations), and I want to show the progress with a progress bar and offer the possibility to pause/stop anytime.

So far, my calculations pause regularly to manualy set the value of the QProgressBar and then call repaint() on the main window (I know it's not very good, but otherwise the display never refresh until the simulation ends).

My big problem is with the "stop" button. I can't click while running calculations (I get the sand glass and my application seems to freeze, although it never crash and ends up normally). Is there a way to "wait" and check for inputs? Then I could do like I do to refresh the progress bar.

Any help is welcome :cool:

You should take a closer look at QCoreApplication::processEvents().

Cheps
6th June 2006, 12:57
That's exactly what I needed, thanks!