1// Copyright (C) 2016 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 "qquickaccessiblefactory_p.h"
5
6#include "qaccessiblequickview_p.h"
7#include "qaccessiblequickitem_p.h"
8#include <QtQuick/private/qquickitem_p.h>
9
10QT_BEGIN_NAMESPACE
11#if QT_CONFIG(accessibility)
12
13QAccessibleInterface *qQuickAccessibleFactory(const QString &classname, QObject *object)
14{
15 if (classname == QLatin1String("QQuickWindow")) {
16 return new QAccessibleQuickWindow(qobject_cast<QQuickWindow *>(object));
17 } else if (classname == QLatin1String("QQuickItem")) {
18 QQuickItem *item = qobject_cast<QQuickItem *>(o: object);
19 Q_ASSERT(item);
20 QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
21 if (!itemPrivate->isAccessible)
22 return nullptr;
23 return new QAccessibleQuickItem(item);
24 }
25
26 return nullptr;
27}
28
29#endif
30QT_END_NAMESPACE
31

source code of qtdeclarative/src/quick/accessible/qquickaccessiblefactory.cpp