Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
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 | | - |
56 | QT_BEGIN_NAMESPACE | - |
57 | | - |
58 | QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *object) | - |
59 | { | - |
60 | QAccessibleInterface *iface = 0; | - |
61 | if (!object || !object->isWidgetType())TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
62 | return iface; never executed: return iface; | 0 |
63 | | - |
64 | QWidget *widget = static_cast<QWidget*>(object); | - |
65 | | - |
66 | | - |
67 | | - |
68 | | - |
69 | | - |
70 | if (QWidgetPrivate::get(widget)->data.in_destructor)TRUE | never evaluated | FALSE | never 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")) {TRUE | never evaluated | FALSE | never evaluated |
dead code: { } | - |
76 | if (widget->objectName() == QLatin1String("qt_spinbox_lineedit"))TRUE | never evaluated | FALSE | never 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")) {TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never evaluated |
| 0 |
87 | iface = new QAccessibleAbstractSpinBox(widget); | - |
88 | } else if (classname == QLatin1String("QSpinBox")) { never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
| 0 |
89 | iface = new QAccessibleSpinBox(widget); | - |
90 | } else if (classname == QLatin1String("QDoubleSpinBox")) { never executed: end of block TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never evaluated |
| 0 |
95 | iface = new QAccessibleScrollBar(widget); | - |
96 | #endif | - |
97 | } else if (classname == QLatin1String("QAbstractSlider")) { never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
| 0 |
98 | iface = new QAccessibleAbstractSlider(widget); | - |
99 | #ifndef QT_NO_SLIDER | - |
100 | } else if (classname == QLatin1String("QSlider")) { never executed: end of block TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never evaluated |
| 0 |
105 | iface = new QAccessibleToolButton(widget); | - |
106 | #endif // QT_NO_TOOLBUTTON | - |
107 | } else if (classname == QLatin1String("QCheckBox") never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
| 0 |
108 | || classname == QLatin1String("QRadioButton")TRUE | never evaluated | FALSE | never evaluated |
| 0 |
109 | || classname == QLatin1String("QPushButton")TRUE | never evaluated | FALSE | never evaluated |
| 0 |
110 | || classname == QLatin1String("QAbstractButton")) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
111 | iface = new QAccessibleButton(widget); | - |
112 | } else if (classname == QLatin1String("QDialog")) { never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
| 0 |
113 | iface = new QAccessibleWidget(widget, QAccessible::Dialog); | - |
114 | } else if (classname == QLatin1String("QMessageBox")) { never executed: end of block TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never evaluated |
| 0 |
118 | iface = new QAccessibleMainWindow(widget); | - |
119 | #endif | - |
120 | } else if (classname == QLatin1String("QLabel") || classname == QLatin1String("QLCDNumber")) { never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
121 | iface = new QAccessibleDisplay(widget); | - |
122 | #ifndef QT_NO_GROUPBOX | - |
123 | } else if (classname == QLatin1String("QGroupBox")) { never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
| 0 |
124 | iface = new QAccessibleGroupBox(widget); | - |
125 | #endif | - |
126 | } else if (classname == QLatin1String("QStatusBar")) { never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
| 0 |
127 | iface = new QAccessibleDisplay(widget); | - |
128 | #ifndef QT_NO_PROGRESSBAR | - |
129 | } else if (classname == QLatin1String("QProgressBar")) { never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
| 0 |
130 | iface = new QAccessibleProgressBar(widget); | - |
131 | #endif | - |
132 | } else if (classname == QLatin1String("QToolBar")) { never executed: end of block TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never evaluated |
| 0 |
144 | iface = new QAccessibleTree(widget); | - |
145 | } else if (classname == QLatin1String("QTableView") || classname == QLatin1String("QListView")) { never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
146 | iface = new QAccessibleTable(widget); | - |
147 | | - |
148 | #endif // QT_NO_ITEMVIEWS | - |
149 | #ifndef QT_NO_TABBAR | - |
150 | } else if (classname == QLatin1String("QTabBar")) { never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
| 0 |
151 | iface = new QAccessibleTabBar(widget); | - |
152 | #endif | - |
153 | } else if (classname == QLatin1String("QSizeGrip")) { never executed: end of block TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never evaluated |
| 0 |
157 | iface = new QAccessibleWidget(widget, QAccessible::Splitter); | - |
158 | } else if (classname == QLatin1String("QSplitterHandle")) { never executed: end of block TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never evaluated |
| 0 |
163 | iface = new QAccessibleTextEdit(widget); | - |
164 | } else if (classname == QLatin1String("QPlainTextEdit")) { never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
| 0 |
165 | iface = new QAccessiblePlainTextEdit(widget); | - |
166 | #endif | - |
167 | } else if (classname == QLatin1String("QTipLabel")) { never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
| 0 |
168 | iface = new QAccessibleDisplay(widget, QAccessible::ToolTip); | - |
169 | } else if (classname == QLatin1String("QFrame")) { never executed: end of block TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never evaluated |
| 0 |
181 | iface = new QAccessibleMdiArea(widget); | - |
182 | } else if (classname == QLatin1String("QMdiSubWindow")) { never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
| 0 |
183 | iface = new QAccessibleMdiSubWindow(widget); | - |
184 | #endif | - |
185 | } else if (classname == QLatin1String("QDialogButtonBox")) { never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
| 0 |
186 | iface = new QAccessibleDialogButtonBox(widget); | - |
187 | #ifndef QT_NO_DIAL | - |
188 | } else if (classname == QLatin1String("QDial")) { never executed: end of block TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never evaluated |
| 0 |
201 | iface = new QAccessibleAbstractScrollArea(widget); | - |
202 | } else if (classname == QLatin1String("QScrollArea")) { never executed: end of block TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never 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 TRUE | never evaluated | FALSE | never evaluated |
| 0 |
211 | iface = new QAccessibleDockWidget(widget); | - |
212 | #endif | - |
213 | | - |
214 | } else if (classname == QLatin1String("QDesktopScreenWidget")) { never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
| 0 |
215 | iface = 0; | - |
216 | } else if (classname == QLatin1String("QWidget")) { never executed: end of block TRUE | never evaluated | FALSE | never evaluated |
| 0 |
217 | iface = new QAccessibleWidget(widget); | - |
218 | } else if (classname == QLatin1String("QWindowContainer")) { never executed: end of block TRUE | never evaluated | FALSE | never 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 | | - |
225 | QT_END_NAMESPACE | - |
226 | | - |
227 | #endif // QT_NO_ACCESSIBILITY | - |
| | |