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/auto') 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 70963f8095e15434b3550f7676a222735df51da5 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 1 Nov 2016 19:43:19 +0100 Subject: Add missing QQuickDialog::accessibleRole() Change-Id: I49ab38361e3165d4ee4722c5af1404cdd145246b Reviewed-by: Liang Qi --- tests/auto/accessibility/data/dialog.qml | 12 ++++++++++++ tests/auto/accessibility/tst_accessibility.cpp | 1 + 2 files changed, 13 insertions(+) create mode 100644 tests/auto/accessibility/data/dialog.qml (limited to 'tests/auto') diff --git a/tests/auto/accessibility/data/dialog.qml b/tests/auto/accessibility/data/dialog.qml new file mode 100644 index 00000000..df0257e8 --- /dev/null +++ b/tests/auto/accessibility/data/dialog.qml @@ -0,0 +1,12 @@ +import QtQuick 2.5 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.1 + +Window { + visible: true + + Dialog { + id: dialog + objectName: "dialog" + } +} diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index e97e4702..fc3be1cb 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("Dialog") << "dialog" << 0x00000012 << ""; //QAccessible::Dialog // Frame // GroupBox QTest::newRow("Label") << "label" << 0x00000029 << "Label"; //QAccessible::StaticText -- 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/auto') 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/auto') 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/auto') 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/auto') 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/auto') 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/auto') 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/auto') 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 bb42d6e87ffd83199372dbc3097db7506814d129 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 2 Nov 2016 13:26:01 +0100 Subject: QQuickDialog: finish accessibility support 2f1e983 added support for controlling accessible properties via QQuickPopup, so now QQuickDialog can set its title as the accessible name the same way QQuickPage does. Change-Id: Iead1e65a10ec16fbbae8383edb6fa3a77a83d4fe Reviewed-by: Mitch Curtis --- tests/auto/accessibility/data/dialog.qml | 4 +++- tests/auto/accessibility/tst_accessibility.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/accessibility/data/dialog.qml b/tests/auto/accessibility/data/dialog.qml index 46a96f2e..26e944fd 100644 --- a/tests/auto/accessibility/data/dialog.qml +++ b/tests/auto/accessibility/data/dialog.qml @@ -1,4 +1,6 @@ import QtQuick 2.5 import QtQuick.Controls 2.1 -Dialog { } +Dialog { + title: "Dialog" +} diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index 53cb6973..520f6ef2 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -69,7 +69,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 - QTest::newRow("Dialog") << "dialog" << 0x00000012 << ""; //QAccessible::Dialog + QTest::newRow("Dialog") << "dialog" << 0x00000012 << "Dialog"; //QAccessible::Dialog QTest::newRow("Frame") << "frame" << 0x00000013 << ""; //QAccessible::Border QTest::newRow("GroupBox") << "groupbox" << 0x00000014 << "GroupBox"; //QAccessible::Grouping QTest::newRow("ItemDelegate") << "itemdelegate" << 0x00000022 << "ItemDelegate"; //QAccessible::ListItem -- cgit v1.2.3 From ee7151d5ab29ba812a93c1231ddc59c9129a7af0 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 2 Nov 2016 14:56:49 +0100 Subject: StackView: provide accessible role QAccessible::LayeredPane: An object that can contain layered children, e.g. in a stack. The same accessible role is used by QStackedWidget. Change-Id: Ia1f96afd5e084958538356e3d9033a3d88cf03c3 Reviewed-by: Mitch Curtis --- tests/auto/accessibility/data/stackview.qml | 4 ++++ tests/auto/accessibility/tst_accessibility.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 tests/auto/accessibility/data/stackview.qml (limited to 'tests/auto') diff --git a/tests/auto/accessibility/data/stackview.qml b/tests/auto/accessibility/data/stackview.qml new file mode 100644 index 00000000..cf3b76c2 --- /dev/null +++ b/tests/auto/accessibility/data/stackview.qml @@ -0,0 +1,4 @@ +import QtQuick 2.5 +import QtQuick.Controls 2.0 + +StackView { } diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index 1086c17e..bb2f9c0a 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -86,7 +86,7 @@ void tst_accessibility::a11y_data() QTest::newRow("ScrollIndicator") << "scrollindicator" << 0x00000027 << ""; //QAccessible::Indicator QTest::newRow("Slider") << "slider" << 0x00000033 << ""; //QAccessible::Slider QTest::newRow("SpinBox") << "spinbox" << 0x00000034 << ""; //QAccessible::SpinBox - // StackView + QTest::newRow("StackView") << "stackview" << 0x00000080 << ""; //QAccessible::LayeredPane QTest::newRow("Switch") << "switch" << 0x0000002B << "Switch"; //QAccessible::Button QTest::newRow("SwitchDelegate") << "switchdelegate" << 0x00000022 << "SwitchDelegate"; //QAccessible::ListItem QTest::newRow("TabBar") << "tabbar" << 0x0000003C << ""; //QAccessible::PageTabList -- cgit v1.2.3 From b02a9febe602662d30f5e9b4169b461bbf2cbc0c Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 2 Nov 2016 15:01:21 +0100 Subject: SwipeView: fix accessibility support Don't specify the role in QML, because using the Accessible attached property creates a hard dependency to the accessibility feature (the QML code won't run when QT_NO_ACCESSIBILITY is defined). Change-Id: Ie540c915547fae94705873292368652e3608c9e7 Reviewed-by: Mitch Curtis --- tests/auto/accessibility/data/swipeview.qml | 4 ++++ tests/auto/accessibility/tst_accessibility.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 tests/auto/accessibility/data/swipeview.qml (limited to 'tests/auto') diff --git a/tests/auto/accessibility/data/swipeview.qml b/tests/auto/accessibility/data/swipeview.qml new file mode 100644 index 00000000..018ab772 --- /dev/null +++ b/tests/auto/accessibility/data/swipeview.qml @@ -0,0 +1,4 @@ +import QtQuick 2.5 +import QtQuick.Controls 2.0 + +SwipeView { } diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index bb2f9c0a..22aae1f2 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -87,6 +87,7 @@ void tst_accessibility::a11y_data() QTest::newRow("Slider") << "slider" << 0x00000033 << ""; //QAccessible::Slider QTest::newRow("SpinBox") << "spinbox" << 0x00000034 << ""; //QAccessible::SpinBox QTest::newRow("StackView") << "stackview" << 0x00000080 << ""; //QAccessible::LayeredPane + QTest::newRow("SwipeView") << "swipeview" << 0x0000003C << ""; //QAccessible::Pane QTest::newRow("Switch") << "switch" << 0x0000002B << "Switch"; //QAccessible::Button QTest::newRow("SwitchDelegate") << "switchdelegate" << 0x00000022 << "SwitchDelegate"; //QAccessible::ListItem QTest::newRow("TabBar") << "tabbar" << 0x0000003C << ""; //QAccessible::PageTabList @@ -99,7 +100,6 @@ void tst_accessibility::a11y_data() QTest::newRow("Dial") << "dial" << 0x00000031 << ""; //QAccessible::Dial // Drawer - // SwipeView // Tumbler QTest::newRow("DayOfWeekRow") << "dayofweekrow" << 0x0 << "DayOfWeekRow"; //QAccessible::NoRole -- cgit v1.2.3 From be9adeeda631926716038b852bf7e4b33daa2dc2 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 2 Nov 2016 15:13:30 +0100 Subject: Popups: use "Dialog" accessible role LayeredPane is described as "an object that can contain layered children, e.g. in a stack". There is no plain "Popup" accessible role. The closest match is "Dialog". Change-Id: I3fca381a953231ff3339ce05e5a00c82f47ba6e7 Reviewed-by: Mitch Curtis --- tests/auto/accessibility/data/drawer.qml | 4 ++++ tests/auto/accessibility/tst_accessibility.cpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 tests/auto/accessibility/data/drawer.qml (limited to 'tests/auto') diff --git a/tests/auto/accessibility/data/drawer.qml b/tests/auto/accessibility/data/drawer.qml new file mode 100644 index 00000000..12652164 --- /dev/null +++ b/tests/auto/accessibility/data/drawer.qml @@ -0,0 +1,4 @@ +import QtQuick 2.5 +import QtQuick.Controls 2.0 + +Drawer { } diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index 22aae1f2..e232d75a 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -69,6 +69,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 + QTest::newRow("Drawer") << "drawer" << 0x00000012 << ""; //QAccessible::Dialog QTest::newRow("Frame") << "frame" << 0x00000013 << ""; //QAccessible::Border QTest::newRow("GroupBox") << "groupbox" << 0x00000014 << "GroupBox"; //QAccessible::Grouping QTest::newRow("ItemDelegate") << "itemdelegate" << 0x00000022 << "ItemDelegate"; //QAccessible::ListItem @@ -78,7 +79,7 @@ void tst_accessibility::a11y_data() 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("Popup") << "popup" << 0x00000012 << ""; //QAccessible::Dialog QTest::newRow("ProgressBar") << "progressbar" << 0x00000030 << ""; //QAccessible::ProgressBar QTest::newRow("RadioButton") << "radiobutton" << 0x0000002D << "RadioButton"; //QAccessible::RadioButton QTest::newRow("RangeSlider") << "rangeslider" << 0x00000033 << ""; //QAccessible::Slider @@ -99,7 +100,6 @@ void tst_accessibility::a11y_data() QTest::newRow("ToolTip") << "tooltip" << 0x0000000D << "ToolTip"; //QAccessible::ToolTip QTest::newRow("Dial") << "dial" << 0x00000031 << ""; //QAccessible::Dial - // Drawer // Tumbler QTest::newRow("DayOfWeekRow") << "dayofweekrow" << 0x0 << "DayOfWeekRow"; //QAccessible::NoRole -- cgit v1.2.3 From 7ea14343dd179f642eec003476c2c5e65198affd Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 2 Nov 2016 15:23:57 +0100 Subject: tst_accessibility: add all remaining controls Change-Id: I92522c861ccf1604d3d36bc8c132924050c24b8d Reviewed-by: Mitch Curtis --- tests/auto/accessibility/data/abstractbutton.qml | 6 ++++++ tests/auto/accessibility/data/container.qml | 4 ++++ tests/auto/accessibility/data/radiodelegate.qml | 6 ++++++ tests/auto/accessibility/data/swipedelegate.qml | 6 ++++++ tests/auto/accessibility/data/tumbler.qml | 4 ++++ tests/auto/accessibility/tst_accessibility.cpp | 10 +++++++--- 6 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 tests/auto/accessibility/data/abstractbutton.qml create mode 100644 tests/auto/accessibility/data/container.qml create mode 100644 tests/auto/accessibility/data/radiodelegate.qml create mode 100644 tests/auto/accessibility/data/swipedelegate.qml create mode 100644 tests/auto/accessibility/data/tumbler.qml (limited to 'tests/auto') diff --git a/tests/auto/accessibility/data/abstractbutton.qml b/tests/auto/accessibility/data/abstractbutton.qml new file mode 100644 index 00000000..368f4582 --- /dev/null +++ b/tests/auto/accessibility/data/abstractbutton.qml @@ -0,0 +1,6 @@ +import QtQuick 2.5 +import QtQuick.Controls 2.0 + +AbstractButton { + text: "AbstractButton" +} diff --git a/tests/auto/accessibility/data/container.qml b/tests/auto/accessibility/data/container.qml new file mode 100644 index 00000000..806ebe78 --- /dev/null +++ b/tests/auto/accessibility/data/container.qml @@ -0,0 +1,4 @@ +import QtQuick 2.5 +import QtQuick.Controls 2.0 + +Container { } diff --git a/tests/auto/accessibility/data/radiodelegate.qml b/tests/auto/accessibility/data/radiodelegate.qml new file mode 100644 index 00000000..93ccafde --- /dev/null +++ b/tests/auto/accessibility/data/radiodelegate.qml @@ -0,0 +1,6 @@ +import QtQuick 2.5 +import QtQuick.Controls 2.0 + +RadioDelegate { + text: "RadioDelegate" +} diff --git a/tests/auto/accessibility/data/swipedelegate.qml b/tests/auto/accessibility/data/swipedelegate.qml new file mode 100644 index 00000000..a8acb5e0 --- /dev/null +++ b/tests/auto/accessibility/data/swipedelegate.qml @@ -0,0 +1,6 @@ +import QtQuick 2.5 +import QtQuick.Controls 2.0 + +SwipeDelegate { + text: "SwipeDelegate" +} diff --git a/tests/auto/accessibility/data/tumbler.qml b/tests/auto/accessibility/data/tumbler.qml new file mode 100644 index 00000000..11c737d7 --- /dev/null +++ b/tests/auto/accessibility/data/tumbler.qml @@ -0,0 +1,4 @@ +import QtQuick 2.5 +import QtQuick.Controls 2.0 + +Tumbler { } diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index e232d75a..99f6391e 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -64,11 +64,15 @@ void tst_accessibility::a11y_data() QTest::addColumn("role"); QTest::addColumn("text"); + QTest::newRow("AbstractButton") << "abstractbutton" << 0x0000002B << "AbstractButton"; //QAccessible::Button 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 + QTest::newRow("Container") << "container" << 0x00000000 << ""; //QAccessible::NoRole + QTest::newRow("Control") << "control" << 0x00000000 << ""; //QAccessible::NoRole + QTest::newRow("Dial") << "dial" << 0x00000031 << ""; //QAccessible::Dial QTest::newRow("Drawer") << "drawer" << 0x00000012 << ""; //QAccessible::Dialog QTest::newRow("Frame") << "frame" << 0x00000013 << ""; //QAccessible::Border QTest::newRow("GroupBox") << "groupbox" << 0x00000014 << "GroupBox"; //QAccessible::Grouping @@ -82,12 +86,14 @@ void tst_accessibility::a11y_data() QTest::newRow("Popup") << "popup" << 0x00000012 << ""; //QAccessible::Dialog QTest::newRow("ProgressBar") << "progressbar" << 0x00000030 << ""; //QAccessible::ProgressBar QTest::newRow("RadioButton") << "radiobutton" << 0x0000002D << "RadioButton"; //QAccessible::RadioButton + QTest::newRow("RadioDelegate") << "radiodelegate" << 0x0000002D << "RadioDelegate"; //QAccessible::RadioButton QTest::newRow("RangeSlider") << "rangeslider" << 0x00000033 << ""; //QAccessible::Slider QTest::newRow("ScrollBar") << "scrollbar" << 0x00000003 << ""; //QAccessible::ScrollBar QTest::newRow("ScrollIndicator") << "scrollindicator" << 0x00000027 << ""; //QAccessible::Indicator QTest::newRow("Slider") << "slider" << 0x00000033 << ""; //QAccessible::Slider QTest::newRow("SpinBox") << "spinbox" << 0x00000034 << ""; //QAccessible::SpinBox QTest::newRow("StackView") << "stackview" << 0x00000080 << ""; //QAccessible::LayeredPane + QTest::newRow("SwipeDelegate") << "swipedelegate" << 0x00000022 << "SwipeDelegate"; //QAccessible::ListItem QTest::newRow("SwipeView") << "swipeview" << 0x0000003C << ""; //QAccessible::Pane QTest::newRow("Switch") << "switch" << 0x0000002B << "Switch"; //QAccessible::Button QTest::newRow("SwitchDelegate") << "switchdelegate" << 0x00000022 << "SwitchDelegate"; //QAccessible::ListItem @@ -98,9 +104,7 @@ void tst_accessibility::a11y_data() QTest::newRow("ToolBar") << "toolbar" << 0x00000016 << ""; //QAccessible::ToolBar QTest::newRow("ToolButton") << "toolbutton" << 0x0000002B << "ToolButton"; //QAccessible::Button QTest::newRow("ToolTip") << "tooltip" << 0x0000000D << "ToolTip"; //QAccessible::ToolTip - - QTest::newRow("Dial") << "dial" << 0x00000031 << ""; //QAccessible::Dial - // Tumbler + QTest::newRow("Tumbler") << "tumbler" << 0x00000000 << ""; //QAccessible::NoRole (TODO) QTest::newRow("DayOfWeekRow") << "dayofweekrow" << 0x0 << "DayOfWeekRow"; //QAccessible::NoRole QTest::newRow("MonthGrid") << "monthgrid" << 0x0 << "MonthGrid"; //QAccessible::NoRole -- cgit v1.2.3 From c4a5b64abacad55e8b805bc1b1eaa877b0c945bb Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 2 Nov 2016 15:52:42 +0100 Subject: tst_accessibility: add RoundButton Change-Id: I6ea5d2ac6c72b469c1916d72dc81352a09646006 Reviewed-by: Mitch Curtis --- tests/auto/accessibility/data/roundbutton.qml | 6 ++++++ tests/auto/accessibility/tst_accessibility.cpp | 1 + 2 files changed, 7 insertions(+) create mode 100644 tests/auto/accessibility/data/roundbutton.qml (limited to 'tests/auto') diff --git a/tests/auto/accessibility/data/roundbutton.qml b/tests/auto/accessibility/data/roundbutton.qml new file mode 100644 index 00000000..8edf58de --- /dev/null +++ b/tests/auto/accessibility/data/roundbutton.qml @@ -0,0 +1,6 @@ +import QtQuick 2.5 +import QtQuick.Controls 2.1 + +RoundButton { + text: "RoundButton" +} diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp index 520f6ef2..d61a4e7f 100644 --- a/tests/auto/accessibility/tst_accessibility.cpp +++ b/tests/auto/accessibility/tst_accessibility.cpp @@ -83,6 +83,7 @@ void tst_accessibility::a11y_data() QTest::newRow("ProgressBar") << "progressbar" << 0x00000030 << ""; //QAccessible::ProgressBar QTest::newRow("RadioButton") << "radiobutton" << 0x0000002D << "RadioButton"; //QAccessible::RadioButton QTest::newRow("RangeSlider") << "rangeslider" << 0x00000033 << ""; //QAccessible::Slider + QTest::newRow("RoundButton") << "roundbutton" << 0x0000002B << "RoundButton"; //QAccessible::Button QTest::newRow("ScrollBar") << "scrollbar" << 0x00000003 << ""; //QAccessible::ScrollBar QTest::newRow("ScrollIndicator") << "scrollindicator" << 0x00000027 << ""; //QAccessible::Indicator QTest::newRow("Slider") << "slider" << 0x00000033 << ""; //QAccessible::Slider -- cgit v1.2.3 From b552676670b4df7eb0bb2ffd226b4e316c3d2987 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 3 Nov 2016 09:40:47 +0100 Subject: QQuickComboBox: handle Home and End keys [ChangeLog][Controls][ComboBox] Added handling for Home and End keys. Change-Id: I79ec0644f169503ab38a8e2bee18621a1f671478 Task-number: QTBUG-56884 Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_combobox.qml | 117 +++++++++++++++++++++++++++++- 1 file changed, 115 insertions(+), 2 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index 7d7e519f..3fb9ea77 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -431,7 +431,7 @@ TestCase { control.destroy() } - function test_keys_data() { + function test_keys_space_enter_escape_data() { return [ { tag: "space-space", key1: Qt.Key_Space, key2: Qt.Key_Space, showPopup: true, showPress: true, hidePopup: true, hidePress: true }, { tag: "space-enter", key1: Qt.Key_Space, key2: Qt.Key_Enter, showPopup: true, showPress: true, hidePopup: true, hidePress: true }, @@ -444,7 +444,7 @@ TestCase { ] } - function test_keys(data) { + function test_keys_space_enter_escape(data) { var control = comboBox.createObject(testCase, {model: 3}) verify(control) @@ -474,6 +474,119 @@ TestCase { control.destroy() } + function test_keys_home_end() { + var control = comboBox.createObject(testCase, {model: 5}) + verify(control) + + control.forceActiveFocus() + verify(control.activeFocus) + compare(control.currentIndex, 0) + compare(control.highlightedIndex, -1) + + var activatedCount = 0 + var activatedSpy = signalSpy.createObject(control, {target: control, signalName: "activated"}) + verify(activatedSpy.valid) + + var highlightedCount = 0 + var highlightedSpy = signalSpy.createObject(control, {target: control, signalName: "highlighted"}) + verify(highlightedSpy.valid) + + var currentIndexCount = 0 + var currentIndexSpy = signalSpy.createObject(control, {target: control, signalName: "currentIndexChanged"}) + verify(currentIndexSpy.valid) + + var highlightedIndexCount = 0 + var highlightedIndexSpy = signalSpy.createObject(control, {target: control, signalName: "highlightedIndexChanged"}) + verify(highlightedIndexSpy.valid) + + // end (popup closed) + keyClick(Qt.Key_End) + compare(control.currentIndex, 4) + compare(currentIndexSpy.count, ++currentIndexCount) + + compare(control.highlightedIndex, -1) + compare(highlightedIndexSpy.count, highlightedIndexCount) + + compare(activatedSpy.count, ++activatedCount) + compare(activatedSpy.signalArguments[activatedCount-1][0], 4) + + compare(highlightedSpy.count, highlightedCount) + + // repeat (no changes/signals) + keyClick(Qt.Key_End) + compare(currentIndexSpy.count, currentIndexCount) + compare(highlightedIndexSpy.count, highlightedIndexCount) + compare(activatedSpy.count, activatedCount) + compare(highlightedSpy.count, highlightedCount) + + // home (popup closed) + keyClick(Qt.Key_Home) + compare(control.currentIndex, 0) + compare(currentIndexSpy.count, ++currentIndexCount) + + compare(control.highlightedIndex, -1) + compare(highlightedIndexSpy.count, highlightedIndexCount) + + compare(activatedSpy.count, ++activatedCount) + compare(activatedSpy.signalArguments[activatedCount-1][0], 0) + + compare(highlightedSpy.count, highlightedCount) + + // repeat (no changes/signals) + keyClick(Qt.Key_Home) + compare(currentIndexSpy.count, currentIndexCount) + compare(highlightedIndexSpy.count, highlightedIndexCount) + compare(activatedSpy.count, activatedCount) + compare(highlightedSpy.count, highlightedCount) + + control.popup.open() + compare(control.highlightedIndex, 0) + compare(highlightedIndexSpy.count, ++highlightedIndexCount) + compare(highlightedSpy.count, highlightedCount) + + // end (popup open) + keyClick(Qt.Key_End) + compare(control.currentIndex, 0) + compare(currentIndexSpy.count, currentIndexCount) + + compare(control.highlightedIndex, 4) + compare(highlightedIndexSpy.count, ++highlightedIndexCount) + + compare(activatedSpy.count, activatedCount) + + compare(highlightedSpy.count, ++highlightedCount) + compare(highlightedSpy.signalArguments[highlightedCount-1][0], 4) + + // repeat (no changes/signals) + keyClick(Qt.Key_End) + compare(currentIndexSpy.count, currentIndexCount) + compare(highlightedIndexSpy.count, highlightedIndexCount) + compare(activatedSpy.count, activatedCount) + compare(highlightedSpy.count, highlightedCount) + + // home (popup open) + keyClick(Qt.Key_Home) + compare(control.currentIndex, 0) + compare(currentIndexSpy.count, currentIndexCount) + + compare(control.highlightedIndex, 0) + compare(highlightedIndexSpy.count, ++highlightedIndexCount) + + compare(activatedSpy.count, activatedCount) + + compare(highlightedSpy.count, ++highlightedCount) + compare(highlightedSpy.signalArguments[highlightedCount-1][0], 0) + + // repeat (no changes/signals) + keyClick(Qt.Key_Home) + compare(currentIndexSpy.count, currentIndexCount) + compare(highlightedIndexSpy.count, highlightedIndexCount) + compare(activatedSpy.count, activatedCount) + compare(highlightedSpy.count, highlightedCount) + + control.destroy() + } + function test_popup() { var control = comboBox.createObject(testCase, {model: 3}) verify(control) -- cgit v1.2.3 From 6f95a086b4d396ff62bc2817bcb1545f60973f38 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 3 Nov 2016 10:07:50 +0100 Subject: QQuickComboBox: key search [ChangeLog][Controls][ComboBox] Added missing keyboard search functionality. Change-Id: If132f2ca0bca8cdb09de03f584c07eec6fb384f6 Task-number: QTBUG-56884 Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_combobox.qml | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index 3fb9ea77..607de2e8 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -587,6 +587,49 @@ TestCase { control.destroy() } + function test_keySearch() { + var control = comboBox.createObject(testCase, {model: ["Banana", "Coco", "Coconut", "Apple", "Cocomuffin"]}) + verify(control) + + control.forceActiveFocus() + verify(control.activeFocus) + + compare(control.currentIndex, 0) + compare(control.currentText, "Banana") + + keyPress(Qt.Key_C) + compare(control.currentIndex, 1) + compare(control.currentText, "Coco") + + // no match + keyPress(Qt.Key_N) + compare(control.currentIndex, 1) + compare(control.currentText, "Coco") + + keyPress(Qt.Key_C) + compare(control.currentIndex, 2) + compare(control.currentText, "Coconut") + + keyPress(Qt.Key_C) + compare(control.currentIndex, 4) + compare(control.currentText, "Cocomuffin") + + // wrap + keyPress(Qt.Key_C) + compare(control.currentIndex, 1) + compare(control.currentText, "Coco") + + keyPress(Qt.Key_A) + compare(control.currentIndex, 3) + compare(control.currentText, "Apple") + + keyPress(Qt.Key_B) + compare(control.currentIndex, 0) + compare(control.currentText, "Banana") + + control.destroy() + } + function test_popup() { var control = comboBox.createObject(testCase, {model: 3}) verify(control) -- cgit v1.2.3