Results 1 to 4 of 4

Thread: PaintEvents() don't erase content before call

  1. #1
    Join Date
    Jul 2010
    Posts
    33
    Qt products
    Qt4
    Platforms
    MacOS X

    Default PaintEvents() don't erase content before call

    Hi,

    I want to create an application and want to draw some object on widget without repainting whole screen. I want call a function just like paintEvent() to draw some object on screen. Every time paintEvent is call and erase the screen(I don't want to erase the screen). I want to retain the screen as I draw at first and want to make update on screen.

    Thanks & Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: PaintEvents() don't erase content before call

    What is your question please?

  3. #3
    Join Date
    Jul 2010
    Posts
    33
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: PaintEvents() don't erase content before call

    Hi,

    Every time widget paintEvent is called, Before calling paintevent it erase the content on screen automatically. I want to remove this hassle to draw object again and again. Only some portion of window will be repaint not whole window will be repaint.

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: PaintEvents() don't erase content before call

    Use the PaintEvent::region() to get a region you need to update.
    You can set that region when calling repaint() for example.

Similar Threads

  1. Replies: 4
    Last Post: 16th January 2010, 10:08
  2. How to erase everything widget has painted?
    By TheNewGuy in forum Newbie
    Replies: 1
    Last Post: 12th December 2009, 07:23
  3. Erase menubar
    By lixo1 in forum Qt Programming
    Replies: 2
    Last Post: 29th January 2009, 16:04
  4. update(), aber not erase the the widget's area?
    By blm in forum Qt Programming
    Replies: 1
    Last Post: 26th September 2008, 15:26
  5. problem with paint and erase in frame
    By M.A.M in forum Qt Programming
    Replies: 9
    Last Post: 4th May 2008, 20:17

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.