diff --git a/extenders/extenderitem.cpp b/extenders/extenderitem.cpp index e7f129fa8..9ee4bd165 100644 --- a/extenders/extenderitem.cpp +++ b/extenders/extenderitem.cpp @@ -301,6 +301,7 @@ void ExtenderItem::setWidget(QGraphicsItem *widget) if (d->widget) { d->widget->removeSceneEventFilter(this); d->layout->removeItem(d->widget); + d->widget->deleteLater(); } if (!widget || !widget->isWidget()) { diff --git a/extenders/extenderitem.h b/extenders/extenderitem.h index 26ff25a4c..30d1c94e9 100644 --- a/extenders/extenderitem.h +++ b/extenders/extenderitem.h @@ -108,6 +108,7 @@ class PLASMA_EXPORT ExtenderItem : public QGraphicsWidget /** * @param widget The widget that should be wrapped into the extender item. + * It has to be a QGraphicsWidget. */ void setWidget(QGraphicsItem *widget);