diff --git a/src/plasmaquick/containmentview.cpp b/src/plasmaquick/containmentview.cpp index 91c81ddda..d5a36236f 100644 --- a/src/plasmaquick/containmentview.cpp +++ b/src/plasmaquick/containmentview.cpp @@ -75,11 +75,8 @@ void ContainmentViewPrivate::setContainment(Plasma::Containment *cont) if (containment) { QObject::disconnect(containment, 0, q, 0); QObject *oldGraphicObject = containment->property("_plasma_graphicObject").value(); - if (oldGraphicObject) { -// qDebug() << "Old graphics Object:" << oldGraphicObject << "Old containment" << containment.data(); - //make sure the graphic object won't die with us - //FIXME:we need a way to reparent to *NO* graphics item, but this makes Qt crash - oldGraphicObject->setParent(containment); + if (auto item = qobject_cast(oldGraphicObject)) { + item->setVisible(false); } containment->reactToScreenChange(); }