aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2017-11-17 16:47:14 +0100
committerFrederik Gladhorn <frederik.gladhorn@qt.io>2018-07-31 13:11:04 +0000
commitdc7f59d5025b977117e6a61e30c892d0cad7dff7 (patch)
tree1bfcb2133434dd217c67573b1df20818c48631eb /tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
parentf70a25aecb2415d33b76b95d607f7e303c8db0a0 (diff)
Increase fine-grained signals for some properties in Flickable
Flickable.at[X/Y][Beginning/End] were being always notified of changes at bulk. This is can be harmful in performance of QML applications that will trigger change requests on the program whenever a property is modified. This introduces separate signals so it's not a problem anymore. Change-Id: I729852df665ec34f532812dd0a45507d053d624c Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickflickable/tst_qquickflickable.cpp')
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index ba266824e6..965ef6987a 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -1919,6 +1919,10 @@ void tst_qquickflickable::stopAtBounds()
else
QCOMPARE(transpose ? flickable->isAtYBeginning() : flickable->isAtXBeginning(), true);
+ QSignalSpy atXBeginningChangedSpy(flickable, &QQuickFlickable::atXBeginningChanged);
+ QSignalSpy atYBeginningChangedSpy(flickable, &QQuickFlickable::atYBeginningChanged);
+ QSignalSpy atXEndChangedSpy(flickable, &QQuickFlickable::atXEndChanged);
+ QSignalSpy atYEndChangedSpy(flickable, &QQuickFlickable::atYEndChanged);
// drag back towards boundary
for (int i = 0; i < 24; ++i) {
axis += invert ? threshold / 3 : -threshold / 3;
@@ -1930,6 +1934,11 @@ void tst_qquickflickable::stopAtBounds()
else
QCOMPARE(transpose ? flickable->isAtYBeginning() : flickable->isAtXBeginning(), false);
+ QCOMPARE(atXBeginningChangedSpy.count(), (!transpose && !invert) ? 1 : 0);
+ QCOMPARE(atYBeginningChangedSpy.count(), ( transpose && !invert) ? 1 : 0);
+ QCOMPARE(atXEndChangedSpy.count(), (!transpose && invert) ? 1 : 0);
+ QCOMPARE(atYEndChangedSpy.count(), ( transpose && invert) ? 1 : 0);
+
// Drag away from the aligned boundary again.
// None of the mouse movements will position the view at the boundary exactly,
// but the view should end up aligned on the boundary