diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-11-01 21:05:32 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-11-02 09:24:48 +0000 |
commit | 189fe8349943a928dd0af50e90b8232a4bbe6acc (patch) | |
tree | c9274b8f46b1205d2b7dd0ab2fda8d5e9de738be | |
parent | 31c51eb402c67c9a01b9f0cf108195db699e2a9c (diff) |
Frame: fix accessibility support
Change-Id: I79f06e3a60151ab4e35b6290fbfe022ed20665e3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | src/quicktemplates2/qquickframe.cpp | 7 | ||||
-rw-r--r-- | src/quicktemplates2/qquickframe_p.h | 4 | ||||
-rw-r--r-- | tests/auto/accessibility/data/frame.qml | 12 | ||||
-rw-r--r-- | tests/auto/accessibility/tst_accessibility.cpp | 2 |
4 files changed, 24 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickframe.cpp b/src/quicktemplates2/qquickframe.cpp index bcc387c1..d51ea60a 100644 --- a/src/quicktemplates2/qquickframe.cpp +++ b/src/quicktemplates2/qquickframe.cpp @@ -78,4 +78,11 @@ QQuickFrame::QQuickFrame(QQuickFramePrivate &dd, QQuickItem *parent) : { } +#ifndef QT_NO_ACCESSIBILITY +QAccessible::Role QQuickFrame::accessibleRole() const +{ + return QAccessible::Border; +} +#endif // QT_NO_ACCESSIBILITY + QT_END_NAMESPACE diff --git a/src/quicktemplates2/qquickframe_p.h b/src/quicktemplates2/qquickframe_p.h index 12a65afd..093da248 100644 --- a/src/quicktemplates2/qquickframe_p.h +++ b/src/quicktemplates2/qquickframe_p.h @@ -64,6 +64,10 @@ public: protected: QQuickFrame(QQuickFramePrivate &dd, QQuickItem *parent); +#ifndef QT_NO_ACCESSIBILITY + QAccessible::Role accessibleRole() const override; +#endif + private: Q_DISABLE_COPY(QQuickFrame) Q_DECLARE_PRIVATE(QQuickFrame) 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 |