aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/gifs
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-10-03 11:20:14 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-10-03 13:31:32 +0000
commitb13bafec9ca34aa12b4ba9fbc6bf0165957f9b37 (patch)
tree8a16936c25ee40baea19146da2ec9e04b6cdeda2 /tests/manual/gifs
parent8aaa72c1035940eb290de9ba16513b2dafe5248c (diff)
parentb6cfb4a1e30598a6176f9bbfdbd1495b37c7f59a (diff)
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts: examples/quickcontrols2/gallery/gallery.qrc src/imports/calendar/doc/snippets/qtlabscalendar-calendarmodel.qml src/imports/calendar/doc/snippets/qtlabscalendar-dayofweekrow-layout.qml src/imports/calendar/doc/snippets/qtlabscalendar-dayofweekrow.qml src/imports/calendar/doc/snippets/qtlabscalendar-monthgrid-layout.qml src/imports/calendar/doc/snippets/qtlabscalendar-monthgrid.qml src/imports/calendar/doc/snippets/qtlabscalendar-weeknumbercolumn-layout.qml src/imports/calendar/doc/snippets/qtlabscalendar-weeknumbercolumn.qml src/imports/controls/doc/qtquickcontrols2.qdocconf src/imports/controls/doc/snippets/qtlabscalendar-calendarmodel.qml src/imports/controls/doc/snippets/qtlabscalendar-dayofweekrow-layout.qml src/imports/controls/doc/snippets/qtlabscalendar-dayofweekrow.qml src/imports/controls/doc/snippets/qtlabscalendar-monthgrid-layout.qml src/imports/controls/doc/snippets/qtlabscalendar-monthgrid.qml src/imports/controls/doc/snippets/qtlabscalendar-weeknumbercolumn-layout.qml src/imports/controls/doc/snippets/qtlabscalendar-weeknumbercolumn.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-calendarmodel.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-dayofweekrow-layout.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-dayofweekrow.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-monthgrid-layout.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-monthgrid.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-weeknumbercolumn-layout.qml src/imports/controls/doc/snippets/screenshots/qtlabscalendar-weeknumbercolumn.qml src/imports/controls/qtquickcontrols2plugin.cpp src/quicktemplates2/qquicktooltip.cpp src/quicktemplates2/qquicktooltip_p.h src/quicktemplates2/qquicktumbler.cpp tests/auto/controls/data/tst_spinbox.qml tests/auto/controls/data/tst_tumbler.qml tests/auto/qquickmaterialstyle/data/tst_material.qml Change-Id: I25b7473b47739043b6f768603bece30b18021318
Diffstat (limited to 'tests/manual/gifs')
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-button-flat.qml56
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-button-highlighted.qml56
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-button.qml2
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-checkbox-tristate.qml77
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-checkbox.qml72
-rw-r--r--tests/manual/gifs/tst_gifs.cpp72
6 files changed, 332 insertions, 3 deletions
diff --git a/tests/manual/gifs/data/qtquickcontrols2-button-flat.qml b/tests/manual/gifs/data/qtquickcontrols2-button-flat.qml
new file mode 100644
index 00000000..e20e3bc2
--- /dev/null
+++ b/tests/manual/gifs/data/qtquickcontrols2-button-flat.qml
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** 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: button.width
+ height: button.height
+ visible: true
+
+ Button {
+ id: button
+ text: pressed ? "Pressed" : "Button"
+ flat: true
+ anchors.centerIn: parent
+ }
+}
diff --git a/tests/manual/gifs/data/qtquickcontrols2-button-highlighted.qml b/tests/manual/gifs/data/qtquickcontrols2-button-highlighted.qml
new file mode 100644
index 00000000..b031c731
--- /dev/null
+++ b/tests/manual/gifs/data/qtquickcontrols2-button-highlighted.qml
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** 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: button.width
+ height: button.height
+ visible: true
+
+ Button {
+ id: button
+ text: pressed ? "Pressed" : "Button"
+ highlighted: true
+ anchors.centerIn: parent
+ }
+}
diff --git a/tests/manual/gifs/data/qtquickcontrols2-button.qml b/tests/manual/gifs/data/qtquickcontrols2-button.qml
index 6cbcc42a..65262589 100644
--- a/tests/manual/gifs/data/qtquickcontrols2-button.qml
+++ b/tests/manual/gifs/data/qtquickcontrols2-button.qml
@@ -49,7 +49,7 @@ Window {
Button {
id: button
- text: pressed ? "Pressed" : "Normal"
+ text: pressed ? "Pressed" : "Button"
anchors.centerIn: parent
}
}
diff --git a/tests/manual/gifs/data/qtquickcontrols2-checkbox-tristate.qml b/tests/manual/gifs/data/qtquickcontrols2-checkbox-tristate.qml
new file mode 100644
index 00000000..ef7e18d4
--- /dev/null
+++ b/tests/manual/gifs/data/qtquickcontrols2-checkbox-tristate.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** 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.Controls 2.0
+import QtQuick.Layouts 1.1
+import QtQuick.Window 2.0
+
+Window {
+ width: column.implicitWidth
+ height: column.implicitHeight
+ visible: true
+
+ property alias english: english
+ property alias norwegian: norwegian
+
+ ColumnLayout {
+ id: column
+ anchors.centerIn: parent
+
+ CheckBox {
+ text: qsTr("Languages")
+ checkState: english.checked && norwegian.checked
+ ? Qt.Checked : (english.checked || norwegian.checked) ? Qt.PartiallyChecked : Qt.Unchecked
+ tristate: true
+ }
+ CheckBox {
+ id: english
+ text: qsTr("English")
+ checked: true
+ leftPadding: indicator.width
+ }
+ CheckBox {
+ id: norwegian
+ text: qsTr("Norwegian")
+ checked: true
+ leftPadding: indicator.width
+ }
+ }
+}
diff --git a/tests/manual/gifs/data/qtquickcontrols2-checkbox.qml b/tests/manual/gifs/data/qtquickcontrols2-checkbox.qml
new file mode 100644
index 00000000..ef53721d
--- /dev/null
+++ b/tests/manual/gifs/data/qtquickcontrols2-checkbox.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** 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.Controls 2.0
+import QtQuick.Layouts 1.1
+import QtQuick.Window 2.0
+
+Window {
+ width: column.implicitWidth
+ height: column.implicitHeight
+ visible: true
+
+ property alias second: second
+ property alias third: third
+
+ ColumnLayout {
+ id: column
+ anchors.centerIn: parent
+
+ CheckBox {
+ checked: true
+ text: qsTr("First")
+ }
+ CheckBox {
+ id: second
+ text: qsTr("Second")
+ }
+ CheckBox {
+ id: third
+ checked: true
+ text: qsTr("Third")
+ }
+ }
+}
diff --git a/tests/manual/gifs/tst_gifs.cpp b/tests/manual/gifs/tst_gifs.cpp
index 919ba104..2eebc180 100644
--- a/tests/manual/gifs/tst_gifs.cpp
+++ b/tests/manual/gifs/tst_gifs.cpp
@@ -54,6 +54,7 @@ private slots:
void rangeSlider();
void busyIndicator();
void switchGif();
+ void button_data();
void button();
void tabBar();
void menu();
@@ -64,6 +65,8 @@ private slots:
void delegates();
void dial_data();
void dial();
+ void checkBox();
+ void checkBoxTriState();
private:
void moveSmoothly(QQuickWindow *window, const QPoint &from, const QPoint &to, int movements,
@@ -328,14 +331,23 @@ void tst_Gifs::switchGif()
gifRecorder.waitForFinish();
}
+void tst_Gifs::button_data()
+{
+ QTest::addColumn<QString>("qmlFileName");
+ QTest::newRow("button") << QString::fromLatin1("qtquickcontrols2-button.qml");
+ QTest::newRow("button-flat") << QString::fromLatin1("qtquickcontrols2-button-flat.qml");
+ QTest::newRow("button-highlighted") << QString::fromLatin1("qtquickcontrols2-button-highlighted.qml");
+}
+
void tst_Gifs::button()
{
+ QFETCH(QString, qmlFileName);
+
GifRecorder gifRecorder;
gifRecorder.setDataDirPath(dataDirPath);
gifRecorder.setOutputDir(outputDir);
gifRecorder.setRecordingDuration(3);
- gifRecorder.setQmlFileName("qtquickcontrols2-button.qml");
- gifRecorder.setHighQuality(true);
+ gifRecorder.setQmlFileName(qmlFileName);
gifRecorder.start();
@@ -600,6 +612,62 @@ void tst_Gifs::dial()
gifRecorder.waitForFinish();
}
+void tst_Gifs::checkBox()
+{
+ GifRecorder gifRecorder;
+ gifRecorder.setDataDirPath(dataDirPath);
+ gifRecorder.setOutputDir(outputDir);
+ gifRecorder.setRecordingDuration(5);
+ gifRecorder.setQmlFileName("qtquickcontrols2-checkbox.qml");
+
+ gifRecorder.start();
+
+ QQuickWindow *window = gifRecorder.window();
+ QQuickItem *second = window->property("second").value<QQuickItem*>();
+ QVERIFY(second);
+ QQuickItem *third = window->property("third").value<QQuickItem*>();
+ QVERIFY(third);
+
+ QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
+ second->mapToScene(QPointF(second->width() / 2, second->height() / 2)).toPoint(), 400);
+ QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
+ third->mapToScene(QPointF(third->width() / 2, third->height() / 2)).toPoint(), 800);
+ QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
+ third->mapToScene(QPointF(third->width() / 2, third->height() / 2)).toPoint(), 800);
+ QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
+ second->mapToScene(QPointF(second->width() / 2, second->height() / 2)).toPoint(), 800);
+
+ gifRecorder.waitForFinish();
+}
+
+void tst_Gifs::checkBoxTriState()
+{
+ GifRecorder gifRecorder;
+ gifRecorder.setDataDirPath(dataDirPath);
+ gifRecorder.setOutputDir(outputDir);
+ gifRecorder.setRecordingDuration(6);
+ gifRecorder.setQmlFileName("qtquickcontrols2-checkbox-tristate.qml");
+
+ gifRecorder.start();
+
+ QQuickWindow *window = gifRecorder.window();
+ QQuickItem *english = window->property("english").value<QQuickItem*>();
+ QVERIFY(english);
+ QQuickItem *norwegian = window->property("norwegian").value<QQuickItem*>();
+ QVERIFY(norwegian);
+
+ QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
+ english->mapToScene(QPointF(english->width() / 2, english->height() / 2)).toPoint(), 1000);
+ QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
+ norwegian->mapToScene(QPointF(norwegian->width() / 2, norwegian->height() / 2)).toPoint(), 1000);
+ QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
+ norwegian->mapToScene(QPointF(norwegian->width() / 2, norwegian->height() / 2)).toPoint(), 1000);
+ QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier,
+ english->mapToScene(QPointF(english->width() / 2, english->height() / 2)).toPoint(), 1000);
+
+ gifRecorder.waitForFinish();
+}
+
QTEST_MAIN(tst_Gifs)
#include "tst_gifs.moc"