Results 1 to 5 of 5

Thread: repaint widget

  1. #1
    Join Date
    Dec 2009
    Location
    Shenzhen,China
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default repaint widget

    What happened when call repaint()? I think it will jump to paintEvent immediately, is it right? if not, how to force the widget repaint itself immediately?

    In my case, the application will not go to paintEvent immediately after repaint() or update() is called, so some fraction problem is happened.
    Is it a way to force the widget repaint immeiately but not to called later.

    Thanks!

  2. #2
    Join Date
    Feb 2010
    Posts
    19
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: repaint widget

    what kind of problems do you have

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: repaint widget

    How long does it take to get in paintEvent after you call update() or repaint() ??
    Usually the paintEvent will be called in next event loop iteration, but it shouldnt be slow..you must be performing some length actions I suppose..

  4. #4
    Join Date
    Dec 2009
    Location
    Shenzhen,China
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: repaint widget

    By the way, the program is run on the Max OS, not windows.
    As to repaint(), Is something difference with different OS?

  5. #5
    Join Date
    Dec 2009
    Location
    Shenzhen,China
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: repaint widget

    THis is my codes, the ForceRepaintAll will be called several times by signals sent by another widget when the mouseMove event happen.
    void CVxTlTrackWidget::ForceRepaintAll()
    {
    int oldTempDraw = m_isTempDraw;
    m_isTempDraw = false;
    repaint();
    m_isTempDraw = oldTempDraw;
    }

    in windows, it will go to paintEvent immediately after repaint() has run, and then go to next line: m_isTempDraw = oldTempDraw.
    But in MacOS, It's different, it just go to next line of repaint(), (m_isTempDraw = oldTempDraw), and then go to the paintEvent.

Similar Threads

  1. Replies: 4
    Last Post: 3rd March 2008, 22:15
  2. Repaint Widget in an other
    By hubert_p in forum Qt Programming
    Replies: 7
    Last Post: 6th November 2006, 12:12
  3. Repaint QTreeWidget
    By AceTheFace in forum Qt Programming
    Replies: 4
    Last Post: 9th August 2006, 23:34
  4. repaint help pls
    By munna in forum Qt Programming
    Replies: 3
    Last Post: 21st June 2006, 10:52
  5. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36

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.