diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-10-07 13:06:26 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-07 05:55:18 +0200 |
commit | cdf868033bbd7bf5a996c67fa56f8ac15e755115 (patch) | |
tree | 2e39f31248a7845fe8105e538b0a9c2b8eb55f10 /src/declarative/items/qsglistview.cpp | |
parent | d517e9c541e5869e87006faeccd60be5690bee5b (diff) |
Fix ListView components being unable to access context properties.
Where avaialable use the components creation context instead of the
views context as the root context for the new item.
Task-number: QTBUG-21865
Change-Id: I07e564548de57d58413dc0d7cd151bd8a90886e7
Reviewed-on: http://codereview.qt-project.org/6199
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'src/declarative/items/qsglistview.cpp')
-rw-r--r-- | src/declarative/items/qsglistview.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/declarative/items/qsglistview.cpp b/src/declarative/items/qsglistview.cpp index 7f9ce3ac8b..beeeda45e9 100644 --- a/src/declarative/items/qsglistview.cpp +++ b/src/declarative/items/qsglistview.cpp @@ -832,7 +832,9 @@ QSGItem * QSGListViewPrivate::getSectionItem(const QString §ion) QDeclarativeContext *context = QDeclarativeEngine::contextForObject(sectionItem)->parentContext(); context->setContextProperty(QLatin1String("section"), section); } else { - QDeclarativeContext *context = new QDeclarativeContext(qmlContext(q)); + QDeclarativeContext *creationContext = sectionCriteria->delegate()->creationContext(); + QDeclarativeContext *context = new QDeclarativeContext( + creationContext ? creationContext : qmlContext(q)); context->setContextProperty(QLatin1String("section"), section); QObject *nobj = sectionCriteria->delegate()->beginCreate(context); if (nobj) { |