summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-12-02 05:13:07 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-12-02 05:13:07 (GMT)
commitb924311bfd6d5f8bdd92144a699ed50496db2679 (patch)
treef17ce7854f2bb27822237f7f4126e1356404112b /tests
parente8c0f90ee076cacf2442fddb5b21f93ffafe0876 (diff)
parentdfe2b6b4fb53e973aa455e1fe214925dfe03de9f (diff)
downloadQt-b924311bfd6d5f8bdd92144a699ed50496db2679.zip
Qt-b924311bfd6d5f8bdd92144a699ed50496db2679.tar.gz
Qt-b924311bfd6d5f8bdd92144a699ed50496db2679.tar.bz2
Merge branch '4.7' of git://scm.dev.nokia.troll.no/qt/qt-water-team
* '4.7' of git://scm.dev.nokia.troll.no/qt/qt-water-team: Improvement of de30288: handle PNGs having 1 to 4 bytes truncated. Workaround for certain malformed PNGs that lack the final crc bytes Fix two minor doc errors ListView header is not visible initially. Fix license header. Change pen correctly when drawing cached text Fix BorderImage painting at sizes less than margin size. Fix resource leak in QEgl::getCompatibleVisualld() Fixed OpenGL state getting out of sync. Fix whitespace in previous 1e7b4e396ec3bacc1a769208b990c5e0450f0d3a Declarative: Fix compiler warnings (Linux/g++)
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/header1.qml33
-rw-r--r--tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp67
2 files changed, 82 insertions, 18 deletions
diff --git a/tests/auto/declarative/qdeclarativelistview/data/header1.qml b/tests/auto/declarative/qdeclarativelistview/data/header1.qml
new file mode 100644
index 0000000..f2ab4c1
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativelistview/data/header1.qml
@@ -0,0 +1,33 @@
+import QtQuick 1.0
+
+Rectangle {
+ width: 240
+ height: 320
+ color: "#ffffff"
+
+ ListModel { id: testModel }
+
+ ListView {
+ id: list
+ objectName: "list"
+ width: parent.width
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ model: testModel
+ delegate: Text {
+ objectName: "wrapper"
+ font.pointSize: 20
+ text: index
+ }
+ footer: Rectangle {
+ width: parent.width
+ height: 40
+ color: "green"
+ }
+ header: Text { objectName: "header"; text: "Header" }
+ }
+
+ Component.onCompleted: {
+ for (var i=0; i<30; i++) testModel.append({"name" : i, "val": i})
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
index 295a75d..759caf2 100644
--- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
+++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp
@@ -1664,32 +1664,63 @@ void tst_QDeclarativeListView::QTBUG_11105()
void tst_QDeclarativeListView::header()
{
- QDeclarativeView *canvas = createView();
+ {
+ QDeclarativeView *canvas = createView();
- TestModel model;
- for (int i = 0; i < 30; i++)
- model.addItem("Item" + QString::number(i), "");
+ TestModel model;
+ for (int i = 0; i < 30; i++)
+ model.addItem("Item" + QString::number(i), "");
- QDeclarativeContext *ctxt = canvas->rootContext();
- ctxt->setContextProperty("testModel", &model);
+ QDeclarativeContext *ctxt = canvas->rootContext();
+ ctxt->setContextProperty("testModel", &model);
- canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/header.qml"));
- qApp->processEvents();
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/header.qml"));
+ qApp->processEvents();
- QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
- QTRY_VERIFY(listview != 0);
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
- QDeclarativeItem *contentItem = listview->contentItem();
- QTRY_VERIFY(contentItem != 0);
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
- QDeclarativeText *header = findItem<QDeclarativeText>(contentItem, "header");
- QVERIFY(header);
- QCOMPARE(header->y(), 0.0);
+ QDeclarativeText *header = findItem<QDeclarativeText>(contentItem, "header");
+ QVERIFY(header);
+ QCOMPARE(header->y(), 0.0);
- QCOMPARE(listview->contentY(), 0.0);
+ QCOMPARE(listview->contentY(), 0.0);
- model.clear();
- QTRY_COMPARE(header->y(), 0.0);
+ model.clear();
+ QTRY_COMPARE(header->y(), 0.0);
+
+ delete canvas;
+ }
+ {
+ QDeclarativeView *canvas = createView();
+
+ TestModel model;
+
+ QDeclarativeContext *ctxt = canvas->rootContext();
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/header1.qml"));
+ qApp->processEvents();
+
+ QDeclarativeListView *listview = findItem<QDeclarativeListView>(canvas->rootObject(), "list");
+ QTRY_VERIFY(listview != 0);
+
+ QDeclarativeItem *contentItem = listview->contentItem();
+ QTRY_VERIFY(contentItem != 0);
+
+ QDeclarativeText *header = findItem<QDeclarativeText>(contentItem, "header");
+ QVERIFY(header);
+ QCOMPARE(header->y(), 0.0);
+
+ QCOMPARE(listview->contentY(), 0.0);
+
+ model.clear();
+ QTRY_COMPARE(header->y(), 0.0);
+
+ delete canvas;
+ }
}
void tst_QDeclarativeListView::footer()