Results 1 to 8 of 8

Thread: How to connect QTimer with QPaintEvent?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to connect QTimer with QPaintEvent?

    Some thoughts:
    • QWidget::update() is a slot your widget already has, not something you need to reimplement.
    • Calling update() inside the paintEvent() makes no sense.
    • Connecting the timer to a generic QWidget (that you are not painting) will not cause your widget to paint.


    Here is a complete example of a custom widget: Analogue Clock Example
    Last edited by ChrisW67; 2nd May 2012 at 07:28.

Similar Threads

  1. QMouseEvent on QPaintEvent
    By GUIman in forum Newbie
    Replies: 7
    Last Post: 1st March 2011, 08:51
  2. How to sendEvent QPaintEvent ?
    By SABROG in forum Qt Programming
    Replies: 23
    Last Post: 28th May 2009, 21:55
  3. Can we connect QTimer::SingleShot with a slot taking arguments?
    By maverick_pol in forum Qt Programming
    Replies: 4
    Last Post: 17th September 2008, 18:02
  4. QPaintEvent on button click?
    By vishal.chauhan in forum Qt Programming
    Replies: 1
    Last Post: 5th June 2007, 08:44
  5. Inheritance and QpaintEvent
    By djoul in forum Qt Programming
    Replies: 22
    Last Post: 5th July 2006, 13:56

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
  •  
Qt is a trademark of The Qt Company.