QGraphicsLayout Questions

Gerhard Gappmeier gerhard.gappmeier at ascolab.com
Thu Sep 4 18:37:42 CEST 2008


Hi all

I'm asking these question here because on #plasma it was difficult to explain
the problems.

I'm implementing playground/base/plasma/applets/stockwidget at the moment and 
have some problems.

I've a class SvgLayoutItem which inherits QGraphicsItem and 
QGraphicsLayoutItem. It uses Plasma::Svg to paint theme aware, but it is a 
layoutitem, because I want to layout this items with a QGraphicsGridLayout.

1.) When implementing QGraphicsLayoutItem::setGeometry
do I have to call prepareGeometryChange() or is this done implicitly?
Normally you have to when changing the boundingRect of a QGraphicsItem.

2.) The Items have all a minimumsize and the layout takes this into account.
Why is the Applet itself not resized to that minimum size.
Yes, I'm setting the layout in the applet, and resizing the applet,
changes the layout, but the layout itself seems to have no effect to the 
applet.

3.) When resizing the applet to the maximum the layout
calculates the item widths wrong.
Why does this happen and how can I solve that?

4.) Is it possible to use the paint event during resizing?
Just scaling a cached pixmap doesn't look very good,
because the text and other fixed size things get scaled too.

I attached some screenshots so that you can see what I mean.

thanks,
Gerhard.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20080904/9924cc5a/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wrongwhenbig.png
Type: image/png
Size: 24462 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20080904/9924cc5a/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tosmall.png
Type: image/png
Size: 18320 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20080904/9924cc5a/attachment-0004.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ok.png
Type: image/png
Size: 24345 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20080904/9924cc5a/attachment-0005.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20080904/9924cc5a/attachment-0001.sig 


More information about the Plasma-devel mailing list