Results 1 to 2 of 2

Thread: Repaint throttle anyone?

  1. #1
    Join Date
    Jun 2007
    Posts
    56
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default Repaint throttle anyone?

    Micawber here again with another problem :-(

    I have an application that takes data very quickly. I want to display some of that data on 4 custom QWidgets. At any time, two of the QWidgets may be hidden and in that case the other two will grow to use the space from the hidden widgets.

    I have another QThread that detects when a sample is ready and signals the main GUI loop that another sample is ready. This is really like drinking from a fire hose! I know that I don't want to display every sample, but I do want to display at the rate that the graphics environment can sustain and still be responsive to user inputs.

    Right now I have code that calls repaint() on each of the widgets and it works, but it causes the system to be sluggish to user inputs. I would like to use update() but when I do that, I never see any updates to the screen because (I'm speculating) its off getting another sample and scheduling another update() before the engine has a chance to schedule and execute a paintEvent.

    What I think I need is a way to sample the data stream, process it using update() and wait to get some sort of feedback that the area has been painted before going back to the fire hose for another sample. Is there a Qt API way to get notification that a paintEvent has been processed? I know that I can add a signal inside of the paintEvent, but I was wondering if there was another way.

    Thanks,

    -Mic

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: Repaint throttle anyone?

    How do you exactly invoke update()?

    Do you have to redraw everything with each repaint()? Maybe you can draw on a QPixmap and reuse it between repaints?

    Also remember that you don't have to repaint faster than monitor's refresh rate. Even 25 Hz should be enough.

Similar Threads

  1. repaint a cell or row in QTableWidget
    By alphaqt in forum Newbie
    Replies: 6
    Last Post: 26th June 2012, 11:21
  2. QPushButton not calling repaint when needed?
    By Enygma in forum Qt Programming
    Replies: 5
    Last Post: 13th May 2010, 17:03
  3. Replies: 3
    Last Post: 14th September 2007, 12:35
  4. repaint help pls
    By munna in forum Qt Programming
    Replies: 3
    Last Post: 21st June 2006, 10:52
  5. force repaint
    By georgie in forum Qt Programming
    Replies: 3
    Last Post: 22nd May 2006, 13:16

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.