diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-10-06 10:25:51 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-10-06 14:43:11 +0000 |
commit | 563c2b9e3a515818484451b7752b3c4ef7ac3b71 (patch) | |
tree | 4e328bc6295da70a715d550d5c65a9f5abc3b766 /tests | |
parent | 88969bdbd66b0829fe5e5b90eeb605c663d1b887 (diff) |
ProgressBar: replace PNGs with GIFs
Change-Id: I8d11eae7e853b0aa8175e4cffd3520777713d50b
Task-number: QTBUG-55904
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manual/gifs/data/qtquickcontrols2-progressbar-indeterminate.qml | 57 | ||||
-rw-r--r-- | tests/manual/gifs/data/qtquickcontrols2-progressbar.qml | 71 | ||||
-rw-r--r-- | tests/manual/gifs/tst_gifs.cpp | 25 |
3 files changed, 153 insertions, 0 deletions
diff --git a/tests/manual/gifs/data/qtquickcontrols2-progressbar-indeterminate.qml b/tests/manual/gifs/data/qtquickcontrols2-progressbar-indeterminate.qml new file mode 100644 index 00000000..0785b279 --- /dev/null +++ b/tests/manual/gifs/data/qtquickcontrols2-progressbar-indeterminate.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** 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.7 +import QtQuick.Window 2.0 +import QtQuick.Controls 2.0 + +Window { + width: progressBar.implicitWidth + height: 64 + visible: true + + property alias progressBar: progressBar + + ProgressBar { + id: progressBar + indeterminate: true + anchors.centerIn: parent + } +} diff --git a/tests/manual/gifs/data/qtquickcontrols2-progressbar.qml b/tests/manual/gifs/data/qtquickcontrols2-progressbar.qml new file mode 100644 index 00000000..13d5075d --- /dev/null +++ b/tests/manual/gifs/data/qtquickcontrols2-progressbar.qml @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** 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.7 +import QtQuick.Window 2.0 +import QtQuick.Controls 2.0 + +Window { + width: progressBar.implicitWidth + height: 64 + visible: true + + property alias progressBar: progressBar + + ProgressBar { + id: progressBar + value: 0.5 + anchors.centerIn: parent + + Timer { + running: true + interval: 500 + onTriggered: animation.start() + } + + NumberAnimation { + id: animation + target: progressBar + property: "value" + to: 1 + duration: 2000 + } + } +} diff --git a/tests/manual/gifs/tst_gifs.cpp b/tests/manual/gifs/tst_gifs.cpp index e6fa9d61..a788ff0a 100644 --- a/tests/manual/gifs/tst_gifs.cpp +++ b/tests/manual/gifs/tst_gifs.cpp @@ -68,6 +68,8 @@ private slots: void checkBox(); void checkBoxTriState(); void scrollBar(); + void progressBar_data(); + void progressBar(); private: void moveSmoothly(QQuickWindow *window, const QPoint &from, const QPoint &to, int movements, @@ -699,6 +701,29 @@ void tst_Gifs::scrollBar() gifRecorder.waitForFinish(); } +void tst_Gifs::progressBar_data() +{ + QTest::addColumn<bool>("indeterminate"); + + QTest::newRow("indeterminate:false") << false; + QTest::newRow("indeterminate:true") << true; +} + +void tst_Gifs::progressBar() +{ + QFETCH(bool, indeterminate); + + GifRecorder gifRecorder; + gifRecorder.setDataDirPath(dataDirPath); + gifRecorder.setOutputDir(outputDir); + gifRecorder.setRecordingDuration(4); + gifRecorder.setQmlFileName(QString::fromLatin1("qtquickcontrols2-progressbar%1").arg( + indeterminate ? QLatin1String("-indeterminate.qml") : QLatin1String(".qml"))); + + gifRecorder.start(); + gifRecorder.waitForFinish(); +} + QTEST_MAIN(tst_Gifs) #include "tst_gifs.moc" |