[Panel-devel] Separate QGraphicsItems for applet border/background and content?

Alex Merry huntedhacker at tiscali.co.uk
Sat Sep 1 01:08:55 CEST 2007


On Friday 31 Aug 2007, Robert Knight wrote:
> > ah, i thought you were -also- unhappy with the fact that the
> > default implementation of contentSize() returns
> > layout()->sizeHint().
>
> Yes I am.  What I have locally is that contentSize() is non-virtual
> and returns geometry().size() minus the size of the border.  I added
> a new virtual contentSizeHint() method which applets re-implement to
> return an ideal size for their content.

Makes sense to me.  I was never entirely happy with contentSize() 
because it doesn't provide a way of forcing constraints on the applet 
easily.  At the time, I just wanted a way for the applet not to care 
about the border - they were all implementing boundingRect(), which 
meant they couldn't easily request or demand a certain size for the 
contents if Applet was drawing a background with a border.

If I'd thought about it, I'd have gone this route in the first place.

Alex

-- 
KDE: http://www.kde.org
Ubuntu/Kubuntu: http://www.ubuntu.org http://www.kubuntu.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20070901/f41a9f6e/attachment.pgp 


More information about the Panel-devel mailing list