remove the event filter if we're a containment, don't return too early from the filter

This commit is contained in:
Aaron Seigo 2011-07-19 09:36:52 +02:00
parent d65132f92f
commit 3fc19683fa

View File

@ -1799,7 +1799,6 @@ bool Applet::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
break;
}
return false;
}
switch (event->type()) {
@ -2409,11 +2408,15 @@ QVariant Applet::itemChange(GraphicsItemChange change, const QVariant &value)
break;
case ItemParentHasChanged:
{
Containment *c = containment();
if (c && c->containmentType() == Containment::DesktopContainment) {
installSceneEventFilter(this);
} else {
if (isContainment()) {
removeSceneEventFilter(this);
} else {
Containment *c = containment();
if (c && c->containmentType() == Containment::DesktopContainment) {
installSceneEventFilter(this);
} else {
removeSceneEventFilter(this);
}
}
}
break;