Results 1 to 2 of 2

Thread: painting a widget outside a paintEvent

  1. #1
    Join Date
    Feb 2006
    Posts
    26
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3
    Platforms
    MacOS X Windows

    Default painting a widget outside a paintEvent

    I'm hoping someone can help me with this QPainter problem.

    In Qt3 3.3 I created a widget that had a standard paintEvent, but also had an enterEvent and leaveEvent which changed the way the widget looks by painting on the widget within the event Handler.

    However, in Qt 4, I can't paint on the widget outside of the paintEvent, so how do I update my widget to make the paint changes if it's an enter or leave event instead of a paintEvent?

    Thanks for all the help.

    Jay

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: painting a widget outside a paintEvent

    You can ask Qt to repaint your widget by calling QWidget::update() or QWidget::repaint().

Similar Threads

  1. Controlling which widget on top layer?
    By JonathanForQT4 in forum Qt Programming
    Replies: 6
    Last Post: 22nd March 2007, 14:27
  2. Replies: 3
    Last Post: 27th November 2006, 09:56
  3. [Qt 4.1.0] Split a widget on demand
    By Townk in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 14:16
  4. Painting outside widget geometry?
    By mbjerkne in forum Qt Programming
    Replies: 2
    Last Post: 8th February 2006, 14:59
  5. QRubberBand painting in the scroll area widget
    By SkripT in forum Qt Programming
    Replies: 7
    Last Post: 17th January 2006, 16:48

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.