Changeset View
Changeset View
Standalone View
Standalone View
src/plasmaquick/containmentview.cpp
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 67 | { | |||
---|---|---|---|---|---|
70 | } | 70 | } | ||
71 | 71 | | |||
72 | Plasma::Types::Location oldLoc = location(); | 72 | Plasma::Types::Location oldLoc = location(); | ||
73 | Plasma::Types::FormFactor oldForm = formFactor(); | 73 | Plasma::Types::FormFactor oldForm = formFactor(); | ||
74 | 74 | | |||
75 | if (containment) { | 75 | if (containment) { | ||
76 | QObject::disconnect(containment, 0, q, 0); | 76 | QObject::disconnect(containment, 0, q, 0); | ||
77 | QObject *oldGraphicObject = containment->property("_plasma_graphicObject").value<QObject *>(); | 77 | QObject *oldGraphicObject = containment->property("_plasma_graphicObject").value<QObject *>(); | ||
78 | if (oldGraphicObject) { | 78 | if (auto item = qobject_cast<QQuickItem*>(oldGraphicObject)) { | ||
79 | // qDebug() << "Old graphics Object:" << oldGraphicObject << "Old containment" << containment.data(); | 79 | item->setVisible(false); | ||
80 | //make sure the graphic object won't die with us | | |||
81 | //FIXME:we need a way to reparent to *NO* graphics item, but this makes Qt crash | | |||
82 | oldGraphicObject->setParent(containment); | | |||
83 | } | 80 | } | ||
84 | containment->reactToScreenChange(); | 81 | containment->reactToScreenChange(); | ||
85 | } | 82 | } | ||
86 | 83 | | |||
87 | containment = cont; | 84 | containment = cont; | ||
88 | 85 | | |||
89 | if (oldLoc != location()) { | 86 | if (oldLoc != location()) { | ||
90 | emit q->locationChanged(location()); | 87 | emit q->locationChanged(location()); | ||
▲ Show 20 Lines • Show All 203 Lines • Show Last 20 Lines |