[Qt-interest] How can I avoid the paintEvent after resizing a widget?

liang jian jianliang79 at gmail.com
Wed Sep 9 03:49:21 CEST 2009


    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



More information about the Qt-interest-old mailing list