From: Bea Lam Date: Fri, 14 Oct 2011 00:20:08 +0000 (+1000) Subject: Fix creation context for delegates X-Git-Tag: qt-v5.0.0-alpha1~1387 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=279ecc31ea551387589362035a0e4365f8179358;p=profile%2Fivi%2Fqtdeclarative.git Fix creation context for delegates As per cdf868033bbd7bf5a996c67fa56f8ac15e755115 for ListView and GridView. Change-Id: I6928a1fd4df51265124925530e81704dbdc5af46 Reviewed-on: http://codereview.qt-project.org/6629 Reviewed-by: Michael Brasser --- diff --git a/src/declarative/items/qsgpathview.cpp b/src/declarative/items/qsgpathview.cpp index faa045a..590fa93 100644 --- a/src/declarative/items/qsgpathview.cpp +++ b/src/declarative/items/qsgpathview.cpp @@ -211,7 +211,9 @@ void QSGPathViewPrivate::createHighlight() QSGItem *item = 0; if (highlightComponent) { - QDeclarativeContext *highlightContext = new QDeclarativeContext(qmlContext(q)); + QDeclarativeContext *creationContext = highlightComponent->creationContext(); + QDeclarativeContext *highlightContext = new QDeclarativeContext( + creationContext ? creationContext : qmlContext(q)); QObject *nobj = highlightComponent->create(highlightContext); if (nobj) { QDeclarative_setParent_noEvent(highlightContext, nobj);