From 279ecc31ea551387589362035a0e4365f8179358 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Fri, 14 Oct 2011 10:20:08 +1000 Subject: [PATCH] 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 --- src/declarative/items/qsgpathview.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) 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); -- 1.7.2.5