[Qt-interest] How can I avoid the paintEvent after resizing awidget?
Ulf-Alexander v. Ceumern-Lindenstjerna
ceumern at vrmagic.com
Wed Sep 9 10:13:09 CEST 2009
Use an eventFilter to filter QResizeEvent and only redraw when the
widget changed in a fashion that requires a redraw.
See: http://doc.trolltech.com/4.5/qobject.html#installEventFilter
regards
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-
> bounces at trolltech.com] On Behalf Of liang jian
> Sent: Wednesday, September 09, 2009 3:49 AM
> To: qt-interest at trolltech.com
> Subject: [Qt-interest] How can I avoid the paintEvent after resizing
> awidget?
>
> Hi, everyone:
> I am writing a custom widget using Qt 4.5 and I am looking for
> some way to optimze its refresh.
> by default Qt will invalidate all the area occupied by the widget
> after it has been resized, but this is not what I want. And I know
> there is a attribute called Qt::WA_StaticContents to let the widget
> just receive paint events only for parts of itself that are newly
> visible, but this dosen't applicable to my widget. my widget must
> refresh all the area after a vertical resizing but only need to
> refresh the newly visible part after a horizontal resizing. So I can
> use this attribute, I have to handle this in sizeEvent manually. but
> How can I avoid the paintEvent triggered by Qt after resizing a
> widget?
>
> best regards
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list