summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-06-30 06:53:08 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-06-30 06:53:08 (GMT)
commit8987c745c6744e383463ed95e1da99b97f786aef (patch)
treeab48e367220335756cab34452d40bdc456b2f0d5 /tests
parent3fb8eede9ee01592542fc1c86b2848db1ce426fb (diff)
downloadQt-8987c745c6744e383463ed95e1da99b97f786aef.zip
Qt-8987c745c6744e383463ed95e1da99b97f786aef.tar.gz
Qt-8987c745c6744e383463ed95e1da99b97f786aef.tar.bz2
Add ListView.nextSection attached property
and also renamed ListView.prevSection to ListView.previousSection Task-number: QTBUG-11372
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml15
-rw-r--r--tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp2
2 files changed, 12 insertions, 5 deletions
diff --git a/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml b/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml
index a6f3ab8..9a5ea55 100644
--- a/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml
+++ b/tests/auto/declarative/qdeclarativelistview/data/listview-sections.qml
@@ -10,10 +10,10 @@ Rectangle {
Item {
id: wrapper
objectName: "wrapper"
- height: ListView.prevSection != ListView.section ? 40 : 20;
+ height: ListView.previousSection != ListView.section ? 40 : 20;
width: 240
Rectangle {
- y: wrapper.ListView.prevSection != wrapper.ListView.section ? 20 : 0
+ y: wrapper.ListView.previousSection != wrapper.ListView.section ? 20 : 0
height: 20
width: parent.width
color: wrapper.ListView.isCurrentItem ? "lightsteelblue" : "white"
@@ -27,21 +27,26 @@ Rectangle {
text: name
}
Text {
- x: 120
+ x: 100
id: textNumber
objectName: "textNumber"
text: number
}
Text {
+ objectName: "nextSection"
+ x: 150
+ text: wrapper.ListView.nextSection
+ }
+ Text {
x: 200
text: wrapper.y
}
}
Rectangle {
color: "#99bb99"
- height: wrapper.ListView.prevSection != wrapper.ListView.section ? 20 : 0
+ height: wrapper.ListView.previousSection != wrapper.ListView.section ? 20 : 0
width: parent.width
- visible: wrapper.ListView.prevSection != wrapper.ListView.section ? true : false
+ visible: wrapper.ListView.previousSection != wrapper.ListView.section ? true : false
Text { text: wrapper.ListView.section }
}
}
diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
index 048f0f3..e13bd94 100644
--- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
+++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
@@ -902,6 +902,8 @@ void tst_QDeclarativeListView::sections()
QDeclarativeItem *item = findItem<QDeclarativeItem>(contentItem, "wrapper", i);
QTRY_VERIFY(item);
QTRY_COMPARE(item->y(), qreal(i*20 + ((i+4)/5) * 20));
+ QDeclarativeText *next = findItem<QDeclarativeText>(item, "nextSection");
+ QCOMPARE(next->text().toInt(), (i+1)/5);
}
// Remove section boundary