summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-02-26 02:01:05 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-02-26 02:01:05 (GMT)
commit5fb329228bd1cd1126428b045a41a4a9c1033dc5 (patch)
treef93828abe89818729d717d3e9cdae94929f6fb13 /tests
parent3218d437a13ac82f65abcea0db099f54504c8875 (diff)
downloadQt-5fb329228bd1cd1126428b045a41a4a9c1033dc5.zip
Qt-5fb329228bd1cd1126428b045a41a4a9c1033dc5.tar.gz
Qt-5fb329228bd1cd1126428b045a41a4a9c1033dc5.tar.bz2
Renamed Flickable viewportXXX properties contentXXX
A viewport is the thing you look through, not what you look at.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp13
-rw-r--r--tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp30
-rw-r--r--tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp34
-rw-r--r--tests/auto/declarative/visual/qdeclarativeflickable/flickable-horizontal.qml2
-rw-r--r--tests/auto/declarative/visual/qdeclarativeflickable/flickable-vertical.qml2
8 files changed, 43 insertions, 44 deletions
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml b/tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml
index 3e08359..4b82d5c 100644
--- a/tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml
+++ b/tests/auto/declarative/qdeclarativeflickable/data/flickable02.qml
@@ -2,7 +2,7 @@ import Qt 4.6
Flickable {
width: 100; height: 100
- viewportWidth: row.width; viewportHeight: row.height
+ contentWidth: row.width; contentHeight: row.height
Row {
id: row
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml b/tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml
index 3ed173d..49eed5a 100644
--- a/tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml
+++ b/tests/auto/declarative/qdeclarativeflickable/data/flickable03.qml
@@ -2,7 +2,7 @@ import Qt 4.6
Flickable {
width: 100; height: 100
- viewportWidth: column.width; viewportHeight: column.height
+ contentWidth: column.width; contentHeight: column.height
Column {
id: column
diff --git a/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml b/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml
index 1425d85..40c4606 100644
--- a/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml
+++ b/tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml
@@ -2,7 +2,7 @@ import Qt 4.6
Flickable {
width: 100; height: 100
- viewportWidth: column.width; viewportHeight: column.height
+ contentWidth: column.width; contentHeight: column.height
pressDelay: 200; overShoot: false; interactive: false
maximumFlickVelocity: 2000
diff --git a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
index 1c98c50..cb87977 100644
--- a/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
+++ b/tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp
@@ -81,12 +81,11 @@ void tst_qdeclarativeflickable::create()
QCOMPARE(obj->isAtXEnd(), false);
QCOMPARE(obj->isAtYBeginning(), true);
QCOMPARE(obj->isAtYEnd(), false);
- QCOMPARE(obj->viewportX(), 0.);
- QCOMPARE(obj->viewportY(), 0.);
+ QCOMPARE(obj->contentX(), 0.);
+ QCOMPARE(obj->contentY(), 0.);
QCOMPARE(obj->horizontalVelocity(), 0.);
QCOMPARE(obj->verticalVelocity(), 0.);
- QCOMPARE(obj->reportedVelocitySmoothing(), 100.);
QCOMPARE(obj->isInteractive(), true);
QCOMPARE(obj->overShoot(), true);
@@ -103,8 +102,8 @@ void tst_qdeclarativeflickable::horizontalViewportSize()
QDeclarativeFlickable *obj = qobject_cast<QDeclarativeFlickable*>(c.create());
QVERIFY(obj != 0);
- QCOMPARE(obj->viewportWidth(), 800.);
- QCOMPARE(obj->viewportHeight(), 300.);
+ QCOMPARE(obj->contentWidth(), 800.);
+ QCOMPARE(obj->contentHeight(), 300.);
QCOMPARE(obj->isAtXBeginning(), true);
QCOMPARE(obj->isAtXEnd(), false);
QCOMPARE(obj->isAtYBeginning(), true);
@@ -120,8 +119,8 @@ void tst_qdeclarativeflickable::verticalViewportSize()
QDeclarativeFlickable *obj = qobject_cast<QDeclarativeFlickable*>(c.create());
QVERIFY(obj != 0);
- QCOMPARE(obj->viewportWidth(), 200.);
- QCOMPARE(obj->viewportHeight(), 1200.);
+ QCOMPARE(obj->contentWidth(), 200.);
+ QCOMPARE(obj->contentHeight(), 1200.);
QCOMPARE(obj->isAtXBeginning(), true);
QCOMPARE(obj->isAtXEnd(), false);
QCOMPARE(obj->isAtYBeginning(), true);
diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
index 9c9d1d3..2a60fee 100644
--- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
+++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
@@ -298,14 +298,14 @@ void tst_QDeclarativeGridView::inserted()
model.insertItem(i, "Hello", QString::number(i));
QTest::qWait(300);
- gridview->setViewportY(120);
+ gridview->setContentY(120);
QTest::qWait(300);
// Insert item outside visible area
model.insertItem(1, "Hello", "1324");
QTest::qWait(300);
- QVERIFY(gridview->viewportY() == 120);
+ QVERIFY(gridview->contentY() == 120);
delete canvas;
}
@@ -392,7 +392,7 @@ void tst_QDeclarativeGridView::removed()
}
// Remove items before visible
- gridview->setViewportY(120);
+ gridview->setContentY(120);
QTest::qWait(500);
gridview->setCurrentIndex(10);
@@ -400,7 +400,7 @@ void tst_QDeclarativeGridView::removed()
QTest::qWait(300);
// Setting currentIndex above shouldn't cause view to scroll
- QCOMPARE(gridview->viewportY(), 120.0);
+ QCOMPARE(gridview->contentY(), 120.0);
model.removeItem(1);
@@ -424,7 +424,7 @@ void tst_QDeclarativeGridView::removed()
QCOMPARE(gridview->currentIndex(), 9);
QVERIFY(gridview->currentItem() != oldCurrent);
- gridview->setViewportY(0);
+ gridview->setContentY(0);
// let transitions settle.
QTest::qWait(300);
@@ -441,7 +441,7 @@ void tst_QDeclarativeGridView::removed()
// remove item outside current view.
gridview->setCurrentIndex(32);
QTest::qWait(500);
- gridview->setViewportY(240);
+ gridview->setContentY(240);
model.removeItem(30);
QVERIFY(gridview->currentIndex() == 31);
@@ -449,7 +449,7 @@ void tst_QDeclarativeGridView::removed()
// remove current item beyond visible items.
gridview->setCurrentIndex(20);
QTest::qWait(500);
- gridview->setViewportY(0);
+ gridview->setContentY(0);
model.removeItem(20);
QTest::qWait(500);
@@ -459,7 +459,7 @@ void tst_QDeclarativeGridView::removed()
// remove item before current, but visible
gridview->setCurrentIndex(8);
QTest::qWait(500);
- gridview->setViewportY(240);
+ gridview->setContentY(240);
oldCurrent = gridview->currentItem();
model.removeItem(6);
QTest::qWait(500);
@@ -520,7 +520,7 @@ void tst_QDeclarativeGridView::moved()
QVERIFY(item->y() == (i/3)*60);
}
- gridview->setViewportY(120);
+ gridview->setContentY(120);
// move outside visible area
model.moveItem(1, 25);
@@ -638,13 +638,13 @@ void tst_QDeclarativeGridView::currentIndex()
QCOMPARE(gridview->currentIndex(), model.count()-1);
QTest::qWait(500);
- QCOMPARE(gridview->viewportY(), 279.0);
+ QCOMPARE(gridview->contentY(), 279.0);
gridview->moveCurrentIndexRight();
QCOMPARE(gridview->currentIndex(), 0);
QTest::qWait(500);
- QCOMPARE(gridview->viewportY(), 0.0);
+ QCOMPARE(gridview->contentY(), 0.0);
// Test keys
qApp->setActiveWindow(canvas);
@@ -829,7 +829,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
// Position on a currently visible item
gridview->positionViewAtIndex(4);
- QCOMPARE(gridview->viewportY(), 60.);
+ QCOMPARE(gridview->contentY(), 60.);
// Confirm items positioned correctly
itemCount = findItems<QDeclarativeItem>(viewport, "wrapper").count();
@@ -843,7 +843,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
// Position on an item beyond the visible items
gridview->positionViewAtIndex(21);
- QCOMPARE(gridview->viewportY(), 420.);
+ QCOMPARE(gridview->contentY(), 420.);
// Confirm items positioned correctly
itemCount = findItems<QDeclarativeItem>(viewport, "wrapper").count();
@@ -857,7 +857,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
// Position on an item that would leave empty space if positioned at the top
gridview->positionViewAtIndex(31);
- QCOMPARE(gridview->viewportY(), 520.);
+ QCOMPARE(gridview->contentY(), 520.);
// Confirm items positioned correctly
itemCount = findItems<QDeclarativeItem>(viewport, "wrapper").count();
@@ -871,7 +871,7 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
// Position at the beginning again
gridview->positionViewAtIndex(0);
- QCOMPARE(gridview->viewportY(), 0.);
+ QCOMPARE(gridview->contentY(), 0.);
// Confirm items positioned correctly
itemCount = findItems<QDeclarativeItem>(viewport, "wrapper").count();
diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
index 9100522..f15f26b 100644
--- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
+++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
@@ -486,14 +486,14 @@ void tst_QDeclarativeListView::inserted()
model.insertItem(i, "Hello", QString::number(i));
QTest::qWait(500);
- listview->setViewportY(80);
+ listview->setContentY(80);
QTest::qWait(500);
// Insert item outside visible area
model.insertItem(1, "Hello", "1324");
QTest::qWait(500);
- QVERIFY(listview->viewportY() == 80);
+ QVERIFY(listview->contentY() == 80);
// Confirm items positioned correctly
for (int i = 5; i < 5+15; ++i) {
@@ -591,7 +591,7 @@ void tst_QDeclarativeListView::removed(bool animated)
}
// Remove items before visible
- listview->setViewportY(80);
+ listview->setContentY(80);
listview->setCurrentIndex(10);
model.removeItem(1); // post: top item will be at 40
@@ -615,7 +615,7 @@ void tst_QDeclarativeListView::removed(bool animated)
QCOMPARE(listview->currentIndex(), 9);
QVERIFY(listview->currentItem() != oldCurrent);
- listview->setViewportY(40); // That's the top now
+ listview->setContentY(40); // That's the top now
// let transitions settle.
QTest::qWait(500);
@@ -631,7 +631,7 @@ void tst_QDeclarativeListView::removed(bool animated)
// remove current item beyond visible items.
listview->setCurrentIndex(20);
QTest::qWait(500);
- listview->setViewportY(40);
+ listview->setContentY(40);
model.removeItem(20);
QTest::qWait(500);
@@ -682,7 +682,7 @@ void tst_QDeclarativeListView::clear()
QVERIFY(listview->count() == 0);
QVERIFY(listview->currentItem() == 0);
- QVERIFY(listview->viewportY() == 0);
+ QVERIFY(listview->contentY() == 0);
delete canvas;
}
@@ -740,7 +740,7 @@ void tst_QDeclarativeListView::moved()
QVERIFY(item->y() == i*20);
}
- listview->setViewportY(80);
+ listview->setContentY(80);
// move outside visible area
model.moveItem(1, 18);
@@ -812,7 +812,7 @@ void tst_QDeclarativeListView::enforceRange()
// view should be positioned at the top of the range.
QDeclarativeItem *item = findItem<QDeclarativeItem>(viewport, "wrapper", 0);
QVERIFY(item);
- QCOMPARE(listview->viewportY(), -100.0);
+ QCOMPARE(listview->contentY(), -100.0);
QDeclarativeText *name = findItem<QDeclarativeText>(viewport, "textName", 0);
QVERIFY(name != 0);
@@ -822,7 +822,7 @@ void tst_QDeclarativeListView::enforceRange()
QCOMPARE(number->text(), model.number(0));
// Check currentIndex is updated when viewport moves
- listview->setViewportY(20);
+ listview->setContentY(20);
QTest::qWait(500);
QCOMPARE(listview->currentIndex(), 6);
@@ -948,10 +948,10 @@ void tst_QDeclarativeListView::sections()
QCOMPARE(listview->currentSection(), QString("0"));
- listview->setViewportY(140);
+ listview->setContentY(140);
QCOMPARE(listview->currentSection(), QString("1"));
- listview->setViewportY(20);
+ listview->setContentY(20);
QCOMPARE(listview->currentSection(), QString("0"));
item = findItem<QDeclarativeItem>(viewport, "wrapper", 1);
@@ -1012,13 +1012,13 @@ void tst_QDeclarativeListView::currentIndex()
QCOMPARE(listview->currentIndex(), model.count()-1);
QTest::qWait(1000);
- QCOMPARE(listview->viewportY(), 279.0);
+ QCOMPARE(listview->contentY(), 279.0);
listview->incrementCurrentIndex();
QCOMPARE(listview->currentIndex(), 0);
QTest::qWait(1000);
- QCOMPARE(listview->viewportY(), 0.0);
+ QCOMPARE(listview->contentY(), 0.0);
// Test keys
canvas->show();
@@ -1181,7 +1181,7 @@ void tst_QDeclarativeListView::positionViewAtIndex()
// Position on a currently visible item
listview->positionViewAtIndex(3);
- QCOMPARE(listview->viewportY(), 60.);
+ QCOMPARE(listview->contentY(), 60.);
// Confirm items positioned correctly
itemCount = findItems<QDeclarativeItem>(viewport, "wrapper").count();
@@ -1194,7 +1194,7 @@ void tst_QDeclarativeListView::positionViewAtIndex()
// Position on an item beyond the visible items
listview->positionViewAtIndex(22);
- QCOMPARE(listview->viewportY(), 440.);
+ QCOMPARE(listview->contentY(), 440.);
// Confirm items positioned correctly
itemCount = findItems<QDeclarativeItem>(viewport, "wrapper").count();
@@ -1207,7 +1207,7 @@ void tst_QDeclarativeListView::positionViewAtIndex()
// Position on an item that would leave empty space if positioned at the top
listview->positionViewAtIndex(28);
- QCOMPARE(listview->viewportY(), 480.);
+ QCOMPARE(listview->contentY(), 480.);
// Confirm items positioned correctly
itemCount = findItems<QDeclarativeItem>(viewport, "wrapper").count();
@@ -1220,7 +1220,7 @@ void tst_QDeclarativeListView::positionViewAtIndex()
// Position at the beginning again
listview->positionViewAtIndex(0);
- QCOMPARE(listview->viewportY(), 0.);
+ QCOMPARE(listview->contentY(), 0.);
// Confirm items positioned correctly
itemCount = findItems<QDeclarativeItem>(viewport, "wrapper").count();
diff --git a/tests/auto/declarative/visual/qdeclarativeflickable/flickable-horizontal.qml b/tests/auto/declarative/visual/qdeclarativeflickable/flickable-horizontal.qml
index 1a7366d..50ba9ad 100644
--- a/tests/auto/declarative/visual/qdeclarativeflickable/flickable-horizontal.qml
+++ b/tests/auto/declarative/visual/qdeclarativeflickable/flickable-horizontal.qml
@@ -17,7 +17,7 @@ Rectangle {
Flickable {
id: flickable
- anchors.fill: parent; viewportWidth: row.width
+ anchors.fill: parent; contentWidth: row.width
Row {
id: row
diff --git a/tests/auto/declarative/visual/qdeclarativeflickable/flickable-vertical.qml b/tests/auto/declarative/visual/qdeclarativeflickable/flickable-vertical.qml
index 6204aa9..ebb963d 100644
--- a/tests/auto/declarative/visual/qdeclarativeflickable/flickable-vertical.qml
+++ b/tests/auto/declarative/visual/qdeclarativeflickable/flickable-vertical.qml
@@ -18,7 +18,7 @@ Rectangle {
flickable {
id: flick
height: parent.height-50
- width: parent.width; viewportHeight: column.height
+ width: parent.width; contentHeight: column.height
Column {
id: column