PDA

View Full Version : painting a widget outside a paintEvent



jayw710
25th June 2007, 22:54
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

jacek
25th June 2007, 23:18
You can ask Qt to repaint your widget by calling QWidget::update() or QWidget::repaint().