How to adjust applet size according to its child QGraphicsWidget?

Marco Martin notmart at gmail.com
Tue Dec 30 16:23:10 CET 2008


On Tuesday 30 December 2008, Dong Tiger wrote:
> Hi,
>
> A QGraphicsWidget is embeded into Plasma::Applet through
> QGraphicsLinearLayout. When this QGraphicsWidget's size changes, how to get
> the applet's size adjusted accordingly?
>
> The code snippet looks like:
>
>   child = new MyGraphicsWidget(applet);
>   layout = new QGraphicsLinearLayout(applet);
>   layout->setSpacing(0);
>   layout->addItem(child);
>   applet->setLayout(layout);
does calling applet->updateGeometry() work?

Cheers,
Marco Martin
>
> Regards,
> --
> Tiger




More information about the Plasma-devel mailing list