[Qt-interest] Delayed Initialization in custom widget plugin
Christopher Boger
cboger at rosenaviation.com
Wed Aug 5 16:35:27 CEST 2009
I have a custom widget plugin (for use in Designer) that works great,
except that it could use some performance optimization. My widget has a
lot of properties that affect the widget's appearance that can be
customized in designer. In designer, this is great, you want to see the
effect of your changes immediately. However, at runtime this isn't so
good as a lot of the drawing is redundant.
What I would like to do is have the widget redraw itself when these
properties change in designer, but at runtime only draw the widget after
all the properties have been set. I know how to detect whether I'm in
designer or not, but I do not know where the runtime draw-once code
should go? Right now, I put this draw-once code in the first
paintEvent(). This is okay, but this isn't optimal because it slows down
the first time one switches to a page with the custom widget. There must
be a method I could override or event to watch that essentially means
"do your last minute widget initialization because the app is about to
show itself."
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090805/b5d2c556/attachment.html
More information about the Qt-interest-old
mailing list