aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickflickable
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-02-06 01:00:11 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2020-02-06 08:41:57 +0100
commit7d86b35dc6833057cae86d9a70e8f2c598c68db5 (patch)
treec5b3e87bd0edef2d74bc16b5aba6cbb6b298cd81 /tests/auto/quick/qquickflickable
parent4975a33ba9aa357ba2bca93e292b1fbcfb34c24e (diff)
parent4e15f2135cdbefd9999a17d4e4fff5ea93679fac (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts: .qmake.conf src/qml/types/qqmlbind.cpp src/quick/items/qquicklistview.cpp tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: Id6805c13256ad13d5651011e5dd09bba0ec02987
Diffstat (limited to 'tests/auto/quick/qquickflickable')
-rw-r--r--tests/auto/quick/qquickflickable/data/visibleAreaBinding.qml38
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp11
2 files changed, 49 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickflickable/data/visibleAreaBinding.qml b/tests/auto/quick/qquickflickable/data/visibleAreaBinding.qml
new file mode 100644
index 0000000000..6f7bc89793
--- /dev/null
+++ b/tests/auto/quick/qquickflickable/data/visibleAreaBinding.qml
@@ -0,0 +1,38 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.14
+
+Flickable {
+ id: flickable
+ // Deliberately has no size set.
+
+ Text {
+ text: flickable.visibleArea.xPosition
+ }
+}
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index 5364530ca8..f3659290eb 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -205,6 +205,7 @@ private slots:
void overshoot_reentrant();
void synchronousDrag_data();
void synchronousDrag();
+ void visibleAreaBinding();
private:
void flickWithTouch(QQuickWindow *window, const QPoint &from, const QPoint &to);
@@ -2540,6 +2541,16 @@ void tst_qquickflickable::synchronousDrag()
QTest::touchEvent(window, touchDevice).release(0, p5, window);
}
+// QTBUG-81098: tests that a binding to visibleArea doesn't result
+// in a division-by-zero exception (when exceptions are enabled).
+void tst_qquickflickable::visibleAreaBinding()
+{
+ QScopedPointer<QQuickView> window(new QQuickView);
+ window->setSource(testFileUrl("visibleAreaBinding.qml"));
+ QTRY_COMPARE(window->status(), QQuickView::Ready);
+ // Shouldn't crash.
+}
+
QTEST_MAIN(tst_qquickflickable)
#include "tst_qquickflickable.moc"