Results 1 to 4 of 4

Thread: how to call paintevent() only when repaint() is callled?

  1. #1
    Join Date
    Jul 2010
    Posts
    50
    Thanks
    7
    Platforms
    Windows

    Default how to call paintevent() only when repaint() is callled?

    I have overloaded the paintEvent() function and I am calling it through repaint() when required. But, paintEvent() is also getting called when we refresh/update the window(by minimizing, maximizing the window,etc......) .How to avoid this?

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to call paintevent() only when repaint() is callled?

    widget->setupdatesEnabled()

  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: how to call paintevent() only when repaint() is callled?

    Quote Originally Posted by qt_user View Post
    I have overloaded the paintEvent() function and I am calling it through repaint() when required. But, paintEvent() is also getting called when we refresh/update the window(by minimizing, maximizing the window,etc......) .How to avoid this?
    Why do you want to avoid it?
    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.


  4. #4
    Join Date
    Nov 2010
    Posts
    13
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: how to call paintevent() only when repaint() is callled?

    how about update()

Similar Threads

  1. Stop repaint while scrolling in paintEvent()
    By sagirahmed in forum Qt Programming
    Replies: 4
    Last Post: 26th October 2010, 07:21
  2. Replies: 4
    Last Post: 17th October 2010, 23:30
  3. Replies: 4
    Last Post: 10th June 2010, 22:25
  4. QScrollView and repaint
    By munna in forum Qt Programming
    Replies: 16
    Last Post: 13th September 2006, 11:20
  5. repaint help pls
    By munna in forum Qt Programming
    Replies: 3
    Last Post: 21st June 2006, 11:52

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.