| 1 | // Copyright (C) 2021 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 "qtquicktemplates2global_p.h" |
| 5 | |
| 6 | #include <QtGui/qtguiglobal.h> |
| 7 | |
| 8 | #if QT_CONFIG(accessibility) |
| 9 | #include "qquickpage_p.h" |
| 10 | #include "accessible/qaccessiblequickcontrol_p.h" |
| 11 | #include "accessible/qaccessiblequickpage_p.h" |
| 12 | #endif |
| 13 | |
| 14 | QT_BEGIN_NAMESPACE |
| 15 | |
| 16 | #if QT_CONFIG(accessibility) |
| 17 | static QAccessibleInterface *qQuickAccessibleFactory(const QString &classname, QObject *object) |
| 18 | { |
| 19 | if (classname == u"QQuickPage") { |
| 20 | return new QAccessibleQuickPage(qobject_cast<QQuickPage *>(object)); |
| 21 | } |
| 22 | if (classname == u"QQuickControl") |
| 23 | return new QAccessibleQuickControl(qobject_cast<QQuickControl *>(object)); |
| 24 | |
| 25 | return nullptr; |
| 26 | } |
| 27 | #endif |
| 28 | |
| 29 | void QQuickTemplates_initializeModule() |
| 30 | { |
| 31 | #if QT_CONFIG(accessibility) |
| 32 | QAccessible::installFactory(&qQuickAccessibleFactory); |
| 33 | #endif |
| 34 | } |
| 35 | |
| 36 | Q_CONSTRUCTOR_FUNCTION(QQuickTemplates_initializeModule) |
| 37 | |
| 38 | QT_END_NAMESPACE |
| 39 |
