Obtaining a QGraphicsScene from a Plasma applet?

Aaron J. Seigo aseigo at kde.org
Thu Jul 3 08:30:11 CEST 2008


On Wednesday 02 July 2008, Kelly Miller wrote:
> I've been surfing through the documentation, but I can't seem to find a way
> of obtaining a QGraphicsScene for a Plasma applet.  I'm trying to make sure
> things are added to the QGraphicsLayout in the proper order, BTW, so I want
> to call addItem/addWidget to insert objects in the scene.  Is there a
> method of getting the QGraphicsScene? 

if you make the widgets children of your Applet, or another QGraphicsWidget, 
you don't need to add them to the scene directly. you should never need to add 
items in your Applet to the scene directly.

what you want to do is something like:

 // where "this" is the applet
QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(this);
QGraphicsWidget *widget = new QGraphicsWidget(this);
layout->addItem(widget);

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080703/7f81b10d/attachment.pgp 


More information about the Panel-devel mailing list