aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquicklistview')
-rw-r--r--tests/auto/quick/qquicklistview/data/stickyPositioning-both.qml77
-rw-r--r--tests/auto/quick/qquicklistview/data/stickyPositioning-footer.qml70
-rw-r--r--tests/auto/quick/qquicklistview/data/stickyPositioning-header.qml70
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp409
4 files changed, 626 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/data/stickyPositioning-both.qml b/tests/auto/quick/qquicklistview/data/stickyPositioning-both.qml
new file mode 100644
index 0000000000..4bbe7a0053
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/stickyPositioning-both.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.4
+
+Rectangle {
+ width: 240
+ height: 320
+ ListView {
+ id: list
+ objectName: "list"
+ width: 100
+ height: 100
+ cacheBuffer: 0
+ anchors.centerIn: parent
+ model: testModel
+ orientation: testOrientation
+ layoutDirection: testLayoutDirection
+ verticalLayoutDirection: testVerticalLayoutDirection
+ delegate: Rectangle {
+ width: 10
+ height: 10
+ border.width: 1
+ border.color: "gray"
+ }
+ headerPositioning: ListView.PullBackHeader
+ header: Rectangle {
+ width: 10
+ height: 10
+ color: "red"
+ objectName: "header"
+ }
+ footerPositioning: ListView.PullBackFooter
+ footer: Rectangle {
+ width: 10
+ height: 10
+ color: "blue"
+ objectName: "footer"
+ }
+ }
+}
diff --git a/tests/auto/quick/qquicklistview/data/stickyPositioning-footer.qml b/tests/auto/quick/qquicklistview/data/stickyPositioning-footer.qml
new file mode 100644
index 0000000000..57773df37e
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/stickyPositioning-footer.qml
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.4
+
+Rectangle {
+ width: 240
+ height: 320
+ ListView {
+ id: list
+ objectName: "list"
+ width: 100
+ height: 100
+ cacheBuffer: 0
+ anchors.centerIn: parent
+ model: testModel
+ orientation: testOrientation
+ layoutDirection: testLayoutDirection
+ verticalLayoutDirection: testVerticalLayoutDirection
+ delegate: Rectangle {
+ width: 10
+ height: 10
+ border.width: 1
+ border.color: "gray"
+ }
+ footerPositioning: ListView.PullBackFooter
+ footer: Rectangle {
+ width: 10
+ height: 10
+ color: "blue"
+ objectName: "footer"
+ }
+ }
+}
diff --git a/tests/auto/quick/qquicklistview/data/stickyPositioning-header.qml b/tests/auto/quick/qquicklistview/data/stickyPositioning-header.qml
new file mode 100644
index 0000000000..1ca9813baa
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/stickyPositioning-header.qml
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.4
+
+Rectangle {
+ width: 240
+ height: 320
+ ListView {
+ id: list
+ objectName: "list"
+ width: 100
+ height: 100
+ cacheBuffer: 0
+ anchors.centerIn: parent
+ model: testModel
+ orientation: testOrientation
+ layoutDirection: testLayoutDirection
+ verticalLayoutDirection: testVerticalLayoutDirection
+ delegate: Rectangle {
+ width: 10
+ height: 10
+ border.width: 1
+ border.color: "gray"
+ }
+ headerPositioning: ListView.PullBackHeader
+ header: Rectangle {
+ width: 10
+ height: 10
+ color: "red"
+ objectName: "header"
+ }
+ }
+}
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index c8ab62cbbc..39610e57f7 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -228,6 +228,9 @@ private slots:
void QTBUG_36481();
void QTBUG_35920();
+ void stickyPositioning();
+ void stickyPositioning_data();
+
void roundingErrors();
void roundingErrors_data();
@@ -7309,6 +7312,412 @@ void tst_QQuickListView::QTBUG_35920()
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(10,100));
}
+Q_DECLARE_METATYPE(Qt::Orientation)
+
+void tst_QQuickListView::stickyPositioning()
+{
+ QFETCH(QString, fileName);
+
+ QFETCH(Qt::Orientation, orientation);
+ QFETCH(Qt::LayoutDirection, layoutDirection);
+ QFETCH(QQuickItemView::VerticalLayoutDirection, verticalLayoutDirection);
+
+ QFETCH(int, positionIndex);
+ QFETCH(QQuickItemView::PositionMode, positionMode);
+ QFETCH(QList<QPointF>, movement);
+
+ QFETCH(QPointF, headerPos);
+ QFETCH(QPointF, footerPos);
+
+ QQuickView *window = createView();
+
+ QaimModel model;
+ for (int i = 0; i < 20; i++)
+ model.addItem(QString::number(i), QString::number(i/10));
+
+ QQmlContext *ctxt = window->rootContext();
+ ctxt->setContextProperty("testModel", &model);
+ ctxt->setContextProperty("testOrientation", orientation);
+ ctxt->setContextProperty("testLayoutDirection", layoutDirection);
+ ctxt->setContextProperty("testVerticalLayoutDirection", verticalLayoutDirection);
+
+ window->setSource(testFileUrl(fileName));
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
+
+ QQuickListView *listview = findItem<QQuickListView>(window->rootObject(), "list");
+ QVERIFY(listview);
+
+ QQuickItem *contentItem = listview->contentItem();
+ QVERIFY(contentItem);
+
+ listview->positionViewAtIndex(positionIndex, positionMode);
+
+ foreach (const QPointF &offset, movement) {
+ listview->setContentX(listview->contentX() + offset.x());
+ listview->setContentY(listview->contentY() + offset.y());
+ }
+
+ if (listview->header()) {
+ QQuickItem *headerItem = listview->headerItem();
+ QVERIFY(headerItem);
+ QPointF actualPos = listview->mapFromItem(contentItem, headerItem->position());
+ QCOMPARE(actualPos, headerPos);
+ }
+
+ if (listview->footer()) {
+ QQuickItem *footerItem = listview->footerItem();
+ QVERIFY(footerItem);
+ QPointF actualPos = listview->mapFromItem(contentItem, footerItem->position());
+ QCOMPARE(actualPos, footerPos);
+ }
+
+ delete window;
+}
+
+void tst_QQuickListView::stickyPositioning_data()
+{
+ qRegisterMetaType<Qt::Orientation>();
+ qRegisterMetaType<Qt::LayoutDirection>();
+ qRegisterMetaType<QQuickItemView::VerticalLayoutDirection>();
+ qRegisterMetaType<QQuickItemView::PositionMode>();
+
+ QTest::addColumn<QString>("fileName");
+
+ QTest::addColumn<Qt::Orientation>("orientation");
+ QTest::addColumn<Qt::LayoutDirection>("layoutDirection");
+ QTest::addColumn<QQuickItemView::VerticalLayoutDirection>("verticalLayoutDirection");
+
+ QTest::addColumn<int>("positionIndex");
+ QTest::addColumn<QQuickItemView::PositionMode>("positionMode");
+ QTest::addColumn<QList<QPointF> >("movement");
+
+ QTest::addColumn<QPointF>("headerPos");
+ QTest::addColumn<QPointF>("footerPos");
+
+ // header at the top
+ QTest::newRow("top header") << "stickyPositioning-header.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 0 << QQuickItemView::Beginning << QList<QPointF>()
+ << QPointF(0,-10) << QPointF();
+
+ QTest::newRow("top header: 1/2 up") << "stickyPositioning-header.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 1 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,-5))
+ << QPointF(0,-5) << QPointF();
+
+ QTest::newRow("top header: up") << "stickyPositioning-header.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 2 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,-15))
+ << QPointF(0,0) << QPointF();
+
+ QTest::newRow("top header: 1/2 down") << "stickyPositioning-header.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 3 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,-15) << QPointF(0,5))
+ << QPointF(0,-5) << QPointF();
+
+ QTest::newRow("top header: down") << "stickyPositioning-header.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 4 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,-15) << QPointF(0,10))
+ << QPointF(0,-10) << QPointF();
+
+
+ // footer at the top
+ QTest::newRow("top footer") << "stickyPositioning-footer.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::BottomToTop
+ << 19 << QQuickItemView::End << QList<QPointF>()
+ << QPointF() << QPointF(0,-10);
+
+ QTest::newRow("top footer: 1/2 up") << "stickyPositioning-footer.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::BottomToTop
+ << 18 << QQuickItemView::End << (QList<QPointF>() << QPointF(0,-5))
+ << QPointF() << QPointF(0,-5);
+
+ QTest::newRow("top footer: up") << "stickyPositioning-footer.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::BottomToTop
+ << 17 << QQuickItemView::End << (QList<QPointF>() << QPointF(0,-15))
+ << QPointF() << QPointF(0,0);
+
+ QTest::newRow("top footer: 1/2 down") << "stickyPositioning-footer.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::BottomToTop
+ << 16 << QQuickItemView::End << (QList<QPointF>() << QPointF(0,-15) << QPointF(0,5))
+ << QPointF() << QPointF(0,-5);
+
+ QTest::newRow("top footer: down") << "stickyPositioning-footer.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::BottomToTop
+ << 15 << QQuickItemView::End << (QList<QPointF>() << QPointF(0,-15) << QPointF(0,10))
+ << QPointF() << QPointF(0,-10);
+
+
+ // header at the bottom
+ QTest::newRow("bottom header") << "stickyPositioning-header.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::BottomToTop
+ << 0 << QQuickItemView::Beginning << QList<QPointF>()
+ << QPointF(0,100) << QPointF();
+
+ QTest::newRow("bottom header: 1/2 down") << "stickyPositioning-header.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::BottomToTop
+ << 1 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,5))
+ << QPointF(0,95) << QPointF();
+
+ QTest::newRow("bottom header: down") << "stickyPositioning-header.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::BottomToTop
+ << 2 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,15))
+ << QPointF(0,90) << QPointF();
+
+ QTest::newRow("bottom header: 1/2 up") << "stickyPositioning-header.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::BottomToTop
+ << 3 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,15) << QPointF(0,-5))
+ << QPointF(0,95) << QPointF();
+
+ QTest::newRow("bottom header: up") << "stickyPositioning-header.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::BottomToTop
+ << 4 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,15) << QPointF(0,-10))
+ << QPointF(0,100) << QPointF();
+
+
+ // footer at the bottom
+ QTest::newRow("bottom footer") << "stickyPositioning-footer.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 19 << QQuickItemView::End << QList<QPointF>()
+ << QPointF() << QPointF(0,100);
+
+ QTest::newRow("bottom footer: 1/2 down") << "stickyPositioning-footer.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 18 << QQuickItemView::End << (QList<QPointF>() << QPointF(0,5))
+ << QPointF() << QPointF(0,95);
+
+ QTest::newRow("bottom footer: down") << "stickyPositioning-footer.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 17 << QQuickItemView::End << (QList<QPointF>() << QPointF(0,15))
+ << QPointF() << QPointF(0,90);
+
+ QTest::newRow("bottom footer: 1/2 up") << "stickyPositioning-footer.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 16 << QQuickItemView::End << (QList<QPointF>() << QPointF(0,15) << QPointF(0,-5))
+ << QPointF() << QPointF(0,95);
+
+ QTest::newRow("bottom footer: up") << "stickyPositioning-footer.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 15 << QQuickItemView::End << (QList<QPointF>() << QPointF(0,15) << QPointF(0,-10))
+ << QPointF() << QPointF(0,100);
+
+
+ // header at the top (& footer at the bottom)
+ QTest::newRow("top header & bottom footer") << "stickyPositioning-both.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 0 << QQuickItemView::Beginning << QList<QPointF>()
+ << QPointF(0,-10) << QPointF(0,90);
+
+ QTest::newRow("top header & bottom footer: 1/2 up") << "stickyPositioning-both.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 1 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,-5))
+ << QPointF(0,-5) << QPointF(0,95);
+
+ QTest::newRow("top header & bottom footer: up") << "stickyPositioning-both.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 2 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,-15))
+ << QPointF(0,0) << QPointF(0,100);
+
+ QTest::newRow("top header & bottom footer: 1/2 down") << "stickyPositioning-both.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 3 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,-15) << QPointF(0,5))
+ << QPointF(0,-5) << QPointF(0,95);
+
+ QTest::newRow("top header & bottom footer: down") << "stickyPositioning-both.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 4 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,-15) << QPointF(0,10))
+ << QPointF(0,-10) << QPointF(0,90);
+
+
+ // footer at the bottom (& header at the top)
+ QTest::newRow("bottom footer & top header") << "stickyPositioning-both.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 1 << QQuickItemView::Beginning << QList<QPointF>()
+ << QPointF(0,-10) << QPointF(0,90);
+
+ QTest::newRow("bottom footer & top header: 1/2 down") << "stickyPositioning-both.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 1 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,5))
+ << QPointF(0,-10) << QPointF(0,90);
+
+ QTest::newRow("bottom footer & top header: down") << "stickyPositioning-both.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 2 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,15))
+ << QPointF(0,-10) << QPointF(0,90);
+
+ QTest::newRow("bottom footer & top header: 1/2 up") << "stickyPositioning-both.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 3 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,15) << QPointF(0,-5))
+ << QPointF(0,-5) << QPointF(0,95);
+
+ QTest::newRow("bottom footer & top header: up") << "stickyPositioning-both.qml"
+ << Qt::Vertical << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 4 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(0,15) << QPointF(0,-10))
+ << QPointF(0,0) << QPointF(0,100);
+
+ // header on the left
+ QTest::newRow("left header") << "stickyPositioning-header.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 0 << QQuickItemView::Beginning << QList<QPointF>()
+ << QPointF(-10,0) << QPointF();
+
+ QTest::newRow("left header: 1/2 left") << "stickyPositioning-header.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 1 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(-5,0))
+ << QPointF(-5,0) << QPointF();
+
+ QTest::newRow("left header: left") << "stickyPositioning-header.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 2 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(-15,0))
+ << QPointF(0,0) << QPointF();
+
+ QTest::newRow("left header: 1/2 right") << "stickyPositioning-header.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 3 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(-15,0) << QPointF(5,0))
+ << QPointF(-5,0) << QPointF();
+
+ QTest::newRow("left header: right") << "stickyPositioning-header.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 4 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(-15,0) << QPointF(10,0))
+ << QPointF(-10,0) << QPointF();
+
+
+ // footer on the left
+ QTest::newRow("left footer") << "stickyPositioning-footer.qml"
+ << Qt::Horizontal << Qt::RightToLeft << QQuickListView::TopToBottom
+ << 19 << QQuickItemView::End << QList<QPointF>()
+ << QPointF() << QPointF(-10,0);
+
+ QTest::newRow("left footer: 1/2 left") << "stickyPositioning-footer.qml"
+ << Qt::Horizontal << Qt::RightToLeft << QQuickListView::TopToBottom
+ << 18 << QQuickItemView::End << (QList<QPointF>() << QPointF(-5,0))
+ << QPointF() << QPointF(-5,0);
+
+ QTest::newRow("left footer: left") << "stickyPositioning-footer.qml"
+ << Qt::Horizontal << Qt::RightToLeft << QQuickListView::TopToBottom
+ << 17 << QQuickItemView::End << (QList<QPointF>() << QPointF(-15,0))
+ << QPointF() << QPointF(0,0);
+
+ QTest::newRow("left footer: 1/2 right") << "stickyPositioning-footer.qml"
+ << Qt::Horizontal << Qt::RightToLeft << QQuickListView::TopToBottom
+ << 16 << QQuickItemView::End << (QList<QPointF>() << QPointF(-15,0) << QPointF(5,0))
+ << QPointF() << QPointF(-5,0);
+
+ QTest::newRow("left footer: right") << "stickyPositioning-footer.qml"
+ << Qt::Horizontal << Qt::RightToLeft << QQuickListView::TopToBottom
+ << 15 << QQuickItemView::End << (QList<QPointF>() << QPointF(-15,0) << QPointF(10,0))
+ << QPointF() << QPointF(-10,0);
+
+
+ // header on the right
+ QTest::newRow("right header") << "stickyPositioning-header.qml"
+ << Qt::Horizontal << Qt::RightToLeft << QQuickListView::TopToBottom
+ << 0 << QQuickItemView::Beginning << QList<QPointF>()
+ << QPointF(100,0) << QPointF();
+
+ QTest::newRow("right header: 1/2 right") << "stickyPositioning-header.qml"
+ << Qt::Horizontal << Qt::RightToLeft << QQuickListView::TopToBottom
+ << 1 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(5,0))
+ << QPointF(95,0) << QPointF();
+
+ QTest::newRow("right header: right") << "stickyPositioning-header.qml"
+ << Qt::Horizontal << Qt::RightToLeft << QQuickListView::TopToBottom
+ << 2 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(15,0))
+ << QPointF(90,0) << QPointF();
+
+ QTest::newRow("right header: 1/2 left") << "stickyPositioning-header.qml"
+ << Qt::Horizontal << Qt::RightToLeft << QQuickListView::TopToBottom
+ << 3 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(15,0) << QPointF(-5,0))
+ << QPointF(95,0) << QPointF();
+
+ QTest::newRow("right header: left") << "stickyPositioning-header.qml"
+ << Qt::Horizontal << Qt::RightToLeft << QQuickListView::TopToBottom
+ << 4 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(15,0) << QPointF(-10,0))
+ << QPointF(100,0) << QPointF();
+
+
+ // footer on the right
+ QTest::newRow("right footer") << "stickyPositioning-footer.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 19 << QQuickItemView::End << QList<QPointF>()
+ << QPointF() << QPointF(100,0);
+
+ QTest::newRow("right footer: 1/2 right") << "stickyPositioning-footer.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 18 << QQuickItemView::End << (QList<QPointF>() << QPointF(5,0))
+ << QPointF() << QPointF(95,0);
+
+ QTest::newRow("right footer: right") << "stickyPositioning-footer.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 17 << QQuickItemView::End << (QList<QPointF>() << QPointF(15,0))
+ << QPointF() << QPointF(90,0);
+
+ QTest::newRow("right footer: 1/2 left") << "stickyPositioning-footer.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 16 << QQuickItemView::End << (QList<QPointF>() << QPointF(15,0) << QPointF(-5,0))
+ << QPointF() << QPointF(95,0);
+
+ QTest::newRow("right footer: left") << "stickyPositioning-footer.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 15 << QQuickItemView::End << (QList<QPointF>() << QPointF(15,0) << QPointF(-10,0))
+ << QPointF() << QPointF(100,0);
+
+
+ // header on the left (& footer on the right)
+ QTest::newRow("left header & right footer") << "stickyPositioning-both.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 0 << QQuickItemView::Beginning << QList<QPointF>()
+ << QPointF(-10,0) << QPointF(90,0);
+
+ QTest::newRow("left header & right footer: 1/2 left") << "stickyPositioning-both.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 1 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(-5,0))
+ << QPointF(-5,0) << QPointF(95,0);
+
+ QTest::newRow("left header & right footer: left") << "stickyPositioning-both.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 2 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(-15,0))
+ << QPointF(0,0) << QPointF(100,0);
+
+ QTest::newRow("left header & right footer: 1/2 right") << "stickyPositioning-both.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 3 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(-15,0) << QPointF(5,0))
+ << QPointF(-5,0) << QPointF(95,0);
+
+ QTest::newRow("left header & right footer: right") << "stickyPositioning-both.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 4 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(-15,0) << QPointF(10,0))
+ << QPointF(-10,0) << QPointF(90,0);
+
+
+ // footer on the right (& header on the left)
+ QTest::newRow("right footer & left header") << "stickyPositioning-both.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 1 << QQuickItemView::Beginning << QList<QPointF>()
+ << QPointF(-10,0) << QPointF(90,0);
+
+ QTest::newRow("right footer & left header: 1/2 right") << "stickyPositioning-both.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 1 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(5,0))
+ << QPointF(-10,0) << QPointF(90,0);
+
+ QTest::newRow("right footer & left header: right") << "stickyPositioning-both.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 2 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(15,0))
+ << QPointF(-10,0) << QPointF(90,0);
+
+ QTest::newRow("right footer & left header: 1/2 left") << "stickyPositioning-both.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 3 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(15,0) << QPointF(-5,0))
+ << QPointF(-5,0) << QPointF(95,0);
+
+ QTest::newRow("right footer & left header: left") << "stickyPositioning-both.qml"
+ << Qt::Horizontal << Qt::LeftToRight << QQuickListView::TopToBottom
+ << 4 << QQuickItemView::Beginning << (QList<QPointF>() << QPointF(15,0) << QPointF(-10,0))
+ << QPointF(0,0) << QPointF(100,0);
+}
+
void tst_QQuickListView::roundingErrors()
{
QFETCH(bool, pixelAligned);