Review Request: fix the rect passed to kcapacitybar paint method

Thomas Lübking thomas.luebking at web.de
Tue Jan 10 19:49:48 GMT 2012



> On Jan. 10, 2012, 6:08 p.m., Thomas Lübking wrote:
> > kdeui/widgets/kcapacitybar.cpp, line 374
> > <http://git.reviewboard.kde.org/r/103669/diff/2/?file=46380#file46380line374>
> >
> >     rather "..., contentsRect());"
> >     Otherwise looks fine (i guess setCllipRegion() is overhead)
> 
> Hugo Pereira Da Costa wrote:
>     Concerning setClipRegion() overhead, no clue.
>     
>     Concerning passing contentsRect() instead of rect(), well, QStyleOption::initFrom uses widget->rect() by default. Now, other widgets implementation might use contentsRect() when initializing their options.
>     Testing, both work (I guess cause the margin is zero :)).

Margins default to zero, so unless sbd. sets sth. different on the capacitybar there's no difference.
What is the correct one depends on "do i want to have the style painting the margin as well"

Since the entire stuff was added about Qt 4.6 or so (with advanced styleShitting [sic! ;-] support) it seems expectable that several widgets simply ignore it, esp. esp. for the default implementation of QStyleOption (could be to paint the widget background of a WA_StyledBackground window etc.)

My impression in this context was that the contentsRect is addressed. *shrug*


- Thomas


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/103669/#review9716
-----------------------------------------------------------


On Jan. 10, 2012, 5:06 p.m., Hugo Pereira Da Costa wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103669/
> -----------------------------------------------------------
> 
> (Updated Jan. 10, 2012, 5:06 p.m.)
> 
> 
> Review request for kdelibs.
> 
> 
> Description
> -------
> 
> fixes the rect passed to paint method so that it matches the widget rect and not the event (clip) rect, since the former is what's expected by widget styles.
> 
> 
> This addresses bug 290879.
>     http://bugs.kde.org/show_bug.cgi?id=290879
> 
> 
> Diffs
> -----
> 
>   kdeui/widgets/kcapacitybar.cpp 6e63c3f 
> 
> Diff: http://git.reviewboard.kde.org/r/103669/diff/diff
> 
> 
> Testing
> -------
> 
> Fixes bug above.
> No regression with other styles.
> 
> 
> Thanks,
> 
> Hugo Pereira Da Costa
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20120110/6165635a/attachment.htm>


More information about the kde-core-devel mailing list