qaccessiblewidgetfactory.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/accessible/qaccessiblewidgetfactory.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the plugins of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include "qaccessiblewidgets_p.h"-
41#include "qaccessiblemenu_p.h"-
42#include "private/qwidget_p.h"-
43#include "simplewidgets_p.h"-
44#include "rangecontrols_p.h"-
45#include "complexwidgets_p.h"-
46#include "itemviews_p.h"-
47-
48#include <qpushbutton.h>-
49#include <qtoolbutton.h>-
50#include <qtreeview.h>-
51#include <qvariant.h>-
52#include <qaccessible.h>-
53-
54#ifndef QT_NO_ACCESSIBILITY-
55-
56QT_BEGIN_NAMESPACE-
57-
58QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *object)-
59{-
60 QAccessibleInterface *iface = 0;-
61 if (!object || !object->isWidgetType())
!objectDescription
TRUEnever evaluated
FALSEnever evaluated
!object->isWidgetType()Description
TRUEnever evaluated
FALSEnever evaluated
0
62 return iface;
never executed: return iface;
0
63-
64 QWidget *widget = static_cast<QWidget*>(object);-
65 // QWidget emits destroyed() from its destructor instead of letting the QObject-
66 // destructor do it, which means the QWidget is unregistered from the accessibillity-
67 // cache. But QWidget destruction also emits enter and leave events, which may end-
68 // up here, so we have to ensure that we don't fill the cache with an entry of-
69 // a widget that is going away.-
70 if (QWidgetPrivate::get(widget)->data.in_destructor)
QWidgetPrivate....in_destructorDescription
TRUEnever evaluated
FALSEnever evaluated
0
71 return iface;
never executed: return iface;
0
72-
73 if (false) {
dead code: { }
-
74#ifndef QT_NO_LINEEDIT
dead code: { }
-
75 } else if (classname == QLatin1String("QLineEdit")) {
classname == Q...g("QLineEdit")Description
TRUEnever evaluated
FALSEnever evaluated
dead code: { }
-
76 if (widget->objectName() == QLatin1String("qt_spinbox_lineedit"))
widget->object...box_lineedit")Description
TRUEnever evaluated
FALSEnever evaluated
0
77 iface = 0;
never executed: iface = 0;
0
78 else-
79 iface = new QAccessibleLineEdit(widget);
never executed: iface = new QAccessibleLineEdit(widget);
0
80#endif-
81#ifndef QT_NO_COMBOBOX-
82 } else if (classname == QLatin1String("QComboBox")) {
classname == Q...g("QComboBox")Description
TRUEnever evaluated
FALSEnever evaluated
0
83 iface = new QAccessibleComboBox(widget);-
84#endif-
85#ifndef QT_NO_SPINBOX-
86 } else if (classname == QLatin1String("QAbstractSpinBox")) {
never executed: end of block
classname == Q...tractSpinBox")Description
TRUEnever evaluated
FALSEnever evaluated
0
87 iface = new QAccessibleAbstractSpinBox(widget);-
88 } else if (classname == QLatin1String("QSpinBox")) {
never executed: end of block
classname == Q...ng("QSpinBox")Description
TRUEnever evaluated
FALSEnever evaluated
0
89 iface = new QAccessibleSpinBox(widget);-
90 } else if (classname == QLatin1String("QDoubleSpinBox")) {
never executed: end of block
classname == Q...oubleSpinBox")Description
TRUEnever evaluated
FALSEnever evaluated
0
91 iface = new QAccessibleDoubleSpinBox(widget);-
92#endif-
93#ifndef QT_NO_SCROLLBAR-
94 } else if (classname == QLatin1String("QScrollBar")) {
never executed: end of block
classname == Q...("QScrollBar")Description
TRUEnever evaluated
FALSEnever evaluated
0
95 iface = new QAccessibleScrollBar(widget);-
96#endif-
97 } else if (classname == QLatin1String("QAbstractSlider")) {
never executed: end of block
classname == Q...stractSlider")Description
TRUEnever evaluated
FALSEnever evaluated
0
98 iface = new QAccessibleAbstractSlider(widget);-
99#ifndef QT_NO_SLIDER-
100 } else if (classname == QLatin1String("QSlider")) {
never executed: end of block
classname == Q...ing("QSlider")Description
TRUEnever evaluated
FALSEnever evaluated
0
101 iface = new QAccessibleSlider(widget);-
102#endif-
103#ifndef QT_NO_TOOLBUTTON-
104 } else if (classname == QLatin1String("QToolButton")) {
never executed: end of block
classname == Q..."QToolButton")Description
TRUEnever evaluated
FALSEnever evaluated
0
105 iface = new QAccessibleToolButton(widget);-
106#endif // QT_NO_TOOLBUTTON-
107 } else if (classname == QLatin1String("QCheckBox")
never executed: end of block
classname == Q...g("QCheckBox")Description
TRUEnever evaluated
FALSEnever evaluated
0
108 || classname == QLatin1String("QRadioButton")
classname == Q...QRadioButton")Description
TRUEnever evaluated
FALSEnever evaluated
0
109 || classname == QLatin1String("QPushButton")
classname == Q..."QPushButton")Description
TRUEnever evaluated
FALSEnever evaluated
0
110 || classname == QLatin1String("QAbstractButton")) {
classname == Q...stractButton")Description
TRUEnever evaluated
FALSEnever evaluated
0
111 iface = new QAccessibleButton(widget);-
112 } else if (classname == QLatin1String("QDialog")) {
never executed: end of block
classname == Q...ing("QDialog")Description
TRUEnever evaluated
FALSEnever evaluated
0
113 iface = new QAccessibleWidget(widget, QAccessible::Dialog);-
114 } else if (classname == QLatin1String("QMessageBox")) {
never executed: end of block
classname == Q..."QMessageBox")Description
TRUEnever evaluated
FALSEnever evaluated
0
115 iface = new QAccessibleWidget(widget, QAccessible::AlertMessage);-
116#ifndef QT_NO_MAINWINDOW-
117 } else if (classname == QLatin1String("QMainWindow")) {
never executed: end of block
classname == Q..."QMainWindow")Description
TRUEnever evaluated
FALSEnever evaluated
0
118 iface = new QAccessibleMainWindow(widget);-
119#endif-
120 } else if (classname == QLatin1String("QLabel") || classname == QLatin1String("QLCDNumber")) {
never executed: end of block
classname == Q...ring("QLabel")Description
TRUEnever evaluated
FALSEnever evaluated
classname == Q...("QLCDNumber")Description
TRUEnever evaluated
FALSEnever evaluated
0
121 iface = new QAccessibleDisplay(widget);-
122#ifndef QT_NO_GROUPBOX-
123 } else if (classname == QLatin1String("QGroupBox")) {
never executed: end of block
classname == Q...g("QGroupBox")Description
TRUEnever evaluated
FALSEnever evaluated
0
124 iface = new QAccessibleGroupBox(widget);-
125#endif-
126 } else if (classname == QLatin1String("QStatusBar")) {
never executed: end of block
classname == Q...("QStatusBar")Description
TRUEnever evaluated
FALSEnever evaluated
0
127 iface = new QAccessibleDisplay(widget);-
128#ifndef QT_NO_PROGRESSBAR-
129 } else if (classname == QLatin1String("QProgressBar")) {
never executed: end of block
classname == Q...QProgressBar")Description
TRUEnever evaluated
FALSEnever evaluated
0
130 iface = new QAccessibleProgressBar(widget);-
131#endif-
132 } else if (classname == QLatin1String("QToolBar")) {
never executed: end of block
classname == Q...ng("QToolBar")Description
TRUEnever evaluated
FALSEnever evaluated
0
133 iface = new QAccessibleWidget(widget, QAccessible::ToolBar, widget->windowTitle());-
134#ifndef QT_NO_MENUBAR-
135 } else if (classname == QLatin1String("QMenuBar")) {
never executed: end of block
classname == Q...ng("QMenuBar")Description
TRUEnever evaluated
FALSEnever evaluated
0
136 iface = new QAccessibleMenuBar(widget);-
137#endif-
138#ifndef QT_NO_MENU-
139 } else if (classname == QLatin1String("QMenu")) {
never executed: end of block
classname == Q...tring("QMenu")Description
TRUEnever evaluated
FALSEnever evaluated
0
140 iface = new QAccessibleMenu(widget);-
141#endif-
142#ifndef QT_NO_ITEMVIEWS-
143 } else if (classname == QLatin1String("QTreeView")) {
never executed: end of block
classname == Q...g("QTreeView")Description
TRUEnever evaluated
FALSEnever evaluated
0
144 iface = new QAccessibleTree(widget);-
145 } else if (classname == QLatin1String("QTableView") || classname == QLatin1String("QListView")) {
never executed: end of block
classname == Q...("QTableView")Description
TRUEnever evaluated
FALSEnever evaluated
classname == Q...g("QListView")Description
TRUEnever evaluated
FALSEnever evaluated
0
146 iface = new QAccessibleTable(widget);-
147 // ### This should be cleaned up. We return the parent for the scrollarea to hide it.-
148#endif // QT_NO_ITEMVIEWS-
149#ifndef QT_NO_TABBAR-
150 } else if (classname == QLatin1String("QTabBar")) {
never executed: end of block
classname == Q...ing("QTabBar")Description
TRUEnever evaluated
FALSEnever evaluated
0
151 iface = new QAccessibleTabBar(widget);-
152#endif-
153 } else if (classname == QLatin1String("QSizeGrip")) {
never executed: end of block
classname == Q...g("QSizeGrip")Description
TRUEnever evaluated
FALSEnever evaluated
0
154 iface = new QAccessibleWidget(widget, QAccessible::Grip);-
155#ifndef QT_NO_SPLITTER-
156 } else if (classname == QLatin1String("QSplitter")) {
never executed: end of block
classname == Q...g("QSplitter")Description
TRUEnever evaluated
FALSEnever evaluated
0
157 iface = new QAccessibleWidget(widget, QAccessible::Splitter);-
158 } else if (classname == QLatin1String("QSplitterHandle")) {
never executed: end of block
classname == Q...litterHandle")Description
TRUEnever evaluated
FALSEnever evaluated
0
159 iface = new QAccessibleWidget(widget, QAccessible::Grip);-
160#endif-
161#if !defined(QT_NO_TEXTEDIT) && !defined(QT_NO_CURSOR)-
162 } else if (classname == QLatin1String("QTextEdit")) {
never executed: end of block
classname == Q...g("QTextEdit")Description
TRUEnever evaluated
FALSEnever evaluated
0
163 iface = new QAccessibleTextEdit(widget);-
164 } else if (classname == QLatin1String("QPlainTextEdit")) {
never executed: end of block
classname == Q...lainTextEdit")Description
TRUEnever evaluated
FALSEnever evaluated
0
165 iface = new QAccessiblePlainTextEdit(widget);-
166#endif-
167 } else if (classname == QLatin1String("QTipLabel")) {
never executed: end of block
classname == Q...g("QTipLabel")Description
TRUEnever evaluated
FALSEnever evaluated
0
168 iface = new QAccessibleDisplay(widget, QAccessible::ToolTip);-
169 } else if (classname == QLatin1String("QFrame")) {
never executed: end of block
classname == Q...ring("QFrame")Description
TRUEnever evaluated
FALSEnever evaluated
0
170 iface = new QAccessibleWidget(widget, QAccessible::Border);-
171#ifndef QT_NO_STACKEDWIDGET-
172 } else if (classname == QLatin1String("QStackedWidget")) {
never executed: end of block
classname == Q...tackedWidget")Description
TRUEnever evaluated
FALSEnever evaluated
0
173 iface = new QAccessibleStackedWidget(widget);-
174#endif-
175#ifndef QT_NO_TOOLBOX-
176 } else if (classname == QLatin1String("QToolBox")) {
never executed: end of block
classname == Q...ng("QToolBox")Description
TRUEnever evaluated
FALSEnever evaluated
0
177 iface = new QAccessibleToolBox(widget);-
178#endif-
179#ifndef QT_NO_MDIAREA-
180 } else if (classname == QLatin1String("QMdiArea")) {
never executed: end of block
classname == Q...ng("QMdiArea")Description
TRUEnever evaluated
FALSEnever evaluated
0
181 iface = new QAccessibleMdiArea(widget);-
182 } else if (classname == QLatin1String("QMdiSubWindow")) {
never executed: end of block
classname == Q...MdiSubWindow")Description
TRUEnever evaluated
FALSEnever evaluated
0
183 iface = new QAccessibleMdiSubWindow(widget);-
184#endif-
185 } else if (classname == QLatin1String("QDialogButtonBox")) {
never executed: end of block
classname == Q...logButtonBox")Description
TRUEnever evaluated
FALSEnever evaluated
0
186 iface = new QAccessibleDialogButtonBox(widget);-
187#ifndef QT_NO_DIAL-
188 } else if (classname == QLatin1String("QDial")) {
never executed: end of block
classname == Q...tring("QDial")Description
TRUEnever evaluated
FALSEnever evaluated
0
189 iface = new QAccessibleDial(widget);-
190#endif-
191#ifndef QT_NO_RUBBERBAND-
192 } else if (classname == QLatin1String("QRubberBand")) {
never executed: end of block
classname == Q..."QRubberBand")Description
TRUEnever evaluated
FALSEnever evaluated
0
193 iface = new QAccessibleWidget(widget, QAccessible::Border);-
194#endif-
195#if !defined(QT_NO_TEXTBROWSER) && !defined(QT_NO_CURSOR)-
196 } else if (classname == QLatin1String("QTextBrowser")) {
never executed: end of block
classname == Q...QTextBrowser")Description
TRUEnever evaluated
FALSEnever evaluated
0
197 iface = new QAccessibleTextBrowser(widget);-
198#endif-
199#ifndef QT_NO_SCROLLAREA-
200 } else if (classname == QLatin1String("QAbstractScrollArea")) {
never executed: end of block
classname == Q...ctScrollArea")Description
TRUEnever evaluated
FALSEnever evaluated
0
201 iface = new QAccessibleAbstractScrollArea(widget);-
202 } else if (classname == QLatin1String("QScrollArea")) {
never executed: end of block
classname == Q..."QScrollArea")Description
TRUEnever evaluated
FALSEnever evaluated
0
203 iface = new QAccessibleScrollArea(widget);-
204#endif-
205#ifndef QT_NO_CALENDARWIDGET-
206 } else if (classname == QLatin1String("QCalendarWidget")) {
never executed: end of block
classname == Q...lendarWidget")Description
TRUEnever evaluated
FALSEnever evaluated
0
207 iface = new QAccessibleCalendarWidget(widget);-
208#endif-
209#ifndef QT_NO_DOCKWIDGET-
210 } else if (classname == QLatin1String("QDockWidget")) {
never executed: end of block
classname == Q..."QDockWidget")Description
TRUEnever evaluated
FALSEnever evaluated
0
211 iface = new QAccessibleDockWidget(widget);-
212#endif-
213-
214 } else if (classname == QLatin1String("QDesktopScreenWidget")) {
never executed: end of block
classname == Q...ScreenWidget")Description
TRUEnever evaluated
FALSEnever evaluated
0
215 iface = 0;-
216 } else if (classname == QLatin1String("QWidget")) {
never executed: end of block
classname == Q...ing("QWidget")Description
TRUEnever evaluated
FALSEnever evaluated
0
217 iface = new QAccessibleWidget(widget);-
218 } else if (classname == QLatin1String("QWindowContainer")) {
never executed: end of block
classname == Q...dowContainer")Description
TRUEnever evaluated
FALSEnever evaluated
0
219 iface = new QAccessibleWindowContainer(widget);-
220 }
never executed: end of block
0
221-
222 return iface;
never executed: return iface;
0
223}-
224-
225QT_END_NAMESPACE-
226-
227#endif // QT_NO_ACCESSIBILITY-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9