make sure to disconnect the _old_ target from the itembackground, not the new one with itself

svn path=/trunk/KDE/kdelibs/; revision=1025709
This commit is contained in:
Jacopo De Simoi 2009-09-19 13:30:58 +00:00
parent 1b05349652
commit 94b684c01c

View File

@ -127,14 +127,14 @@ void ItemBackground::setTargetItem(QGraphicsItem *target)
d->target->removeSceneEventFilter(this); d->target->removeSceneEventFilter(this);
QObject *obj = 0; QObject *obj = 0;
if (target && target->isWidget()) { if (d->target->isWidget()) {
obj = static_cast<QGraphicsWidget*>(target); obj = static_cast<QGraphicsWidget*>(d->target);
} else { } else {
obj = dynamic_cast<QObject *>(target); obj = dynamic_cast<QObject *>(d->target);
} }
if (obj) { if (obj) {
disconnect(obj, 0, obj, 0); disconnect(obj, 0, this, 0);
} }
} }