Results 1 to 4 of 4

Thread: Lacking interactivity

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2006
    Posts
    2

    Default Lacking interactivity

    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

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Lacking interactivity

    try QProgressDialog

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Lacking interactivity

    Quote Originally Posted by Cheps
    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
    You should take a closer look at QCoreApplication::processEvents().

  4. #4
    Join Date
    Jun 2006
    Posts
    2

    Default Re: Lacking interactivity

    That's exactly what I needed, thanks!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.