summaryrefslogtreecommitdiffstats
path: root/src/widgets/accessible/qaccessiblewidgetfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/accessible/qaccessiblewidgetfactory.cpp')
-rw-r--r--src/widgets/accessible/qaccessiblewidgetfactory.cpp147
1 files changed, 57 insertions, 90 deletions
diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp
index 4c6a6fdecb..664e35a6e7 100644
--- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp
+++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qaccessiblewidgets_p.h"
#include "qaccessiblemenu_p.h"
@@ -56,10 +20,12 @@
#include <qvariant.h>
#include <qaccessible.h>
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *object)
{
QAccessibleInterface *iface = nullptr;
@@ -77,154 +43,155 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
if (false) {
#if QT_CONFIG(lineedit)
- } else if (classname == QLatin1String("QLineEdit")) {
- if (widget->objectName() == QLatin1String("qt_spinbox_lineedit"))
+ } else if (classname == "QLineEdit"_L1) {
+ if (widget->objectName() == "qt_spinbox_lineedit"_L1)
iface = nullptr;
else
iface = new QAccessibleLineEdit(widget);
#endif
#if QT_CONFIG(combobox)
- } else if (classname == QLatin1String("QComboBox")) {
+ } else if (classname == "QComboBox"_L1) {
iface = new QAccessibleComboBox(widget);
#endif
#if QT_CONFIG(spinbox)
- } else if (classname == QLatin1String("QAbstractSpinBox")) {
+ } else if (classname == "QAbstractSpinBox"_L1) {
iface = new QAccessibleAbstractSpinBox(widget);
- } else if (classname == QLatin1String("QSpinBox")) {
+ } else if (classname == "QSpinBox"_L1) {
iface = new QAccessibleSpinBox(widget);
- } else if (classname == QLatin1String("QDoubleSpinBox")) {
+ } else if (classname == "QDoubleSpinBox"_L1) {
iface = new QAccessibleDoubleSpinBox(widget);
#endif
#if QT_CONFIG(scrollbar)
- } else if (classname == QLatin1String("QScrollBar")) {
+ } else if (classname == "QScrollBar"_L1) {
iface = new QAccessibleScrollBar(widget);
#endif
#if QT_CONFIG(slider)
- } else if (classname == QLatin1String("QAbstractSlider")) {
+ } else if (classname == "QAbstractSlider"_L1) {
iface = new QAccessibleAbstractSlider(widget);
- } else if (classname == QLatin1String("QSlider")) {
+ } else if (classname == "QSlider"_L1) {
iface = new QAccessibleSlider(widget);
#endif
#if QT_CONFIG(toolbutton)
- } else if (classname == QLatin1String("QToolButton")) {
+ } else if (classname == "QToolButton"_L1) {
iface = new QAccessibleToolButton(widget);
#endif // QT_CONFIG(toolbutton)
#if QT_CONFIG(abstractbutton)
- } else if (classname == QLatin1String("QCheckBox")
- || classname == QLatin1String("QRadioButton")
- || classname == QLatin1String("QPushButton")
- || classname == QLatin1String("QAbstractButton")) {
+ } else if (classname == "QCheckBox"_L1
+ || classname == "QRadioButton"_L1
+ || classname == "QPushButton"_L1
+ || classname == "QAbstractButton"_L1) {
iface = new QAccessibleButton(widget);
#endif
- } else if (classname == QLatin1String("QDialog")) {
+ } else if (classname == "QDialog"_L1) {
iface = new QAccessibleWidget(widget, QAccessible::Dialog);
- } else if (classname == QLatin1String("QMessageBox")) {
- iface = new QAccessibleWidget(widget, QAccessible::AlertMessage);
+#if QT_CONFIG(messagebox)
+ } else if (classname == "QMessageBox"_L1) {
+ iface = new QAccessibleMessageBox(widget);
+#endif
#if QT_CONFIG(mainwindow)
- } else if (classname == QLatin1String("QMainWindow")) {
+ } else if (classname == "QMainWindow"_L1) {
iface = new QAccessibleMainWindow(widget);
#endif
- } else if (classname == QLatin1String("QLabel") || classname == QLatin1String("QLCDNumber")) {
+ } else if (classname == "QLabel"_L1 || classname == "QLCDNumber"_L1) {
iface = new QAccessibleDisplay(widget);
#if QT_CONFIG(groupbox)
- } else if (classname == QLatin1String("QGroupBox")) {
+ } else if (classname == "QGroupBox"_L1) {
iface = new QAccessibleGroupBox(widget);
#endif
- } else if (classname == QLatin1String("QStatusBar")) {
+ } else if (classname == "QStatusBar"_L1) {
iface = new QAccessibleDisplay(widget);
#if QT_CONFIG(progressbar)
- } else if (classname == QLatin1String("QProgressBar")) {
+ } else if (classname == "QProgressBar"_L1) {
iface = new QAccessibleProgressBar(widget);
#endif
- } else if (classname == QLatin1String("QToolBar")) {
+ } else if (classname == "QToolBar"_L1) {
iface = new QAccessibleWidget(widget, QAccessible::ToolBar, widget->windowTitle());
#if QT_CONFIG(menubar)
- } else if (classname == QLatin1String("QMenuBar")) {
+ } else if (classname == "QMenuBar"_L1) {
iface = new QAccessibleMenuBar(widget);
#endif
#if QT_CONFIG(menu)
- } else if (classname == QLatin1String("QMenu")) {
+ } else if (classname == "QMenu"_L1) {
iface = new QAccessibleMenu(widget);
#endif
#if QT_CONFIG(treeview)
- } else if (classname == QLatin1String("QTreeView")) {
+ } else if (classname == "QTreeView"_L1) {
iface = new QAccessibleTree(widget);
#endif // QT_CONFIG(treeview)
#if QT_CONFIG(itemviews)
- } else if (classname == QLatin1String("QTableView") || classname == QLatin1String("QListView")) {
+ } else if (classname == "QTableView"_L1 || classname == "QListView"_L1) {
iface = new QAccessibleTable(widget);
- // ### This should be cleaned up. We return the parent for the scrollarea to hide it.
#endif // QT_CONFIG(itemviews)
#if QT_CONFIG(tabbar)
- } else if (classname == QLatin1String("QTabBar")) {
+ } else if (classname == "QTabBar"_L1) {
iface = new QAccessibleTabBar(widget);
#endif
- } else if (classname == QLatin1String("QSizeGrip")) {
+ } else if (classname == "QSizeGrip"_L1) {
iface = new QAccessibleWidget(widget, QAccessible::Grip);
#if QT_CONFIG(splitter)
- } else if (classname == QLatin1String("QSplitter")) {
+ } else if (classname == "QSplitter"_L1) {
iface = new QAccessibleWidget(widget, QAccessible::Splitter);
- } else if (classname == QLatin1String("QSplitterHandle")) {
+ } else if (classname == "QSplitterHandle"_L1) {
iface = new QAccessibleWidget(widget, QAccessible::Grip);
#endif
#if QT_CONFIG(textedit) && !defined(QT_NO_CURSOR)
- } else if (classname == QLatin1String("QTextEdit")) {
+ } else if (classname == "QTextEdit"_L1) {
iface = new QAccessibleTextEdit(widget);
- } else if (classname == QLatin1String("QPlainTextEdit")) {
+ } else if (classname == "QPlainTextEdit"_L1) {
iface = new QAccessiblePlainTextEdit(widget);
#endif
- } else if (classname == QLatin1String("QTipLabel")) {
+ } else if (classname == "QTipLabel"_L1) {
iface = new QAccessibleDisplay(widget, QAccessible::ToolTip);
- } else if (classname == QLatin1String("QFrame")) {
+ } else if (classname == "QFrame"_L1) {
iface = new QAccessibleWidget(widget, QAccessible::Border);
#if QT_CONFIG(stackedwidget)
- } else if (classname == QLatin1String("QStackedWidget")) {
+ } else if (classname == "QStackedWidget"_L1) {
iface = new QAccessibleStackedWidget(widget);
#endif
#if QT_CONFIG(toolbox)
- } else if (classname == QLatin1String("QToolBox")) {
+ } else if (classname == "QToolBox"_L1) {
iface = new QAccessibleToolBox(widget);
#endif
#if QT_CONFIG(mdiarea)
- } else if (classname == QLatin1String("QMdiArea")) {
+ } else if (classname == "QMdiArea"_L1) {
iface = new QAccessibleMdiArea(widget);
- } else if (classname == QLatin1String("QMdiSubWindow")) {
+ } else if (classname == "QMdiSubWindow"_L1) {
iface = new QAccessibleMdiSubWindow(widget);
#endif
#if QT_CONFIG(dialogbuttonbox)
- } else if (classname == QLatin1String("QDialogButtonBox")) {
+ } else if (classname == "QDialogButtonBox"_L1) {
iface = new QAccessibleDialogButtonBox(widget);
#endif
#if QT_CONFIG(dial)
- } else if (classname == QLatin1String("QDial")) {
+ } else if (classname == "QDial"_L1) {
iface = new QAccessibleDial(widget);
#endif
#if QT_CONFIG(rubberband)
- } else if (classname == QLatin1String("QRubberBand")) {
+ } else if (classname == "QRubberBand"_L1) {
iface = new QAccessibleWidget(widget, QAccessible::Border);
#endif
#if QT_CONFIG(textbrowser) && !defined(QT_NO_CURSOR)
- } else if (classname == QLatin1String("QTextBrowser")) {
+ } else if (classname == "QTextBrowser"_L1) {
iface = new QAccessibleTextBrowser(widget);
#endif
#if QT_CONFIG(scrollarea)
- } else if (classname == QLatin1String("QAbstractScrollArea")) {
+ } else if (classname == "QAbstractScrollArea"_L1) {
iface = new QAccessibleAbstractScrollArea(widget);
- } else if (classname == QLatin1String("QScrollArea")) {
+ } else if (classname == "QScrollArea"_L1) {
iface = new QAccessibleScrollArea(widget);
#endif
#if QT_CONFIG(calendarwidget)
- } else if (classname == QLatin1String("QCalendarWidget")) {
+ } else if (classname == "QCalendarWidget"_L1) {
iface = new QAccessibleCalendarWidget(widget);
#endif
#if QT_CONFIG(dockwidget)
- } else if (classname == QLatin1String("QDockWidget")) {
+ } else if (classname == "QDockWidget"_L1) {
iface = new QAccessibleDockWidget(widget);
#endif
- } else if (classname == QLatin1String("QWidget")) {
+ } else if (classname == "QWidget"_L1) {
iface = new QAccessibleWidget(widget);
- } else if (classname == QLatin1String("QWindowContainer")) {
+ } else if (classname == "QWindowContainer"_L1) {
iface = new QAccessibleWindowContainer(widget);
}
@@ -233,4 +200,4 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
QT_END_NAMESPACE
-#endif // QT_NO_ACCESSIBILITY
+#endif // QT_CONFIG(accessibility)