| 1 | // Copyright (C) 2025 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #include "qaccessiblequickcontrol_p.h" |
| 5 | #include "qquickcontrol_p.h" |
| 6 | |
| 7 | QT_BEGIN_NAMESPACE |
| 8 | |
| 9 | QAccessibleQuickControl::QAccessibleQuickControl(QQuickControl *control) |
| 10 | : QAccessibleQuickItem(control) |
| 11 | { |
| 12 | } |
| 13 | |
| 14 | void *QAccessibleQuickControl::interface_cast(QAccessible::InterfaceType t) |
| 15 | { |
| 16 | if (t == QAccessible::AttributesInterface) |
| 17 | return static_cast<QAccessibleAttributesInterface *>(this); |
| 18 | |
| 19 | return QAccessibleQuickItem::interface_cast(t); |
| 20 | } |
| 21 | |
| 22 | QList<QAccessible::Attribute> QAccessibleQuickControl::attributeKeys() const |
| 23 | { |
| 24 | return { QAccessible::Attribute::Locale }; |
| 25 | } |
| 26 | |
| 27 | QVariant QAccessibleQuickControl::attributeValue(QAccessible::Attribute key) const |
| 28 | { |
| 29 | if (key == QAccessible::Attribute::Locale) |
| 30 | return QVariant::fromValue(value: control()->locale()); |
| 31 | |
| 32 | return QVariant(); |
| 33 | } |
| 34 | |
| 35 | QQuickControl *QAccessibleQuickControl::control() const |
| 36 | { |
| 37 | return static_cast<QQuickControl *>(object()); |
| 38 | } |
| 39 | |
| 40 | QT_END_NAMESPACE |
| 41 |
