summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qmlgraphicslistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qmlgraphicslistview.cpp')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicslistview.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp
index 5db3b26..51d88ed 100644
--- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp
@@ -80,7 +80,7 @@ void QmlGraphicsViewSection::setDelegate(QmlComponent *delegate)
QString QmlGraphicsViewSection::sectionString(const QString &value)
{
if (m_criteria == FirstCharacter)
- return value.at(0);
+ return value.isEmpty() ? QString() : value.at(0);
else
return value;
}
@@ -349,7 +349,7 @@ public:
QString section;
if (sectionCriteria) {
- QString propValue = model->value(modelIndex, sectionCriteria->property()).toString();
+ QString propValue = model->stringValue(modelIndex, sectionCriteria->property());
section = sectionCriteria->sectionString(propValue);
}
@@ -593,7 +593,7 @@ FxListItem *QmlGraphicsListViewPrivate::createItem(int modelIndex)
listItem->index = modelIndex;
// initialise attached properties
if (sectionCriteria) {
- QString propValue = model->value(modelIndex, sectionCriteria->property()).toString();
+ QString propValue = model->stringValue(modelIndex, sectionCriteria->property());
listItem->attached->m_section = sectionCriteria->sectionString(propValue);
if (modelIndex > 0) {
if (FxListItem *item = visibleItem(modelIndex-1))