Results 1 to 4 of 4

Thread: Finish of PaintEvent

  1. #1
    Join Date
    Dec 2007
    Posts
    15
    Qt products
    Qt4 Qt/Embedded

    Question Finish of PaintEvent

    Hi all I know this sounds weird, but is there anyway for the app to know the paint for a specific widget has completed and everything's displayed? Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Finish of PaintEvent

    Yes and no Directly no, indirectly yes. What do you need it for?

  3. #3
    Join Date
    Dec 2007
    Posts
    15
    Qt products
    Qt4 Qt/Embedded

    Default Re: Finish of PaintEvent

    Got into this performance measurement thing on windows CE, we need to know how long did it take for paintEvent to complete painting. Indirect answer please.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Finish of PaintEvent

    In that case subclass the widget class you want to benchmark and reimplement its paintEvent. In the reimplementation write something like this:
    Qt Code:
    1. void MyClass::paintEvent(QPaintEvent *e){
    2. QTime t;
    3. BaseClass::paintEvent(e);
    4. qDebug() << t.elapsed();
    5. }
    To copy to clipboard, switch view to plain text mode 

    An alternative is to reimplement event() or QApplication::notify() and do roughly the same there, but you'll get a bit different times.

Similar Threads

  1. paintEvent in eventFilter
    By kernel_panic in forum Qt Programming
    Replies: 1
    Last Post: 10th October 2007, 20:59
  2. painting a widget outside a paintEvent
    By jayw710 in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2007, 23:18
  3. Replies: 3
    Last Post: 27th November 2006, 09:56
  4. Replies: 2
    Last Post: 26th April 2006, 10:43
  5. New thread to handle paintEvent
    By bitChanger in forum Qt Programming
    Replies: 1
    Last Post: 9th March 2006, 21:41

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.