From 6ac1fa11ecc929ed9be1ff5a353cf7d776c5835b Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Wed, 16 Dec 2009 17:56:35 +1000 Subject: Set section delegate "section" property before creation. --- src/declarative/graphicsitems/qmlgraphicslistview.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index 77761ac..28ce781 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -601,7 +601,6 @@ FxListItem *QmlGraphicsListViewPrivate::createItem(int modelIndex) QmlGraphicsItemPrivate *itemPrivate = static_cast(QGraphicsItemPrivate::get(item)); itemPrivate->addGeometryListener(this); if (sectionCriteria && sectionCriteria->delegate()) { - qDebug() << "have delegate"; if (listItem->attached->m_prevSection != listItem->attached->m_section) createSection(listItem); } @@ -884,8 +883,8 @@ void QmlGraphicsListViewPrivate::createSection(FxListItem *listItem) return; if (listItem->attached->m_prevSection != listItem->attached->m_section) { if (!listItem->section) { - qDebug() << "create Section"; QmlContext *context = new QmlContext(qmlContext(q)); + context->setContextProperty(QLatin1String("section"), listItem->attached->m_section); QObject *nobj = sectionCriteria->delegate()->create(context); if (nobj) { context->setParent(nobj); @@ -893,7 +892,6 @@ void QmlGraphicsListViewPrivate::createSection(FxListItem *listItem) if (!listItem->section) { delete nobj; } else { - context->setContextProperty(QLatin1String("section"), listItem->attached->m_section); listItem->section->setZValue(1); listItem->section->setParent(q->viewport()); } -- cgit v0.12