Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickaccessiblefactory.cpp
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
6
9#include <QtQuick/private/qquickitem_p.h>
10
11QT_BEGIN_NAMESPACE
12#if QT_CONFIG(accessibility)
13
14QAccessibleInterface *qQuickAccessibleFactory(const QString &classname, QObject *object)
15{
16 if (classname == QLatin1String("QQuickWindow")) {
17 return new QAccessibleQuickWindow(qobject_cast<QQuickWindow *>(object));
18 } else if (classname == QLatin1String("QQuickItem")) {
19 QQuickItem *item = qobject_cast<QQuickItem *>(object);
20 Q_ASSERT(item);
21 QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
22 if (!itemPrivate->isAccessible)
23 return nullptr;
24 return new QAccessibleQuickItem(item);
25 }
26
27 return nullptr;
28}
29
30#endif
31QT_END_NAMESPACE