be more careful with setWidget

svn path=/branches/KDE/4.3/kdelibs/; revision=1002130
This commit is contained in:
Aaron J. Seigo 2009-07-25 04:55:16 +00:00
parent b358a20f7e
commit e02f8c071d

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);