diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-10-06 12:44:04 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-10-06 14:43:25 +0000 |
commit | 78179e8b77fddbc6f017e5007fe157425a8eb6e4 (patch) | |
tree | 6b25e27271ae2a85ec9be94150c35762c82ceff8 /tests/manual | |
parent | 18920258393030124186dc589c99d1164b576108 (diff) |
ScrollIndicator: replace PNGs with GIFs
Change-Id: I04d55b0e2e089cb55c26b921409ff2e5e58f55d9
Task-number: QTBUG-55904
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/gifs/data/qtquickcontrols2-scrollindicator.qml | 67 | ||||
-rw-r--r-- | tests/manual/gifs/tst_gifs.cpp | 31 |
2 files changed, 98 insertions, 0 deletions
diff --git a/tests/manual/gifs/data/qtquickcontrols2-scrollindicator.qml b/tests/manual/gifs/data/qtquickcontrols2-scrollindicator.qml new file mode 100644 index 00000000..091e5250 --- /dev/null +++ b/tests/manual/gifs/data/qtquickcontrols2-scrollindicator.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** 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 The Qt Company Ltd 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.6 +import QtQuick.Window 2.0 +import QtQuick.Controls 2.0 + +Window { + width: 100 + height: 120 + visible: true + color: "#eeeeee" + + ListView { + anchors.fill: parent + + ScrollIndicator.vertical: ScrollIndicator { + active: true + } + + model: 10 + delegate: Label { + text: qsTr("Item %1").arg(index + 1) + width: 100 + height: 40 + leftPadding: 10 + verticalAlignment: Text.AlignVCenter + } + } +} diff --git a/tests/manual/gifs/tst_gifs.cpp b/tests/manual/gifs/tst_gifs.cpp index a54dd961..33964aec 100644 --- a/tests/manual/gifs/tst_gifs.cpp +++ b/tests/manual/gifs/tst_gifs.cpp @@ -66,6 +66,7 @@ private slots: void dial_data(); void dial(); void scrollBar(); + void scrollIndicator(); void progressBar_data(); void progressBar(); void triState_data(); @@ -730,6 +731,36 @@ void tst_Gifs::scrollBar() gifRecorder.waitForFinish(); } +void tst_Gifs::scrollIndicator() +{ + GifRecorder gifRecorder; + gifRecorder.setDataDirPath(dataDirPath); + gifRecorder.setOutputDir(outputDir); + gifRecorder.setRecordingDuration(6); + gifRecorder.setQmlFileName("qtquickcontrols2-scrollindicator.qml"); + + gifRecorder.start(); + + // Flick in the center of the screen to show that there's a scroll indicator. + QQuickWindow *window = gifRecorder.window(); + const QPoint windowBottom = QPoint(0, window->height() - 1); + QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, windowBottom, 100); + QTest::mouseMove(window, windowBottom - QPoint(0, 10), 30); + QTest::mouseMove(window, windowBottom - QPoint(0, 30), 30); + QTest::mouseMove(window, windowBottom - QPoint(0, 60), 30); + QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, windowBottom - QPoint(0, 100), 30); + + // Scroll back down. + const QPoint windowTop = QPoint(0, 0); + QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, windowTop, 2000); + QTest::mouseMove(window, windowTop + QPoint(0, 10), 30); + QTest::mouseMove(window, windowTop + QPoint(0, 30), 30); + QTest::mouseMove(window, windowTop + QPoint(0, 60), 30); + QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, windowTop + QPoint(0, 100), 30); + + gifRecorder.waitForFinish(); +} + void tst_Gifs::progressBar_data() { QTest::addColumn<bool>("indeterminate"); |