be more careful with setWidget

svn path=/trunk/KDE/kdelibs/; revision=1002129
This commit is contained in:
Aaron J. Seigo 2009-07-25 04:53:35 +00:00
parent 284bac4310
commit 0caae66c3a

View File

@ -179,6 +179,15 @@ QString ExtenderItem::name() const
void ExtenderItem::setWidget(QGraphicsItem *widget)
{
if (d->widget) {
d->widget->removeSceneEventFilter(this);
}
if (!widget) {
d->widget = 0;
return;
}
widget->setParentItem(this);
widget->installSceneEventFilter(this);