summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativevisualdatamodel
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-07-19 05:30:06 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2010-07-19 10:21:15 (GMT)
commit7a748e9bb8ffc0e41eb38bebfa80cf9b6111169d (patch)
treee668f27df49131cde6e4616e57c0c88d60bf069d /tests/auto/declarative/qdeclarativevisualdatamodel
parentbb28f2217bae0a1e5f7645993a4a2540195eaeb6 (diff)
downloadQt-7a748e9bb8ffc0e41eb38bebfa80cf9b6111169d.zip
Qt-7a748e9bb8ffc0e41eb38bebfa80cf9b6111169d.tar.gz
Qt-7a748e9bb8ffc0e41eb38bebfa80cf9b6111169d.tar.bz2
Fix ListView sections with QList<QObject*>
QDeclarativeVisualDataModel::stringValue() did not handle QList<QObject*> model types. Task-number: QTBUG-12005 (cherry picked from commit b6251d31652232a6ac3a5dff54ad4229542089b1)
Diffstat (limited to 'tests/auto/declarative/qdeclarativevisualdatamodel')
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml3
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml b/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml
index f5198c9..d030222 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/data/objectlist.qml
@@ -11,6 +11,9 @@ ListView {
width: 100
color: model.modelData.color
Text { objectName: "name"; text: name }
+ Text { objectName: "section"; text: parent.ListView.section }
}
}
+ section.property: "name"
+ section.criteria: ViewSection.FullString
}
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
index 43d4d06..e0f32ea 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
@@ -179,6 +179,9 @@ void tst_qdeclarativevisualdatamodel::objectListModel()
QDeclarativeText *name = findItem<QDeclarativeText>(contentItem, "name", 0);
QCOMPARE(name->text(), QString("Item 1"));
+ QDeclarativeText *section = findItem<QDeclarativeText>(contentItem, "section", 0);
+ QCOMPARE(section->text(), QString("Item 1"));
+
dataList[0]->setProperty("name", QLatin1String("Changed"));
QCOMPARE(name->text(), QString("Changed"));
}