Results 1 to 7 of 7

Thread: Refresh my Qt window

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2011
    Posts
    51
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded

    Default Refresh my Qt window

    hello every one i am having a problem that i have a listview in my Qt creator program
    and values of list is changing after few seconds i have called a time event.it is working fine as i can see my changing values of list but the problem is that the changing values seems to be visible when i minimize and the maximize the window or when i resize it.
    is there any refresh type thing.
    how can i view the the change in my list with out doing this resize or min max thing
    hope you people getting what i want to say

    kindly help me

    thanks alot

  2. #2
    Join Date
    Apr 2011
    Posts
    61
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Refresh my Qt window

    You can call update or updateGeometry function or can also send a resizeEvent with no change I think.

  3. #3
    Join Date
    Mar 2011
    Posts
    51
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded

    Default Re: Refresh my Qt window

    ok sir thanks alot can you please give me a little more detail. i will be very thankful

  4. #4
    Join Date
    Apr 2011
    Posts
    61
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Refresh my Qt window

    When you resize a window it need to repaint the child windows. So, you can force the repainting after changing these values.

    To force repainting I think you can try this: (I've never needed to do this, but I think it will work)

    You can call this function (recommended):
    Qt Code:
    1. void QWidget::update() [slot]
    To copy to clipboard, switch view to plain text mode 
    And if it doesn't work you can try:
    Qt Code:
    1. void QWidget::repaint() [slot]
    To copy to clipboard, switch view to plain text mode 

    In the help you can find this notes:

    About update:
    This function does not cause an immediate repaint; instead it schedules a paint event for processing when Qt returns to the main event loop. This permits Qt to optimize for more speed and less flicker than a call to repaint() does.

    Warning about using repaint:
    We suggest only using repaint() if you need an immediate repaint, for example during animation. In almost all circumstances update() is better, as it permits Qt to optimize for speed and minimize flicker.


    I think calling the update will work.

Similar Threads

  1. Replies: 2
    Last Post: 17th February 2011, 12:30
  2. Replies: 2
    Last Post: 14th January 2011, 15:09
  3. window refresh freeze
    By jhowland in forum Qt Programming
    Replies: 1
    Last Post: 22nd February 2010, 07:58
  4. QPainter and refresh window
    By Atikae in forum Qt Programming
    Replies: 3
    Last Post: 18th February 2009, 12:45
  5. Want to refresh window without processEvents()
    By jnk5y in forum Qt Programming
    Replies: 6
    Last Post: 31st March 2006, 00:32

Tags for this Thread

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.