create the compactRepr in the right context

This commit is contained in:
Marco Martin 2012-09-04 11:57:43 +02:00
parent b8b474068e
commit 3d48a89111

View File

@ -150,7 +150,7 @@ void DeclarativeAppletScript::qmlCreationFinished()
if (pa) {
QDeclarativeComponent *iconComponent = m_declarativeWidget->rootObject()->property("compactRepresentation").value<QDeclarativeComponent *>();
if (iconComponent) {
QDeclarativeItem *declarativeIcon = qobject_cast<QDeclarativeItem *>(iconComponent->create(m_declarativeWidget->engine()->rootContext()));
QDeclarativeItem *declarativeIcon = qobject_cast<QDeclarativeItem *>(iconComponent->create(iconComponent->creationContext()));
if (declarativeIcon) {
pa->setPopupIcon(QIcon());
QGraphicsLinearLayout *lay = new QGraphicsLinearLayout(a);