summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-07-19 05:30:06 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-07-19 05:30:06 (GMT)
commitb6251d31652232a6ac3a5dff54ad4229542089b1 (patch)
tree81c39b61313383fce9f6498dfe94b253c9e9a44a /tests
parent099f684de47b936268e7c052c9ac3f97ca7ad209 (diff)
downloadQt-b6251d31652232a6ac3a5dff54ad4229542089b1.zip
Qt-b6251d31652232a6ac3a5dff54ad4229542089b1.tar.gz
Qt-b6251d31652232a6ac3a5dff54ad4229542089b1.tar.bz2
Fix ListView sections with QList<QObject*>
QDeclarativeVisualDataModel::stringValue() did not handle QList<QObject*> model types. Task-number: QTBUG-12005
Diffstat (limited to 'tests')
-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"));
}