Adrian on Painters and Qt4

Thomas Zander zander at kde.org
Tue Sep 19 11:47:28 CEST 2006


On Tuesday 19 September 2006 10:59, Boudewijn Rempt wrote:
> > Yap, thats right. Things are quite simplified in Qt4. Simplified for the
> > programmer, that is :)
> > If you take care to have sufficient checking for clipping so you don't
> > draw things the paint system doesn't want you to draw then its also quite
> > a bit faster.
>
> That's pretty simple for Krita: we only paint the bits of the image that
> have changed that are visible.

Cool. To clarify;
Painting is now done in two steps.
The first is detecting what should be redrawn (the changed parts) and request 
that to be redrawn in one or more update() calls on the canvas widget.

The second step if that you get a paintEvent with an even object that has a 
clipRegion.
You should use that clipregion to only draw the parts that are included in the 
clipregion as everything outside will just be ignored and costs you time with 
no effect.

The reason for this two step idea is to allow you any number of update() calls 
which are then grouped into one paintEvent. This minimizes the amount of 
paint calls and generally speeds things up.
-- 
Thomas Zander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20060919/f2dd0c9d/attachment.pgp 


More information about the kimageshop mailing list