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 | |
parent | 88969bdbd66b0829fe5e5b90eeb605c663d1b887 (diff) |
ProgressBar: replace PNGs with GIFs
Change-Id: I8d11eae7e853b0aa8175e4cffd3520777713d50b
Task-number: QTBUG-55904
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
-rw-r--r-- | src/imports/controls/doc/images/qtquickcontrols2-progressbar-disabled.png | bin | 133 -> 0 bytes | |||
-rw-r--r-- | src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.gif | bin | 0 -> 5882 bytes | |||
-rw-r--r-- | src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.png | bin | 229 -> 0 bytes | |||
-rw-r--r-- | src/imports/controls/doc/images/qtquickcontrols2-progressbar-normal.png | bin | 133 -> 0 bytes | |||
-rw-r--r-- | src/imports/controls/doc/images/qtquickcontrols2-progressbar.gif | bin | 0 -> 2072 bytes | |||
-rw-r--r-- | src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-disabled.qml | 34 | ||||
-rw-r--r-- | src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-normal.qml | 33 | ||||
-rw-r--r-- | src/quicktemplates2/qquickprogressbar.cpp | 12 | ||||
-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 |
11 files changed, 156 insertions, 76 deletions
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-progressbar-disabled.png b/src/imports/controls/doc/images/qtquickcontrols2-progressbar-disabled.png Binary files differdeleted file mode 100644 index 9ce19e92..00000000 --- a/src/imports/controls/doc/images/qtquickcontrols2-progressbar-disabled.png +++ /dev/null diff --git a/src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.gif b/src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.gif Binary files differnew file mode 100644 index 00000000..d6756d16 --- /dev/null +++ b/src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.gif diff --git a/src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.png b/src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.png Binary files differdeleted file mode 100644 index ec2e9ae9..00000000 --- a/src/imports/controls/doc/images/qtquickcontrols2-progressbar-indeterminate.png +++ /dev/null diff --git a/src/imports/controls/doc/images/qtquickcontrols2-progressbar-normal.png b/src/imports/controls/doc/images/qtquickcontrols2-progressbar-normal.png Binary files differdeleted file mode 100644 index 9ce19e92..00000000 --- a/src/imports/controls/doc/images/qtquickcontrols2-progressbar-normal.png +++ /dev/null diff --git a/src/imports/controls/doc/images/qtquickcontrols2-progressbar.gif b/src/imports/controls/doc/images/qtquickcontrols2-progressbar.gif Binary files differnew file mode 100644 index 00000000..49af5f45 --- /dev/null +++ b/src/imports/controls/doc/images/qtquickcontrols2-progressbar.gif diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-disabled.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-disabled.qml deleted file mode 100644 index 81c9f4ac..00000000 --- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-disabled.qml +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Controls 2.0 - -ProgressBar { - value: 0.5 - enabled: false -} diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-normal.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-normal.qml deleted file mode 100644 index a332d4c5..00000000 --- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-normal.qml +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** 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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Controls 2.0 - -ProgressBar { - value: 0.5 -} diff --git a/src/quicktemplates2/qquickprogressbar.cpp b/src/quicktemplates2/qquickprogressbar.cpp index 9c091ba1..00ecc5c5 100644 --- a/src/quicktemplates2/qquickprogressbar.cpp +++ b/src/quicktemplates2/qquickprogressbar.cpp @@ -48,16 +48,11 @@ QT_BEGIN_NAMESPACE \ingroup qtquickcontrols2-indicators \brief Indicates the progress of an operation. + \image qtquickcontrols2-progressbar.gif + ProgressBar indicates the progress of an operation. The value should be updated regularly. The range is defined by \l from and \l to, which both can contain any value. - \table - \row \li \image qtquickcontrols2-progressbar-normal.png - \li A progress bar in its normal state. - \row \li \image qtquickcontrols2-progressbar-disabled.png - \li A progress bar that is disabled. - \endtable - \code ProgressBar { value: 0.5 @@ -214,8 +209,7 @@ qreal QQuickProgressBar::visualPosition() const A progress bar in indeterminate mode displays that an operation is in progress, but it doesn't show how much progress has been made. - See below for an example: - \image qtquickcontrols2-progressbar-indeterminate.png + \image qtquickcontrols2-progressbar-indeterminate.gif */ bool QQuickProgressBar::isIndeterminate() const 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" |