Results 1 to 4 of 4

Thread: QT3 -- updating a GUI all at once, instead of widget by widget

  1. #1
    Join Date
    May 2010
    Posts
    24
    Thanks
    14
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default QT3 -- updating a GUI all at once, instead of widget by widget

    I've a complex GUI with multiple widgets, include over 300 LED widgets. Periodically, I receive update information (for all the widgets).

    How do I disable the updating of the GUI until I've done all my "setText" and "setLED" and "setWhatever" calls? Normally, each of these calls would trigger a GUI update -- thats a lot of unecessary updating that causes noticeable flicker.

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

    Default Re: QT3 -- updating a GUI all at once, instead of widget by widget

    If you do all those calls without returning to the event loop, all updates will be executed in one go. You can obtain such situation by using a timer and doing all the setText/setLED calls upon the timer's timeout.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    Ronayn (1st August 2011)

  4. #3
    Join Date
    May 2010
    Posts
    24
    Thanks
    14
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QT3 -- updating a GUI all at once, instead of widget by widget

    Hmmm... I think I need to review how QT3 widgets work then. I thought that when you called setText, from within (slot) function, for a widget (like QLabel, for example), it immediately updated the widget (including visually). However, if I understand you correctly, the visual update doesn't happen until the event loop is returned to?

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

    Default Re: QT3 -- updating a GUI all at once, instead of widget by widget

    Quote Originally Posted by Ronayn View Post
    I thought that when you called setText, from within (slot) function, for a widget (like QLabel, for example), it immediately updated the widget (including visually).
    No, it updates the data and schedules a paint event.
    However, if I understand you correctly, the visual update doesn't happen until the event loop is returned to?
    Correct. However all widgets will be painted separately. Just that it will happen during the same event processing iteration.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Listwidgetitem text is chpopped while updating widget
    By sudhansu in forum Qt Programming
    Replies: 1
    Last Post: 24th June 2010, 15:37
  2. Replies: 0
    Last Post: 10th June 2010, 23:38
  3. Tree widget not updating the data
    By phillip_Qt in forum Qt Programming
    Replies: 2
    Last Post: 17th November 2009, 07:00
  4. updating a widget's display
    By jhearon in forum Qt Programming
    Replies: 5
    Last Post: 10th November 2008, 16:59
  5. Replies: 11
    Last Post: 7th September 2006, 23:15

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
  •  
Qt is a trademark of The Qt Company.