Try harder to find the containment

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=737050
This commit is contained in:
Andre Duffeck 2007-11-15 11:01:17 +00:00
parent 6aa793e6a8
commit 7a333aee4c

View File

@ -846,7 +846,14 @@ FormFactor Applet::formFactor() const
Containment* Applet::containment() const
{
return dynamic_cast<Containment*>(parentItem());
QGraphicsItem *parent = parentItem();
while (parent) {
if (dynamic_cast<Containment*>(parent)) {
break;
}
parent = parent->parentItem();
}
return dynamic_cast<Containment*>(parent);
}
Location Applet::location() const