[patch] cosmetic fix for KPlotWidget

Thomas Zander zander at kde.org
Sun Dec 2 10:36:12 GMT 2007


On Sunday 02 December 2007 06:30:43 Jason Harris wrote:
> Ok, I am fine with temporarily shutting off antialiasing when drawing
> the plot axes rather than offsetting by 0.5 pixels.  Patch is below.
> Ok to commit?

I tend to use save() restore() instead of hard coding the antialiassing.

So;
  p->save();
  p->setRenderHint( QPainter::Antialiasing, false );
  // do something that requires AA to be off
  p->restore();

I think thats cleaner then a bool.

At the same time, I expect the the caller of drawAxis() to be the one to 
do save()/restore() so the drawAxis can manipulate the painter as much as 
it wants without interfering with other people's code.
In KOffice I aim for this kind of contract-coding which makes things a lot 
easier.   So, always call save before you pass the painter to some method 
and call restore directly after.

Anyway, thats just what I prefer, take it as you want :)  I don't object 
to the patch, I don't know enough of this code to do.
-- 
Thomas Zander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071202/1c7ea851/attachment.sig>


More information about the kde-core-devel mailing list