Results 1 to 5 of 5

Thread: Qpainter Help

  1. #1
    Join Date
    Jul 2011
    Posts
    81
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Qpainter Help

    when i write a qpainter event. This event is continously called automatically till the application is closed. if i set some flags painting shows problem.how can i call qpainter on custom click only

  2. #2
    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: Qpainter Help

    You can't. You have no influence on when the event is called. Your loop and crash comes from the fact that you incorrectly modify the state of the widget while in paint event which causes the event to be called again and again until you run out of memory and your app crashes.
    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.


  3. #3
    Join Date
    Jul 2011
    Posts
    81
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Re: Qpainter Help

    thanks wysota

  4. #4
    Join Date
    Jul 2011
    Posts
    81
    Thanks
    8
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Re: Qpainter Help

    how can i clear all painting i have done with the painter.?

  5. #5
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    164
    Thanks
    1
    Thanked 26 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Qpainter Help

    I have just answered to that question in a separate thread you have created. But when I think about PaintEvent, then just simply don't draw anything in it and it will be cleared usually.
    Don't write a post just to thank someone, use "Thanks" button.

  6. The following user says thank you to Rachol for this useful post:

    athulms (23rd August 2011)

Similar Threads

  1. QPainter(&QPrinter) & QPainter(&QImage) communication
    By gufeatza in forum Qt Programming
    Replies: 2
    Last Post: 2nd February 2010, 07:25
  2. Replies: 5
    Last Post: 7th September 2009, 20:57
  3. QPainter::save and QPAinter::restore()
    By quickNitin in forum Newbie
    Replies: 2
    Last Post: 17th June 2006, 22:11
  4. How use QPainter
    By avis_phoenix in forum Newbie
    Replies: 3
    Last Post: 2nd June 2006, 15:02
  5. Replies: 3
    Last Post: 30th April 2006, 19:22

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.