From 973f4a08a33f83885ef5bb540090a6682f148f65 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 22 Oct 2013 13:10:58 +0200 Subject: [PATCH] use setParentItem should crash less (or if it does produce more readable backtraces) --- src/plasmaquick/plasmaquickview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plasmaquick/plasmaquickview.cpp b/src/plasmaquick/plasmaquickview.cpp index 23cd6e741..7fb7782bf 100644 --- a/src/plasmaquick/plasmaquickview.cpp +++ b/src/plasmaquick/plasmaquickview.cpp @@ -98,7 +98,7 @@ void PlasmaQuickViewPrivate::setContainment(Plasma::Containment *cont) return; } - QObject *graphicObject = containment.data()->property("graphicObject").value(); + QQuickItem *graphicObject = qobject_cast(containment.data()->property("graphicObject").value()); if (graphicObject) { @@ -110,7 +110,7 @@ void PlasmaQuickViewPrivate::setContainment(Plasma::Containment *cont) graphicObject->setProperty("drawWallpaper", (cont->containmentType() == Plasma::Types::DesktopContainment || cont->containmentType() == Plasma::Types::CustomContainment)); - graphicObject->setProperty("parent", QVariant::fromValue(q->rootObject())); + graphicObject->setParentItem(q->rootObject()); q->rootObject()->setProperty("containment", QVariant::fromValue(graphicObject)); } else { qWarning() << "Containment graphic object not valid";