How to force calling of QWidget::paintEvent() when its hovered by other window?

Posted by Pie_Jesu on Stack Overflow See other posts from Stack Overflow or by Pie_Jesu
Published on 2011-01-16T01:19:20Z Indexed on 2011/01/16 7:53 UTC
Read the original article Hit count: 140

Filed under:
|
|
|
|

Hi there. I have occured a problem: I'm writing a widget, which displays current date's day number. It's like a button, but it's not derived from QPushButton class. Just from QWidget. So I reimplemented enterEvent(), leaveEvent(), mousePressEvent(), mouseReleaseEvent(). I call update() inside these methods and widget has realistic button behavior (paintEvent() is reimplemented too). But when I change system date and hover that widget with other window, my widget doesn't calls paintEvent() and displays old date. Only when I place mouse over it, widget repaints it's contents. I guess there is an option, which paints old contents on hover event to avoid unnecessary paint events. But I need to disable it. Tried to set many attributes (Qt::WidgetAttribute enum). But it doesn't helps.

Please, help me (and sorry for my bad english).

© Stack Overflow or respective owner

Related posts about qt

Related posts about update