diff --git a/applet.cpp b/applet.cpp index 0ed3b3931..016174ca3 100644 --- a/applet.cpp +++ b/applet.cpp @@ -846,7 +846,14 @@ FormFactor Applet::formFactor() const Containment* Applet::containment() const { - return dynamic_cast(parentItem()); + QGraphicsItem *parent = parentItem(); + while (parent) { + if (dynamic_cast(parent)) { + break; + } + parent = parent->parentItem(); + } + return dynamic_cast(parent); } Location Applet::location() const