Use parenting.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=851464
This commit is contained in:
Alex Merry 2008-08-23 17:47:50 +00:00
parent 61c4bc59b5
commit 053ba4f683
2 changed files with 4 additions and 6 deletions

View File

@ -40,7 +40,7 @@ Extender::Extender(Applet *applet)
d(new ExtenderPrivate(applet, this)) d(new ExtenderPrivate(applet, this))
{ {
applet->d->extender = this; applet->d->extender = this;
d->layout = new QGraphicsLinearLayout(); d->layout = new QGraphicsLinearLayout(this);
d->layout->setOrientation(Qt::Vertical); d->layout->setOrientation(Qt::Vertical);
setLayout(d->layout); setLayout(d->layout);

View File

@ -64,8 +64,6 @@ class ExtenderItemPrivate
~ExtenderItemPrivate() ~ExtenderItemPrivate()
{ {
delete toplevel; delete toplevel;
delete appletBackground;
delete dragger;
} }
/** /**
@ -282,16 +280,16 @@ ExtenderItem::ExtenderItem(Extender *hostExtender, uint extenderItemId)
} }
//create the dragger and standard applet background. //create the dragger and standard applet background.
d->dragger = new PanelSvg(); d->dragger = new PanelSvg(this);
d->dragger->setImagePath("widgets/dragger"); d->dragger->setImagePath("widgets/dragger");
d->appletBackground = new PanelSvg(); d->appletBackground = new PanelSvg(this);
d->appletBackground->setImagePath("widgets/background"); d->appletBackground->setImagePath("widgets/background");
d->appletBackground->setEnabledBorders(0); d->appletBackground->setEnabledBorders(0);
//create the toolbox. //create the toolbox.
d->toolbox = new QGraphicsWidget(this); d->toolbox = new QGraphicsWidget(this);
d->toolboxLayout = new QGraphicsLinearLayout(); d->toolboxLayout = new QGraphicsLinearLayout(this);
d->toolbox->setLayout(d->toolboxLayout); d->toolbox->setLayout(d->toolboxLayout);
//allow the theme to set the size of the icon. //allow the theme to set the size of the icon.