From b31b4094e1728d839fef30f5128c81451ea75e4a Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 21 Oct 2016 22:10:39 +0200 Subject: QQuickPopup: use QShortcutMap to grab Back & Escape keys This makes CloseOnEscape play well together with QML Shortcut, as illustrated by the Gallery example. For example, navigate to any control page, open the options menu, and hit escape twice. First, the options menu closes, and then the stackview navigates back. Another nice example is to open the style combobox in the settings dialog, while being navigated to one of the control pages, and hit escape three times. First, the combobox closes, then the settings dialog closes, and finally, the stackview navigates back. NOTE: tst_combobox had to be updated, because it was assuming that the popup is closed when escape is released. Now that the system is based on shortcut overrides, it gets closed on press instead. Task-number: QTBUG-56562 Change-Id: I8b8901bcba7deebd82b181af42f335d95a7cb469 Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_combobox.qml | 1 - 1 file changed, 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index 97ba7ea4..7d7e519f 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -467,7 +467,6 @@ TestCase { // hide popup keyPress(data.key2) compare(control.pressed, data.hidePress) - compare(control.popup.visible, data.showPopup) keyRelease(data.key2) compare(control.pressed, false) tryCompare(control.popup, "visible", !data.hidePopup) -- cgit v1.2.3 From 6f10ef6e167f4af68439f473842da3b5ea87e4a4 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 1 Nov 2016 14:40:50 +0100 Subject: Doc: add GIF animation for Drawer Change-Id: Ib4c8b5f80e63a322c20caa837632739a3bfee3ee Task-number: QTBUG-55904 Reviewed-by: Mitch Curtis --- tests/manual/gifs/data/qtquickcontrols2-drawer.qml | 89 ++++++++++++++++++++++ tests/manual/gifs/tst_gifs.cpp | 26 +++++++ 2 files changed, 115 insertions(+) create mode 100644 tests/manual/gifs/data/qtquickcontrols2-drawer.qml (limited to 'tests') diff --git a/tests/manual/gifs/data/qtquickcontrols2-drawer.qml b/tests/manual/gifs/data/qtquickcontrols2-drawer.qml new file mode 100644 index 00000000..49f2cf50 --- /dev/null +++ b/tests/manual/gifs/data/qtquickcontrols2-drawer.qml @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** 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.Window 2.0 + +ApplicationWindow { + id: window + width: 300 + height: 300 + visible: true + + property alias drawer: drawer + + Drawer { + id: drawer + width: window.width * 0.66 + height: window.height + rightPadding: 0 + + Rectangle { + border.width: 1 + anchors.fill: parent + + Label { + text: "Drawer" + font.pixelSize: 32 + anchors.centerIn: parent + } + } + } + + Rectangle { + border.width: 1 + anchors.fill: parent + + Label { + text: "Content" + font.pixelSize: 32 + anchors.centerIn: parent + } + } + + Rectangle { + z: 1 + color: "black" + width: 1 + height: parent.height + parent: window.overlay + } +} diff --git a/tests/manual/gifs/tst_gifs.cpp b/tests/manual/gifs/tst_gifs.cpp index be436b52..c27c522b 100644 --- a/tests/manual/gifs/tst_gifs.cpp +++ b/tests/manual/gifs/tst_gifs.cpp @@ -78,6 +78,7 @@ private slots: void comboBox(); void stackView_data(); void stackView(); + void drawer(); private: void moveSmoothly(QQuickWindow *window, const QPoint &from, const QPoint &to, int movements, @@ -911,6 +912,31 @@ void tst_Gifs::stackView() gifRecorder.waitForFinish(); } +void tst_Gifs::drawer() +{ + GifRecorder gifRecorder; + gifRecorder.setDataDirPath(dataDirPath); + gifRecorder.setOutputDir(outputDir); + gifRecorder.setRecordingDuration(4); + gifRecorder.setHighQuality(true); + gifRecorder.setQmlFileName("qtquickcontrols2-drawer.qml"); + + gifRecorder.start(); + + QQuickWindow *window = gifRecorder.window(); + QObject *drawer = window->property("drawer").value(); + qreal width = drawer->property("width").toReal(); + + QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, QPoint(1, 1), 100); + moveSmoothly(window, QPoint(1, 1), QPoint(width, 1), width, QEasingCurve::InOutBack, 1); + QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, QPoint(width, 1), 30); + + QTest::qWait(1000); + QMetaObject::invokeMethod(drawer, "close"); + + gifRecorder.waitForFinish(); +} + QTEST_MAIN(tst_Gifs) #include "tst_gifs.moc" -- cgit v1.2.3 From c7fdb444a4a9f3cbcf4bbfe8d0deaeb7388e7f98 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 1 Nov 2016 15:53:52 +0100 Subject: Doc: add GIF to SwipeView detailed description The wireframe is still used on the "Navigation Controls" page. Change-Id: I8e8c2bf0f5d46179c115d548efda2ea114a4431e Task-number: QTBUG-55904 Reviewed-by: Mitch Curtis --- .../gifs/data/qtquickcontrols2-swipeview.qml | 89 ++++++++++++++++++++++ tests/manual/gifs/tst_gifs.cpp | 26 +++++++ 2 files changed, 115 insertions(+) create mode 100644 tests/manual/gifs/data/qtquickcontrols2-swipeview.qml (limited to 'tests') diff --git a/tests/manual/gifs/data/qtquickcontrols2-swipeview.qml b/tests/manual/gifs/data/qtquickcontrols2-swipeview.qml new file mode 100644 index 00000000..d721591a --- /dev/null +++ b/tests/manual/gifs/data/qtquickcontrols2-swipeview.qml @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** 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: 300 + height: 300 + visible: true + + property alias swipeView: view + + Rectangle { + border.width: 1 + anchors.fill: parent + } + + SwipeView { + id: view + anchors.fill: parent + + Label { + text: "First\nPage" + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + } + + Label { + text: "Second\nPage" + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + } + + Label { + text: "Third\nPage" + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter + } + } + + PageIndicator { + id: indicator + + count: view.count + currentIndex: view.currentIndex + + anchors.bottom: view.bottom + anchors.horizontalCenter: parent.horizontalCenter + } +} diff --git a/tests/manual/gifs/tst_gifs.cpp b/tests/manual/gifs/tst_gifs.cpp index c27c522b..5cb1f109 100644 --- a/tests/manual/gifs/tst_gifs.cpp +++ b/tests/manual/gifs/tst_gifs.cpp @@ -60,6 +60,7 @@ private slots: void button(); void tabBar(); void menu(); + void swipeView(); void swipeDelegate_data(); void swipeDelegate(); void swipeDelegateBehind(); @@ -481,6 +482,31 @@ void tst_Gifs::menu() gifRecorder.waitForFinish(); } +void tst_Gifs::swipeView() +{ + GifRecorder gifRecorder; + gifRecorder.setDataDirPath(dataDirPath); + gifRecorder.setOutputDir(outputDir); + gifRecorder.setRecordingDuration(8); + gifRecorder.setQmlFileName(QStringLiteral("qtquickcontrols2-swipeview.qml")); + gifRecorder.setHighQuality(true); + + gifRecorder.start(); + + QQuickWindow *window = gifRecorder.window(); + QQuickItem *swipeView = window->property("swipeView").value(); + QVERIFY(swipeView); + + QTest::qWait(1200); + swipeView->setProperty("currentIndex", 1); + QTest::qWait(2000); + swipeView->setProperty("currentIndex", 2); + QTest::qWait(2000); + swipeView->setProperty("currentIndex", 0); + + gifRecorder.waitForFinish(); +} + void tst_Gifs::swipeDelegate_data() { QTest::addColumn("qmlFileName"); -- cgit v1.2.3 From a706965798e5485550c2781854bf0d2d8fda2379 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 1 Nov 2016 20:14:28 +0100 Subject: ComboBox: fix accessibility support Change-Id: Icd196b3cd66b5b31a664c845e78953b4606022b7 Reviewed-by: Liang Qi --- tests/auto/accessibility/data/combobox.qml | 13 +++++++++++++ tests/auto/accessibility/tst_accessibility.cpp | 1 + 2 files changed, 14 insertions(+) create mode 100644 tests/auto/accessibility/data/combobox.qml (limited to 'tests') diff --git a/tests/auto/accessibility/data/combobox.qml b/tests/auto/accessibility/data/combobox.qml new file mode 100644 index 00000000..3bf972e9 --- /dev/null +++ b/tests/auto/accessibility/data/combobox.qml @@ -0,0 +1,13 @@ +import QtQuick 2.5 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.0 + +Window { + visible: true + + ComboBox { + id: button + objectName: "combobox" + model: ["ComboBox"] + } +} diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index e97e4702..ad6c06ca 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -73,6 +73,7 @@ void tst_accessibility::a11y_data() QTest::newRow("BusyIndicator") << "busyindicator" << 0x00000027 << ""; //QAccessible::Indicator QTest::newRow("Button") << "button" << 0x0000002B << "Button"; //QAccessible::Button QTest::newRow("CheckBox") << "checkbox" << 0x0000002C << "CheckBox"; //QAccessible::CheckBox + QTest::newRow("ComboBox") << "combobox" << 0x0000002E << "ComboBox"; //QAccessible::ComboBox // Frame // GroupBox QTest::newRow("Label") << "label" << 0x00000029 << "Label"; //QAccessible::StaticText -- cgit v1.2.3 From 244e423d6b58438a2b7f653827412815a335c276 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 1 Nov 2016 21:08:41 +0100 Subject: Page: fix accessibility support Change-Id: If7d15d914e35a675dcd456a4aa561a3280c2308a Reviewed-by: Liang Qi --- tests/auto/accessibility/data/page.qml | 13 +++++++++++++ tests/auto/accessibility/tst_accessibility.cpp | 1 + 2 files changed, 14 insertions(+) create mode 100644 tests/auto/accessibility/data/page.qml (limited to 'tests') diff --git a/tests/auto/accessibility/data/page.qml b/tests/auto/accessibility/data/page.qml new file mode 100644 index 00000000..c4058b29 --- /dev/null +++ b/tests/auto/accessibility/data/page.qml @@ -0,0 +1,13 @@ +import QtQuick 2.5 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.0 + +Window { + visible: true + + Page { + id: page + objectName: "page" + title: "Page" + } +} diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index ad6c06ca..e486e6f9 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -78,6 +78,7 @@ void tst_accessibility::a11y_data() // GroupBox QTest::newRow("Label") << "label" << 0x00000029 << "Label"; //QAccessible::StaticText QTest::newRow("Menu") << "menu" << 0x0000000B << ""; //QAccessible::PopupMenu + QTest::newRow("Page") << "page" << 0x00000025 << "Page"; //QAccessible::PageTab QTest::newRow("PageIndicator") << "pageindicator" << 0x00000027 << ""; //QAccessible::Indicator QTest::newRow("Popup") << "popup" << 0x00000080 << ""; //QAccessible::LayeredPane QTest::newRow("ProgressBar") << "progressbar" << 0x00000030 << ""; //QAccessible::ProgressBar -- cgit v1.2.3 From a115ec5d1b8598191003fd1fff6f8e43fe9e042f Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 1 Nov 2016 21:02:02 +0100 Subject: GroupBox: fix accessibility support Change-Id: Ifbbc701a996ed9ddb13f7d16843d0af5ee480ca1 Reviewed-by: Mitch Curtis --- tests/auto/accessibility/data/groupbox.qml | 13 +++++++++++++ tests/auto/accessibility/tst_accessibility.cpp | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 tests/auto/accessibility/data/groupbox.qml (limited to 'tests') diff --git a/tests/auto/accessibility/data/groupbox.qml b/tests/auto/accessibility/data/groupbox.qml new file mode 100644 index 00000000..e454cbfd --- /dev/null +++ b/tests/auto/accessibility/data/groupbox.qml @@ -0,0 +1,13 @@ +import QtQuick 2.5 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.0 + +Window { + visible: true + + GroupBox { + id: groupbox + objectName: "groupbox" + title: "GroupBox" + } +} diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index e486e6f9..80f0a5b0 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -75,7 +75,7 @@ void tst_accessibility::a11y_data() QTest::newRow("CheckBox") << "checkbox" << 0x0000002C << "CheckBox"; //QAccessible::CheckBox QTest::newRow("ComboBox") << "combobox" << 0x0000002E << "ComboBox"; //QAccessible::ComboBox // Frame - // GroupBox + QTest::newRow("GroupBox") << "groupbox" << 0x00000014 << "GroupBox"; //QAccessible::Grouping QTest::newRow("Label") << "label" << 0x00000029 << "Label"; //QAccessible::StaticText QTest::newRow("Menu") << "menu" << 0x0000000B << ""; //QAccessible::PopupMenu QTest::newRow("Page") << "page" << 0x00000025 << "Page"; //QAccessible::PageTab -- cgit v1.2.3 From c0b1a37f96b5faa4bea1d860489b0990750682d5 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 1 Nov 2016 20:14:28 +0100 Subject: tst_accessibility: add some missing controls Change-Id: Ice26b851009c1e0e457976d85c918d31dcf96dc5 Reviewed-by: Liang Qi --- tests/auto/accessibility/data/checkdelegate.qml | 13 +++++++++++++ tests/auto/accessibility/data/itemdelegate.qml | 13 +++++++++++++ tests/auto/accessibility/data/menuitem.qml | 13 +++++++++++++ tests/auto/accessibility/data/pane.qml | 12 ++++++++++++ tests/auto/accessibility/data/switchdelegate.qml | 13 +++++++++++++ tests/auto/accessibility/tst_accessibility.cpp | 6 ++++++ 6 files changed, 70 insertions(+) create mode 100644 tests/auto/accessibility/data/checkdelegate.qml create mode 100644 tests/auto/accessibility/data/itemdelegate.qml create mode 100644 tests/auto/accessibility/data/menuitem.qml create mode 100644 tests/auto/accessibility/data/pane.qml create mode 100644 tests/auto/accessibility/data/switchdelegate.qml (limited to 'tests') diff --git a/tests/auto/accessibility/data/checkdelegate.qml b/tests/auto/accessibility/data/checkdelegate.qml new file mode 100644 index 00000000..d7f786da --- /dev/null +++ b/tests/auto/accessibility/data/checkdelegate.qml @@ -0,0 +1,13 @@ +import QtQuick 2.5 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.0 + +Window { + visible: true + + CheckDelegate { + id: checkdelegate + objectName: "checkdelegate" + text: "CheckDelegate" + } +} diff --git a/tests/auto/accessibility/data/itemdelegate.qml b/tests/auto/accessibility/data/itemdelegate.qml new file mode 100644 index 00000000..10880c28 --- /dev/null +++ b/tests/auto/accessibility/data/itemdelegate.qml @@ -0,0 +1,13 @@ +import QtQuick 2.5 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.0 + +Window { + visible: true + + ItemDelegate { + id: itemdelegate + objectName: "itemdelegate" + text: "ItemDelegate" + } +} diff --git a/tests/auto/accessibility/data/menuitem.qml b/tests/auto/accessibility/data/menuitem.qml new file mode 100644 index 00000000..9f7c2a85 --- /dev/null +++ b/tests/auto/accessibility/data/menuitem.qml @@ -0,0 +1,13 @@ +import QtQuick 2.5 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.0 + +Window { + visible: true + + MenuItem { + id: menuitem + objectName: "menuitem" + text: "MenuItem" + } +} diff --git a/tests/auto/accessibility/data/pane.qml b/tests/auto/accessibility/data/pane.qml new file mode 100644 index 00000000..9b99d790 --- /dev/null +++ b/tests/auto/accessibility/data/pane.qml @@ -0,0 +1,12 @@ +import QtQuick 2.5 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.0 + +Window { + visible: true + + Pane { + id: pane + objectName: "pane" + } +} diff --git a/tests/auto/accessibility/data/switchdelegate.qml b/tests/auto/accessibility/data/switchdelegate.qml new file mode 100644 index 00000000..ae9b95f1 --- /dev/null +++ b/tests/auto/accessibility/data/switchdelegate.qml @@ -0,0 +1,13 @@ +import QtQuick 2.5 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.0 + +Window { + visible: true + + SwitchDelegate { + id: switchdelegate + objectName: "switchdelegate" + text: "SwitchDelegate" + } +} diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index 80f0a5b0..527fc678 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -73,13 +73,17 @@ void tst_accessibility::a11y_data() QTest::newRow("BusyIndicator") << "busyindicator" << 0x00000027 << ""; //QAccessible::Indicator QTest::newRow("Button") << "button" << 0x0000002B << "Button"; //QAccessible::Button QTest::newRow("CheckBox") << "checkbox" << 0x0000002C << "CheckBox"; //QAccessible::CheckBox + QTest::newRow("CheckDelegate") << "checkdelegate" << 0x0000002C << "CheckDelegate"; //QAccessible::CheckBox QTest::newRow("ComboBox") << "combobox" << 0x0000002E << "ComboBox"; //QAccessible::ComboBox // Frame QTest::newRow("GroupBox") << "groupbox" << 0x00000014 << "GroupBox"; //QAccessible::Grouping + QTest::newRow("ItemDelegate") << "itemdelegate" << 0x00000022 << "ItemDelegate"; //QAccessible::ListItem QTest::newRow("Label") << "label" << 0x00000029 << "Label"; //QAccessible::StaticText QTest::newRow("Menu") << "menu" << 0x0000000B << ""; //QAccessible::PopupMenu + QTest::newRow("MenuItem") << "menuitem" << 0x0000000C << "MenuItem"; //QAccessible::MenuItem QTest::newRow("Page") << "page" << 0x00000025 << "Page"; //QAccessible::PageTab QTest::newRow("PageIndicator") << "pageindicator" << 0x00000027 << ""; //QAccessible::Indicator + QTest::newRow("Pane") << "pane" << 0x00000010 << ""; //QAccessible::Pane QTest::newRow("Popup") << "popup" << 0x00000080 << ""; //QAccessible::LayeredPane QTest::newRow("ProgressBar") << "progressbar" << 0x00000030 << ""; //QAccessible::ProgressBar QTest::newRow("RadioButton") << "radiobutton" << 0x0000002D << "RadioButton"; //QAccessible::RadioButton @@ -90,12 +94,14 @@ void tst_accessibility::a11y_data() QTest::newRow("SpinBox") << "spinbox" << 0x00000034 << ""; //QAccessible::SpinBox // StackView QTest::newRow("Switch") << "switch" << 0x0000002B << "Switch"; //QAccessible::Button + QTest::newRow("SwitchDelegate") << "switchdelegate" << 0x00000022 << "SwitchDelegate"; //QAccessible::ListItem QTest::newRow("TabBar") << "tabbar" << 0x0000003C << ""; //QAccessible::PageTabList QTest::newRow("TabButton") << "tabbutton" << 0x00000025 << "TabButton"; //QAccessible::PageTab QTest::newRow("TextArea") << "textarea" << 0x0000002A << ""; //QAccessible::Accessible.EditableText QTest::newRow("TextField") << "textfield" << 0x0000002A << ""; //QAccessible::Accessible.EditableText QTest::newRow("ToolBar") << "toolbar" << 0x00000016 << ""; //QAccessible::ToolBar QTest::newRow("ToolButton") << "toolbutton" << 0x0000002B << "ToolButton"; //QAccessible::Button + // ToolTip QTest::newRow("Dial") << "dial" << 0x00000031 << ""; //QAccessible::Dial // Drawer -- cgit v1.2.3 From 31c51eb402c67c9a01b9f0cf108195db699e2a9c Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 1 Nov 2016 21:46:19 +0100 Subject: ToolTip: fix accessibility support Change-Id: I4623b1f1ee1e10c4233e89bf42e6720bbf3a5c73 Reviewed-by: Liang Qi Reviewed-by: Mitch Curtis --- tests/auto/accessibility/data/tooltip.qml | 13 +++++++++++++ tests/auto/accessibility/tst_accessibility.cpp | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 tests/auto/accessibility/data/tooltip.qml (limited to 'tests') diff --git a/tests/auto/accessibility/data/tooltip.qml b/tests/auto/accessibility/data/tooltip.qml new file mode 100644 index 00000000..4a2f16b5 --- /dev/null +++ b/tests/auto/accessibility/data/tooltip.qml @@ -0,0 +1,13 @@ +import QtQuick 2.5 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.0 + +Window { + visible: true + + ToolTip { + id: tooltip + objectName: "tooltip" + text: "ToolTip" + } +} diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index 527fc678..208f4ff7 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -101,7 +101,7 @@ void tst_accessibility::a11y_data() QTest::newRow("TextField") << "textfield" << 0x0000002A << ""; //QAccessible::Accessible.EditableText QTest::newRow("ToolBar") << "toolbar" << 0x00000016 << ""; //QAccessible::ToolBar QTest::newRow("ToolButton") << "toolbutton" << 0x0000002B << "ToolButton"; //QAccessible::Button - // ToolTip + QTest::newRow("ToolTip") << "tooltip" << 0x0000000D << "ToolTip"; //QAccessible::ToolTip QTest::newRow("Dial") << "dial" << 0x00000031 << ""; //QAccessible::Dial // Drawer -- cgit v1.2.3 From 189fe8349943a928dd0af50e90b8232a4bbe6acc Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 1 Nov 2016 21:05:32 +0100 Subject: Frame: fix accessibility support Change-Id: I79f06e3a60151ab4e35b6290fbfe022ed20665e3 Reviewed-by: Mitch Curtis --- tests/auto/accessibility/data/frame.qml | 12 ++++++++++++ tests/auto/accessibility/tst_accessibility.cpp | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 tests/auto/accessibility/data/frame.qml (limited to 'tests') diff --git a/tests/auto/accessibility/data/frame.qml b/tests/auto/accessibility/data/frame.qml new file mode 100644 index 00000000..8efe3079 --- /dev/null +++ b/tests/auto/accessibility/data/frame.qml @@ -0,0 +1,12 @@ +import QtQuick 2.5 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.0 + +Window { + visible: true + + Frame { + id: frame + objectName: "frame" + } +} diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index 208f4ff7..c1c9cb25 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -75,7 +75,7 @@ void tst_accessibility::a11y_data() QTest::newRow("CheckBox") << "checkbox" << 0x0000002C << "CheckBox"; //QAccessible::CheckBox QTest::newRow("CheckDelegate") << "checkdelegate" << 0x0000002C << "CheckDelegate"; //QAccessible::CheckBox QTest::newRow("ComboBox") << "combobox" << 0x0000002E << "ComboBox"; //QAccessible::ComboBox - // Frame + QTest::newRow("Frame") << "frame" << 0x00000013 << ""; //QAccessible::Border QTest::newRow("GroupBox") << "groupbox" << 0x00000014 << "GroupBox"; //QAccessible::Grouping QTest::newRow("ItemDelegate") << "itemdelegate" << 0x00000022 << "ItemDelegate"; //QAccessible::ListItem QTest::newRow("Label") << "label" << 0x00000029 << "Label"; //QAccessible::StaticText -- cgit v1.2.3 From 08325282ecf445267255abf1aa184a09795cedae Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 2 Nov 2016 08:21:37 +0100 Subject: Cleanup and speedup tst_accessibility Before: Totals: 37 passed, 0 failed, 0 skipped, 0 blacklisted, 6919ms After: Totals: 37 passed, 0 failed, 0 skipped, 0 blacklisted, 599ms Change-Id: I8376d74a265d30956cba1f2e290333a8efd70067 Reviewed-by: Mitch Curtis --- tests/auto/accessibility/data/busyindicator.qml | 10 +-------- tests/auto/accessibility/data/button.qml | 11 ++-------- tests/auto/accessibility/data/checkbox.qml | 11 ++-------- tests/auto/accessibility/data/checkdelegate.qml | 11 ++-------- tests/auto/accessibility/data/combobox.qml | 11 ++-------- tests/auto/accessibility/data/control.qml | 10 +-------- tests/auto/accessibility/data/dayofweekrow-2.qml | 10 +-------- tests/auto/accessibility/data/dayofweekrow.qml | 11 ++-------- tests/auto/accessibility/data/dial.qml | 10 +-------- tests/auto/accessibility/data/frame.qml | 10 +-------- tests/auto/accessibility/data/groupbox.qml | 11 ++-------- tests/auto/accessibility/data/itemdelegate.qml | 11 ++-------- tests/auto/accessibility/data/label.qml | 11 ++-------- tests/auto/accessibility/data/menu.qml | 10 +-------- tests/auto/accessibility/data/menuitem.qml | 11 ++-------- tests/auto/accessibility/data/monthgrid-2.qml | 11 ++-------- tests/auto/accessibility/data/monthgrid.qml | 13 +++-------- tests/auto/accessibility/data/page.qml | 11 ++-------- tests/auto/accessibility/data/pageindicator.qml | 10 +-------- tests/auto/accessibility/data/pane.qml | 10 +-------- tests/auto/accessibility/data/popup.qml | 10 +-------- tests/auto/accessibility/data/progressbar.qml | 15 ++++--------- tests/auto/accessibility/data/radiobutton.qml | 11 ++-------- tests/auto/accessibility/data/rangeslider.qml | 21 ++++++------------ tests/auto/accessibility/data/scrollbar.qml | 10 +-------- tests/auto/accessibility/data/scrollindicator.qml | 10 +-------- tests/auto/accessibility/data/slider.qml | 19 ++++++---------- tests/auto/accessibility/data/spinbox.qml | 17 +++++---------- tests/auto/accessibility/data/switch.qml | 11 ++-------- tests/auto/accessibility/data/switchdelegate.qml | 11 ++-------- tests/auto/accessibility/data/tabbar.qml | 10 +-------- tests/auto/accessibility/data/tabbutton.qml | 15 ++----------- tests/auto/accessibility/data/textarea.qml | 11 ++-------- tests/auto/accessibility/data/textfield.qml | 11 ++-------- tests/auto/accessibility/data/toolbar.qml | 10 +-------- tests/auto/accessibility/data/toolbutton.qml | 11 ++-------- tests/auto/accessibility/data/tooltip.qml | 11 ++-------- .../auto/accessibility/data/weeknumbercolumn-2.qml | 10 +-------- tests/auto/accessibility/data/weeknumbercolumn.qml | 11 ++-------- tests/auto/accessibility/tst_accessibility.cpp | 25 ++++++---------------- 40 files changed, 86 insertions(+), 388 deletions(-) (limited to 'tests') diff --git a/tests/auto/accessibility/data/busyindicator.qml b/tests/auto/accessibility/data/busyindicator.qml index 4bde9634..b15ea80a 100644 --- a/tests/auto/accessibility/data/busyindicator.qml +++ b/tests/auto/accessibility/data/busyindicator.qml @@ -1,12 +1,4 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - BusyIndicator { - id: busyindicator - objectName: "busyindicator" - } -} +BusyIndicator { } diff --git a/tests/auto/accessibility/data/button.qml b/tests/auto/accessibility/data/button.qml index 75925185..0fd14210 100644 --- a/tests/auto/accessibility/data/button.qml +++ b/tests/auto/accessibility/data/button.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - Button { - id: button - objectName: "button" - text: "Button" - } +Button { + text: "Button" } diff --git a/tests/auto/accessibility/data/checkbox.qml b/tests/auto/accessibility/data/checkbox.qml index 9700663d..e70d7d83 100644 --- a/tests/auto/accessibility/data/checkbox.qml +++ b/tests/auto/accessibility/data/checkbox.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - CheckBox { - id: checkbox - objectName: "checkbox" - text: "CheckBox" - } +CheckBox { + text: "CheckBox" } diff --git a/tests/auto/accessibility/data/checkdelegate.qml b/tests/auto/accessibility/data/checkdelegate.qml index d7f786da..0a1a4a4f 100644 --- a/tests/auto/accessibility/data/checkdelegate.qml +++ b/tests/auto/accessibility/data/checkdelegate.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - CheckDelegate { - id: checkdelegate - objectName: "checkdelegate" - text: "CheckDelegate" - } +CheckDelegate { + text: "CheckDelegate" } diff --git a/tests/auto/accessibility/data/combobox.qml b/tests/auto/accessibility/data/combobox.qml index 3bf972e9..42e4d47b 100644 --- a/tests/auto/accessibility/data/combobox.qml +++ b/tests/auto/accessibility/data/combobox.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - ComboBox { - id: button - objectName: "combobox" - model: ["ComboBox"] - } +ComboBox { + model: ["ComboBox"] } diff --git a/tests/auto/accessibility/data/control.qml b/tests/auto/accessibility/data/control.qml index ceaba509..4831a6c6 100644 --- a/tests/auto/accessibility/data/control.qml +++ b/tests/auto/accessibility/data/control.qml @@ -1,12 +1,4 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - Control { - id: control - objectName: "control" - } -} +Control { } diff --git a/tests/auto/accessibility/data/dayofweekrow-2.qml b/tests/auto/accessibility/data/dayofweekrow-2.qml index 26569836..265f975a 100644 --- a/tests/auto/accessibility/data/dayofweekrow-2.qml +++ b/tests/auto/accessibility/data/dayofweekrow-2.qml @@ -1,12 +1,4 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import Qt.labs.calendar 1.0 -Window { - visible: true - - DayOfWeekRow { - id: dayofweekrow - objectName: "dayofweekrow" - } -} +DayOfWeekRow { } diff --git a/tests/auto/accessibility/data/dayofweekrow.qml b/tests/auto/accessibility/data/dayofweekrow.qml index c799aba1..a3ab92dd 100644 --- a/tests/auto/accessibility/data/dayofweekrow.qml +++ b/tests/auto/accessibility/data/dayofweekrow.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import Qt.labs.calendar 1.0 -Window { - visible: true - - DayOfWeekRow { - id: dayofweekrow - objectName: "dayofweekrow" - Accessible.name: "DayOfWeekRow" - } +DayOfWeekRow { + Accessible.name: "DayOfWeekRow" } diff --git a/tests/auto/accessibility/data/dial.qml b/tests/auto/accessibility/data/dial.qml index 6b2333b1..39b85550 100644 --- a/tests/auto/accessibility/data/dial.qml +++ b/tests/auto/accessibility/data/dial.qml @@ -1,12 +1,4 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - Dial { - id: dial - objectName: "dial" - } -} +Dial { } diff --git a/tests/auto/accessibility/data/frame.qml b/tests/auto/accessibility/data/frame.qml index 8efe3079..6fcbab23 100644 --- a/tests/auto/accessibility/data/frame.qml +++ b/tests/auto/accessibility/data/frame.qml @@ -1,12 +1,4 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - Frame { - id: frame - objectName: "frame" - } -} +Frame { } diff --git a/tests/auto/accessibility/data/groupbox.qml b/tests/auto/accessibility/data/groupbox.qml index e454cbfd..c48b4847 100644 --- a/tests/auto/accessibility/data/groupbox.qml +++ b/tests/auto/accessibility/data/groupbox.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - GroupBox { - id: groupbox - objectName: "groupbox" - title: "GroupBox" - } +GroupBox { + title: "GroupBox" } diff --git a/tests/auto/accessibility/data/itemdelegate.qml b/tests/auto/accessibility/data/itemdelegate.qml index 10880c28..9b647315 100644 --- a/tests/auto/accessibility/data/itemdelegate.qml +++ b/tests/auto/accessibility/data/itemdelegate.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - ItemDelegate { - id: itemdelegate - objectName: "itemdelegate" - text: "ItemDelegate" - } +ItemDelegate { + text: "ItemDelegate" } diff --git a/tests/auto/accessibility/data/label.qml b/tests/auto/accessibility/data/label.qml index 409898d4..bb87a4e9 100644 --- a/tests/auto/accessibility/data/label.qml +++ b/tests/auto/accessibility/data/label.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - Label { - id: label - objectName: "label" - text: "Label" - } +Label { + text: "Label" } diff --git a/tests/auto/accessibility/data/menu.qml b/tests/auto/accessibility/data/menu.qml index bb777064..def3020b 100644 --- a/tests/auto/accessibility/data/menu.qml +++ b/tests/auto/accessibility/data/menu.qml @@ -1,12 +1,4 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - Menu { - id: menu - objectName: "menu" - } -} +Menu { } diff --git a/tests/auto/accessibility/data/menuitem.qml b/tests/auto/accessibility/data/menuitem.qml index 9f7c2a85..70c2ff33 100644 --- a/tests/auto/accessibility/data/menuitem.qml +++ b/tests/auto/accessibility/data/menuitem.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - MenuItem { - id: menuitem - objectName: "menuitem" - text: "MenuItem" - } +MenuItem { + text: "MenuItem" } diff --git a/tests/auto/accessibility/data/monthgrid-2.qml b/tests/auto/accessibility/data/monthgrid-2.qml index 76af6646..603a208b 100644 --- a/tests/auto/accessibility/data/monthgrid-2.qml +++ b/tests/auto/accessibility/data/monthgrid-2.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import Qt.labs.calendar 1.0 -Window { - visible: true - - MonthGrid { - id: monthgrid - objectName: "monthgrid" - title: "MonthGrid" - } +MonthGrid { + title: "MonthGrid" } diff --git a/tests/auto/accessibility/data/monthgrid.qml b/tests/auto/accessibility/data/monthgrid.qml index 7c8d6451..92a45f0f 100644 --- a/tests/auto/accessibility/data/monthgrid.qml +++ b/tests/auto/accessibility/data/monthgrid.qml @@ -1,14 +1,7 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import Qt.labs.calendar 1.0 -Window { - visible: true - - MonthGrid { - id: monthgrid - objectName: "monthgrid" - title: "MonthGrid" - Accessible.name: title - } +MonthGrid { + title: "MonthGrid" + Accessible.name: title } diff --git a/tests/auto/accessibility/data/page.qml b/tests/auto/accessibility/data/page.qml index c4058b29..59139855 100644 --- a/tests/auto/accessibility/data/page.qml +++ b/tests/auto/accessibility/data/page.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - Page { - id: page - objectName: "page" - title: "Page" - } +Page { + title: "Page" } diff --git a/tests/auto/accessibility/data/pageindicator.qml b/tests/auto/accessibility/data/pageindicator.qml index b42d3f9e..bb69a27a 100644 --- a/tests/auto/accessibility/data/pageindicator.qml +++ b/tests/auto/accessibility/data/pageindicator.qml @@ -1,12 +1,4 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - PageIndicator { - id: pageindicator - objectName: "pageindicator" - } -} +PageIndicator { } diff --git a/tests/auto/accessibility/data/pane.qml b/tests/auto/accessibility/data/pane.qml index 9b99d790..1de210ec 100644 --- a/tests/auto/accessibility/data/pane.qml +++ b/tests/auto/accessibility/data/pane.qml @@ -1,12 +1,4 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - Pane { - id: pane - objectName: "pane" - } -} +Pane { } diff --git a/tests/auto/accessibility/data/popup.qml b/tests/auto/accessibility/data/popup.qml index 70fe2e5f..05e968e5 100644 --- a/tests/auto/accessibility/data/popup.qml +++ b/tests/auto/accessibility/data/popup.qml @@ -1,12 +1,4 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - Popup { - id: popup - objectName: "popup" - } -} +Popup { } diff --git a/tests/auto/accessibility/data/progressbar.qml b/tests/auto/accessibility/data/progressbar.qml index 283db003..5e9b11f1 100644 --- a/tests/auto/accessibility/data/progressbar.qml +++ b/tests/auto/accessibility/data/progressbar.qml @@ -1,15 +1,8 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - ProgressBar { - id: progressbar - objectName: "progressbar" - from: 0 - to: 100 - value: 50 - } +ProgressBar { + from: 0 + to: 100 + value: 50 } diff --git a/tests/auto/accessibility/data/radiobutton.qml b/tests/auto/accessibility/data/radiobutton.qml index 1883fff8..58bdf225 100644 --- a/tests/auto/accessibility/data/radiobutton.qml +++ b/tests/auto/accessibility/data/radiobutton.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - RadioButton { - id: radiobutton - objectName: "radiobutton" - text: "RadioButton" - } +RadioButton { + text: "RadioButton" } diff --git a/tests/auto/accessibility/data/rangeslider.qml b/tests/auto/accessibility/data/rangeslider.qml index ce3dc872..45b1d4ae 100644 --- a/tests/auto/accessibility/data/rangeslider.qml +++ b/tests/auto/accessibility/data/rangeslider.qml @@ -1,18 +1,11 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - RangeSlider { - id: rangeSlider - objectName: "rangeslider" - from: 0 - to: 100 - first.value: 25 - second.value: 75 - stepSize: 1 - orientation: "Horizontal" - } +RangeSlider { + from: 0 + to: 100 + first.value: 25 + second.value: 75 + stepSize: 1 + orientation: Qt.Horizontal } diff --git a/tests/auto/accessibility/data/scrollbar.qml b/tests/auto/accessibility/data/scrollbar.qml index 2e360422..f0598b4b 100644 --- a/tests/auto/accessibility/data/scrollbar.qml +++ b/tests/auto/accessibility/data/scrollbar.qml @@ -1,12 +1,4 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - ScrollBar { - id: scrollbar - objectName: "scrollbar" - } -} +ScrollBar { } diff --git a/tests/auto/accessibility/data/scrollindicator.qml b/tests/auto/accessibility/data/scrollindicator.qml index e933dece..4cb81c4e 100644 --- a/tests/auto/accessibility/data/scrollindicator.qml +++ b/tests/auto/accessibility/data/scrollindicator.qml @@ -1,12 +1,4 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - ScrollIndicator { - id: scrollindicator - objectName: "scrollindicator" - } -} +ScrollIndicator { } diff --git a/tests/auto/accessibility/data/slider.qml b/tests/auto/accessibility/data/slider.qml index 060bb66c..775ce7d0 100644 --- a/tests/auto/accessibility/data/slider.qml +++ b/tests/auto/accessibility/data/slider.qml @@ -1,17 +1,10 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - Slider { - id: slider - objectName: "slider" - from: 0 - to: 100 - value: 50 - stepSize: 1 - orientation: "Horizontal" - } +Slider { + from: 0 + to: 100 + value: 50 + stepSize: 1 + orientation: Qt.Horizontal } diff --git a/tests/auto/accessibility/data/spinbox.qml b/tests/auto/accessibility/data/spinbox.qml index 9d29bccc..029cbc65 100644 --- a/tests/auto/accessibility/data/spinbox.qml +++ b/tests/auto/accessibility/data/spinbox.qml @@ -1,16 +1,9 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - SpinBox { - id: spinbox - objectName: "spinbox" - from: 0 - to: 100 - value: 50 - stepSize: 1 - } +SpinBox { + from: 0 + to: 100 + value: 50 + stepSize: 1 } diff --git a/tests/auto/accessibility/data/switch.qml b/tests/auto/accessibility/data/switch.qml index 9913e3f1..8bb43893 100644 --- a/tests/auto/accessibility/data/switch.qml +++ b/tests/auto/accessibility/data/switch.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - Switch { - //id: switch - objectName: "switch" - text: "Switch" - } +Switch { + text: "Switch" } diff --git a/tests/auto/accessibility/data/switchdelegate.qml b/tests/auto/accessibility/data/switchdelegate.qml index ae9b95f1..9f2324c0 100644 --- a/tests/auto/accessibility/data/switchdelegate.qml +++ b/tests/auto/accessibility/data/switchdelegate.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - SwitchDelegate { - id: switchdelegate - objectName: "switchdelegate" - text: "SwitchDelegate" - } +SwitchDelegate { + text: "SwitchDelegate" } diff --git a/tests/auto/accessibility/data/tabbar.qml b/tests/auto/accessibility/data/tabbar.qml index 127c4e81..4b1f73a1 100644 --- a/tests/auto/accessibility/data/tabbar.qml +++ b/tests/auto/accessibility/data/tabbar.qml @@ -1,12 +1,4 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - TabBar { - id: tabbar - objectName: "tabbar" - } -} +TabBar { } diff --git a/tests/auto/accessibility/data/tabbutton.qml b/tests/auto/accessibility/data/tabbutton.qml index cfb04ca2..6b979bc8 100644 --- a/tests/auto/accessibility/data/tabbutton.qml +++ b/tests/auto/accessibility/data/tabbutton.qml @@ -1,17 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - TabBar { - id: tabbar - objectName: "TabBar" - TabButton { - id: tabbutton - objectName: "tabbutton" - text: "TabButton" - } - } +TabButton { + text: "TabButton" } diff --git a/tests/auto/accessibility/data/textarea.qml b/tests/auto/accessibility/data/textarea.qml index 381c08bd..93b5b220 100644 --- a/tests/auto/accessibility/data/textarea.qml +++ b/tests/auto/accessibility/data/textarea.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - TextArea { - id: textarea - objectName: "textarea" - text: "TextArea" - } +TextArea { + text: "TextArea" } diff --git a/tests/auto/accessibility/data/textfield.qml b/tests/auto/accessibility/data/textfield.qml index 5db46d82..06ba1a58 100644 --- a/tests/auto/accessibility/data/textfield.qml +++ b/tests/auto/accessibility/data/textfield.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - TextField { - id: textfield - objectName: "textfield" - text: "TextField" - } +TextField { + text: "TextField" } diff --git a/tests/auto/accessibility/data/toolbar.qml b/tests/auto/accessibility/data/toolbar.qml index c0503aef..7b3ba07f 100644 --- a/tests/auto/accessibility/data/toolbar.qml +++ b/tests/auto/accessibility/data/toolbar.qml @@ -1,12 +1,4 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - ToolBar { - id: toolbar - objectName: "toolbar" - } -} +ToolBar { } diff --git a/tests/auto/accessibility/data/toolbutton.qml b/tests/auto/accessibility/data/toolbutton.qml index 63aacddc..79f155ec 100644 --- a/tests/auto/accessibility/data/toolbutton.qml +++ b/tests/auto/accessibility/data/toolbutton.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - ToolButton { - id: toolbutton - objectName: "toolbutton" - text: "ToolButton" - } +ToolButton { + text: "ToolButton" } diff --git a/tests/auto/accessibility/data/tooltip.qml b/tests/auto/accessibility/data/tooltip.qml index 4a2f16b5..1d1bae28 100644 --- a/tests/auto/accessibility/data/tooltip.qml +++ b/tests/auto/accessibility/data/tooltip.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import QtQuick.Controls 2.0 -Window { - visible: true - - ToolTip { - id: tooltip - objectName: "tooltip" - text: "ToolTip" - } +ToolTip { + text: "ToolTip" } diff --git a/tests/auto/accessibility/data/weeknumbercolumn-2.qml b/tests/auto/accessibility/data/weeknumbercolumn-2.qml index bc3b1739..7d682315 100644 --- a/tests/auto/accessibility/data/weeknumbercolumn-2.qml +++ b/tests/auto/accessibility/data/weeknumbercolumn-2.qml @@ -1,12 +1,4 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import Qt.labs.calendar 1.0 -Window { - visible: true - - WeekNumberColumn { - id: weeknumbercolumn - objectName: "weeknumbercolumn" - } -} +WeekNumberColumn { } diff --git a/tests/auto/accessibility/data/weeknumbercolumn.qml b/tests/auto/accessibility/data/weeknumbercolumn.qml index 7fadb5da..6b024872 100644 --- a/tests/auto/accessibility/data/weeknumbercolumn.qml +++ b/tests/auto/accessibility/data/weeknumbercolumn.qml @@ -1,13 +1,6 @@ import QtQuick 2.5 -import QtQuick.Window 2.2 import Qt.labs.calendar 1.0 -Window { - visible: true - - WeekNumberColumn { - id: weeknumbercolumn - objectName: "weeknumbercolumn" - Accessible.name: "WeekNumberColumn" - } +WeekNumberColumn { + Accessible.name: "WeekNumberColumn" } diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index c1c9cb25..1086c17e 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -34,27 +34,21 @@ ** ****************************************************************************/ -#include -#include +#include #include #include #include -#include #include #include #include "../shared/util.h" -#include "../shared/visualtestutil.h" #ifndef QT_NO_ACCESSIBILITY #include #endif -using namespace QQuickVisualTestUtil; - class tst_accessibility : public QQmlDataTest { Q_OBJECT -public: private slots: void a11y_data(); @@ -127,7 +121,6 @@ void tst_accessibility::a11y() QFETCH(int, role); QFETCH(QString, text); - QQmlComponent component(&engine); QString fn = name; #ifdef QT_NO_ACCESSIBILITY if (name == QLatin1Literal("dayofweekrow") @@ -135,20 +128,16 @@ void tst_accessibility::a11y() || name == QLatin1Literal("weeknumbercolumn")) fn += QLatin1Literal("-2"); #endif + + QQmlComponent component(&engine); component.loadUrl(testFileUrl(fn + ".qml")); - QObject* created = component.create(); - QVERIFY2(created, qPrintable(component.errorString())); - QScopedPointer cleanup(created); - QVERIFY(!cleanup.isNull()); - QQuickWindow* window = qobject_cast(created); - QVERIFY(window); - window->show(); - QVERIFY(QTest::qWaitForWindowActive(window)); + QScopedPointer object(component.create()); + QVERIFY2(!object.isNull(), qPrintable(component.errorString())); - QQuickItem *item = findItem(window->contentItem(), name); + QQuickItem *item = qobject_cast(object.data()); if (!item) { - QQuickPopup *popup = window->contentItem()->findChild(name); + QQuickPopup *popup = qobject_cast(object.data()); if (popup) item = popup->popupItem(); } -- cgit v1.2.3 From 814601e9cdf5895152cedcd1968fd2a4eecd3cd3 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 2 Nov 2016 11:26:08 +0100 Subject: Doc: tweak BusyIndicator's GIF Make it running at start to ensure that the first frame serves as a good screenshot. When GIF animations were disabled (Qt Creator), the first frame was empty. Change-Id: I2a0acf0cf428a0175c141a7841ec327bc15dfade Task-number: QTBUG-55904 Reviewed-by: Mitch Curtis --- tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml | 2 +- tests/manual/gifs/tst_gifs.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml b/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml index f4a51afb..5c655cab 100644 --- a/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml +++ b/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml @@ -51,7 +51,7 @@ Window { BusyIndicator { id: busyIndicator - running: false + running: true anchors.centerIn: parent } } diff --git a/tests/manual/gifs/tst_gifs.cpp b/tests/manual/gifs/tst_gifs.cpp index 5cb1f109..d3fb5f6d 100644 --- a/tests/manual/gifs/tst_gifs.cpp +++ b/tests/manual/gifs/tst_gifs.cpp @@ -352,7 +352,7 @@ void tst_Gifs::busyIndicator() GifRecorder gifRecorder; gifRecorder.setDataDirPath(dataDirPath); gifRecorder.setOutputDir(outputDir); - gifRecorder.setRecordingDuration(3); + gifRecorder.setRecordingDuration(6); gifRecorder.setHighQuality(true); gifRecorder.setQmlFileName("qtquickcontrols2-busyindicator.qml"); @@ -360,17 +360,17 @@ void tst_Gifs::busyIndicator() QQuickWindow *window = gifRecorder.window(); // Record nothing for a bit to make it smoother. - QTest::qWait(400); + QTest::qWait(800 * 2); QQuickItem *busyIndicator = window->property("busyIndicator").value(); QVERIFY(busyIndicator); - busyIndicator->setProperty("running", true); + busyIndicator->setProperty("running", false); // 800 ms is the duration of one rotation animation cycle for BusyIndicator. QTest::qWait(800 * 2); - busyIndicator->setProperty("running", false); + busyIndicator->setProperty("running", true); gifRecorder.waitForFinish(); } -- cgit v1.2.3