simplewidgets.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/accessible/simplewidgets.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11extern QList<QWidget*> childWidgets(const QWidget *widget);-
12-
13QString qt_accStripAmp(const QString &text);-
14QString qt_accHotKey(const QString &text);-
15QAccessibleButton::QAccessibleButton(QWidget *w)-
16: QAccessibleWidget(w)-
17{-
18 ((!(button())) ? qt_assert("button()",__FILE__,89) : qt_noop());-
19-
20-
21-
22 if (button()->isCheckable()
button()->isCheckable()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
23 addControllingSignal(QLatin1String("toggled(bool)"));
never executed: addControllingSignal(QLatin1String("toggled(bool)"));
0
24 else-
25 addControllingSignal(QLatin1String("clicked()"));
never executed: addControllingSignal(QLatin1String("clicked()"));
0
26}-
27-
28-
29QAbstractButton *QAccessibleButton::button() const-
30{-
31 return
never executed: return qobject_cast<QAbstractButton*>(object());
qobject_cast<QAbstractButton*>(object());
never executed: return qobject_cast<QAbstractButton*>(object());
0
32}-
33-
34-
35QString QAccessibleButton::text(QAccessible::Text t) const-
36{-
37 QString str;-
38 switch (t) {-
39 case
never executed: case QAccessible::Accelerator:
QAccessible::Accelerator:
never executed: case QAccessible::Accelerator:
0
40 {-
41-
42 QPushButton *pb = qobject_cast<QPushButton*>(object());-
43 if (pb
pbDescription
TRUEnever evaluated
FALSEnever evaluated
&& pb->isDefault()
pb->isDefault()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
44 str = QKeySequence(Qt::Key_Enter).toString(QKeySequence::NativeText);
never executed: str = QKeySequence(Qt::Key_Enter).toString(QKeySequence::NativeText);
0
45-
46 if (str.isEmpty()
str.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
47 str = qt_accHotKey(button()->text());
never executed: str = qt_accHotKey(button()->text());
0
48 }-
49 break;
never executed: break;
0
50 case
never executed: case QAccessible::Name:
QAccessible::Name:
never executed: case QAccessible::Name:
0
51 str = widget()->accessibleName();-
52 if (str.isEmpty()
str.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
53 str = qt_accStripAmp(button()->text());
never executed: str = qt_accStripAmp(button()->text());
0
54 break;
never executed: break;
0
55 default
never executed: default:
:
never executed: default:
0
56 break;
never executed: break;
0
57 }-
58 if (str.isEmpty()
str.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
59 str = QAccessibleWidget::text(t);
never executed: str = QAccessibleWidget::text(t);
0
60 return
never executed: return str;
str;
never executed: return str;
0
61}-
62-
63QAccessible::State QAccessibleButton::state() const-
64{-
65 QAccessible::State state = QAccessibleWidget::state();-
66-
67 QAbstractButton *b = button();-
68 QCheckBox *cb = qobject_cast<QCheckBox *>(b);-
69 if (b->isCheckable()
b->isCheckable()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
70 state.checkable = true;
never executed: state.checkable = true;
0
71 if (b->isChecked()
b->isChecked()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
72 state.checked = true;
never executed: state.checked = true;
0
73 else if (cb
cbDescription
TRUEnever evaluated
FALSEnever evaluated
&& cb->checkState() == Qt::PartiallyChecked
cb->checkState...rtiallyCheckedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
74 state.checkStateMixed = true;
never executed: state.checkStateMixed = true;
0
75 if (b->isDown()
b->isDown()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
76 state.pressed = true;
never executed: state.pressed = true;
0
77 QPushButton *pb = qobject_cast<QPushButton*>(b);-
78 if (pb
pbDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
79 if (pb->isDefault()
pb->isDefault()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
80 state.defaultButton = true;
never executed: state.defaultButton = true;
0
81-
82 if (pb->menu()
pb->menu()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
83 state.hasPopup = true;
never executed: state.hasPopup = true;
0
84-
85 }
never executed: end of block
0
86-
87 return
never executed: return state;
state;
never executed: return state;
0
88}-
89-
90QRect QAccessibleButton::rect() const-
91{-
92 QAbstractButton *ab = button();-
93 if (!ab->isVisible()
!ab->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
94 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
95-
96 if (QCheckBox *cb = qobject_cast<QCheckBox *>(ab)
QCheckBox *cb ...heckBox *>(ab)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
97 QPoint wpos = cb->mapToGlobal(QPoint(0, 0));-
98 QStyleOptionButton opt;-
99 cb->initStyleOption(&opt);-
100 return
never executed: return cb->style()->subElementRect(QStyle::SE_CheckBoxClickRect, &opt, cb).translated(wpos);
cb->style()->subElementRect(QStyle::SE_CheckBoxClickRect, &opt, cb).translated(wpos);
never executed: return cb->style()->subElementRect(QStyle::SE_CheckBoxClickRect, &opt, cb).translated(wpos);
0
101 } else if (QRadioButton *rb = qobject_cast<QRadioButton *>(ab)
QRadioButton *...oButton *>(ab)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
102 QPoint wpos = rb->mapToGlobal(QPoint(0, 0));-
103 QStyleOptionButton opt;-
104 rb->initStyleOption(&opt);-
105 return
never executed: return rb->style()->subElementRect(QStyle::SE_RadioButtonClickRect, &opt, rb).translated(wpos);
rb->style()->subElementRect(QStyle::SE_RadioButtonClickRect, &opt, rb).translated(wpos);
never executed: return rb->style()->subElementRect(QStyle::SE_RadioButtonClickRect, &opt, rb).translated(wpos);
0
106 }-
107 return
never executed: return QAccessibleWidget::rect();
QAccessibleWidget::rect();
never executed: return QAccessibleWidget::rect();
0
108}-
109-
110QAccessible::Role QAccessibleButton::role() const-
111{-
112 QAbstractButton *ab = button();-
113-
114-
115 if (QPushButton *pb = qobject_cast<QPushButton*>(ab)
QPushButton *p...shButton*>(ab)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
116 if (pb->menu()
pb->menu()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
117 return
never executed: return QAccessible::ButtonMenu;
QAccessible::ButtonMenu;
never executed: return QAccessible::ButtonMenu;
0
118 }
never executed: end of block
0
119-
120-
121 if (ab->isCheckable()
ab->isCheckable()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
122 return
never executed: return ab->autoExclusive() ? QAccessible::RadioButton : QAccessible::CheckBox;
ab->autoExclusive() ? QAccessible::RadioButton : QAccessible::CheckBox;
never executed: return ab->autoExclusive() ? QAccessible::RadioButton : QAccessible::CheckBox;
0
123-
124 return
never executed: return QAccessible::Button;
QAccessible::Button;
never executed: return QAccessible::Button;
0
125}-
126-
127QStringList QAccessibleButton::actionNames() const-
128{-
129 QStringList names;-
130 if (widget()->isEnabled()
widget()->isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
131 switch (role()) {-
132 case
never executed: case QAccessible::ButtonMenu:
QAccessible::ButtonMenu:
never executed: case QAccessible::ButtonMenu:
0
133 names << showMenuAction();-
134 break;
never executed: break;
0
135 case
never executed: case QAccessible::RadioButton:
QAccessible::RadioButton:
never executed: case QAccessible::RadioButton:
0
136 names << toggleAction();-
137 break;
never executed: break;
0
138 default
never executed: default:
:
never executed: default:
0
139 if (button()->isCheckable()
button()->isCheckable()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
140 names << toggleAction();-
141 }
never executed: end of block
else {
0
142 names << pressAction();-
143 }
never executed: end of block
0
144 break;
never executed: break;
0
145 }-
146 }-
147 names << QAccessibleWidget::actionNames();-
148 return
never executed: return names;
names;
never executed: return names;
0
149}-
150-
151void QAccessibleButton::doAction(const QString &actionName)-
152{-
153 if (!widget()->isEnabled()
!widget()->isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
154 return;
never executed: return;
0
155 if (actionName == pressAction()
actionName == pressAction()Description
TRUEnever evaluated
FALSEnever evaluated
||
0
156 actionName == showMenuAction()
actionName == showMenuAction()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
157-
158 QPushButton *pb = qobject_cast<QPushButton*>(object());-
159 if (pb
pbDescription
TRUEnever evaluated
FALSEnever evaluated
&& pb->menu()
pb->menu()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
160 pb->showMenu();
never executed: pb->showMenu();
0
161 else-
162-
163 button()->animateClick();
never executed: button()->animateClick();
0
164 } else if (actionName == toggleAction()
actionName == toggleAction()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
165 button()->toggle();-
166 }
never executed: end of block
else {
0
167 QAccessibleWidget::doAction(actionName);-
168 }
never executed: end of block
0
169}-
170-
171QStringList QAccessibleButton::keyBindingsForAction(const QString &actionName) const-
172{-
173 if (actionName == pressAction()
actionName == pressAction()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
174-
175 return
never executed: return QStringList() << button()->shortcut().toString();
QStringList() << button()->shortcut().toString();
never executed: return QStringList() << button()->shortcut().toString();
0
176-
177 }-
178 return
never executed: return QStringList();
QStringList();
never executed: return QStringList();
0
179}-
180QAccessibleToolButton::QAccessibleToolButton(QWidget *w)-
181: QAccessibleButton(w)-
182{-
183 ((!(toolButton())) ? qt_assert("toolButton()",__FILE__,268) : qt_noop());-
184}
never executed: end of block
0
185-
186-
187QToolButton *QAccessibleToolButton::toolButton() const-
188{-
189 return
never executed: return qobject_cast<QToolButton*>(object());
qobject_cast<QToolButton*>(object());
never executed: return qobject_cast<QToolButton*>(object());
0
190}-
191-
192-
193-
194-
195bool QAccessibleToolButton::isSplitButton() const-
196{-
197-
198 return
never executed: return toolButton()->menu() && toolButton()->popupMode() == QToolButton::MenuButtonPopup;
toolButton()->menu() && toolButton()->popupMode() == QToolButton::MenuButtonPopup;
never executed: return toolButton()->menu() && toolButton()->popupMode() == QToolButton::MenuButtonPopup;
0
199-
200-
201-
202}-
203-
204QAccessible::State QAccessibleToolButton::state() const-
205{-
206 QAccessible::State st = QAccessibleButton::state();-
207 if (toolButton()->autoRaise()
toolButton()->autoRaise()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
208 st.hotTracked = true;
never executed: st.hotTracked = true;
0
209-
210 if (toolButton()->menu()
toolButton()->menu()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
211 st.hasPopup = true;
never executed: st.hasPopup = true;
0
212-
213 return
never executed: return st;
st;
never executed: return st;
0
214}-
215-
216int QAccessibleToolButton::childCount() const-
217{-
218 return
never executed: return isSplitButton() ? 1 : 0;
isSplitButton() ? 1 : 0;
never executed: return isSplitButton() ? 1 : 0;
0
219}-
220-
221QAccessible::Role QAccessibleToolButton::role() const-
222{-
223 QAbstractButton *ab = button();-
224-
225-
226 QToolButton *tb = qobject_cast<QToolButton*>(ab);-
227 if (!tb->menu()
!tb->menu()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
228 return
never executed: return tb->isCheckable() ? QAccessible::CheckBox : QAccessible::PushButton;
tb->isCheckable() ? QAccessible::CheckBox : QAccessible::PushButton;
never executed: return tb->isCheckable() ? QAccessible::CheckBox : QAccessible::PushButton;
0
229 else if (tb->popupMode() == QToolButton::DelayedPopup
tb->popupMode(...::DelayedPopupDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
230 return
never executed: return QAccessible::ButtonDropDown;
QAccessible::ButtonDropDown;
never executed: return QAccessible::ButtonDropDown;
0
231-
232-
233 return
never executed: return QAccessible::ButtonMenu;
QAccessible::ButtonMenu;
never executed: return QAccessible::ButtonMenu;
0
234}-
235-
236QAccessibleInterface *QAccessibleToolButton::child(int index) const-
237{-
238-
239 if (index == 0
index == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& toolButton()->menu()
toolButton()->menu()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
240 {-
241 return
never executed: return QAccessible::queryAccessibleInterface(toolButton()->menu());
QAccessible::queryAccessibleInterface(toolButton()->menu());
never executed: return QAccessible::queryAccessibleInterface(toolButton()->menu());
0
242 }-
243-
244 return
never executed: return 0;
0;
never executed: return 0;
0
245}-
246-
247-
248-
249-
250-
251-
252-
253QStringList QAccessibleToolButton::actionNames() const-
254{-
255 QStringList names;-
256 if (widget()->isEnabled()
widget()->isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
257 if (toolButton()->menu()
toolButton()->menu()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
258 names << showMenuAction();
never executed: names << showMenuAction();
0
259 if (toolButton()->popupMode() != QToolButton::InstantPopup
toolButton()->...::InstantPopupDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
260 names << QAccessibleButton::actionNames();
never executed: names << QAccessibleButton::actionNames();
0
261 }
never executed: end of block
0
262 return
never executed: return names;
names;
never executed: return names;
0
263}-
264-
265void QAccessibleToolButton::doAction(const QString &actionName)-
266{-
267 if (!widget()->isEnabled()
!widget()->isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
268 return;
never executed: return;
0
269-
270 if (actionName == pressAction()
actionName == pressAction()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
271 button()->click();-
272 }
never executed: end of block
else if (actionName == showMenuAction()
actionName == showMenuAction()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
273 if (toolButton()->popupMode() != QToolButton::InstantPopup
toolButton()->...::InstantPopupDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
274 toolButton()->setDown(true);-
275-
276 toolButton()->showMenu();-
277-
278 }
never executed: end of block
0
279 }
never executed: end of block
else {
0
280 QAccessibleButton::doAction(actionName);-
281 }
never executed: end of block
0
282-
283}-
284QAccessibleDisplay::QAccessibleDisplay(QWidget *w, QAccessible::Role role)-
285: QAccessibleWidget(w, role)-
286{-
287}
never executed: end of block
0
288-
289QAccessible::Role QAccessibleDisplay::role() const-
290{-
291 QLabel *l = qobject_cast<QLabel*>(object());-
292 if (l
lDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
293 if (l->pixmap()
l->pixmap()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
294 return
never executed: return QAccessible::Graphic;
QAccessible::Graphic;
never executed: return QAccessible::Graphic;
0
295-
296 if (l->picture()
l->picture()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
297 return
never executed: return QAccessible::Graphic;
QAccessible::Graphic;
never executed: return QAccessible::Graphic;
0
298-
299-
300 if (l->movie()
l->movie()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
301 return
never executed: return QAccessible::Animation;
QAccessible::Animation;
never executed: return QAccessible::Animation;
0
302-
303-
304 }
never executed: end of block
else if (qobject_cast<QProgressBar*>(object())
qobject_cast<Q...ar*>(object())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
305 return
never executed: return QAccessible::ProgressBar;
QAccessible::ProgressBar;
never executed: return QAccessible::ProgressBar;
0
306-
307 } else if (qobject_cast<QStatusBar*>(object())
qobject_cast<Q...ar*>(object())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
308 return
never executed: return QAccessible::StatusBar;
QAccessible::StatusBar;
never executed: return QAccessible::StatusBar;
0
309 }-
310 return
never executed: return QAccessibleWidget::role();
QAccessibleWidget::role();
never executed: return QAccessibleWidget::role();
0
311}-
312-
313QString QAccessibleDisplay::text(QAccessible::Text t) const-
314{-
315 QString str;-
316 switch (t) {-
317 case
never executed: case QAccessible::Name:
QAccessible::Name:
never executed: case QAccessible::Name:
0
318 str = widget()->accessibleName();-
319 if (str.isEmpty()
str.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
320 if (qobject_cast<QLabel*>(object())
qobject_cast<Q...el*>(object())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
321 QLabel *label = qobject_cast<QLabel*>(object());-
322 str = label->text();-
323-
324 if (label->textFormat() == Qt::RichText
label->textFor...= Qt::RichTextDescription
TRUEnever evaluated
FALSEnever evaluated
0
325 || (label->textFormat() == Qt::AutoText
label->textFor...= Qt::AutoTextDescription
TRUEnever evaluated
FALSEnever evaluated
&& Qt::mightBeRichText(str)
Qt::mightBeRichText(str)Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
326 QTextDocument doc;-
327 doc.setHtml(str);-
328 str = doc.toPlainText();-
329 }
never executed: end of block
0
330-
331 if (label->buddy()
label->buddy()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
332 str = qt_accStripAmp(str);
never executed: str = qt_accStripAmp(str);
0
333-
334 }
never executed: end of block
else if (qobject_cast<QLCDNumber*>(object())
qobject_cast<Q...er*>(object())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
335 QLCDNumber *l = qobject_cast<QLCDNumber*>(object());-
336 if (l->digitCount()
l->digitCount()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
337 str = QString::number(l->value());
never executed: str = QString::number(l->value());
0
338 else-
339 str = QString::number(l->intValue());
never executed: str = QString::number(l->intValue());
0
340-
341 } else if (qobject_cast<QStatusBar*>(object())
qobject_cast<Q...ar*>(object())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
342 return
never executed: return qobject_cast<QStatusBar*>(object())->currentMessage();
qobject_cast<QStatusBar*>(object())->currentMessage();
never executed: return qobject_cast<QStatusBar*>(object())->currentMessage();
0
343 }-
344 }
never executed: end of block
0
345 break;
never executed: break;
0
346 case
never executed: case QAccessible::Value:
QAccessible::Value:
never executed: case QAccessible::Value:
0
347-
348 if (qobject_cast<QProgressBar*>(object())
qobject_cast<Q...ar*>(object())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
349 str = QString::number(qobject_cast<QProgressBar*>(object())->value());
never executed: str = QString::number(qobject_cast<QProgressBar*>(object())->value());
0
350-
351 break;
never executed: break;
0
352 default
never executed: default:
:
never executed: default:
0
353 break;
never executed: break;
0
354 }-
355 if (str.isEmpty()
str.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
356 str = QAccessibleWidget::text(t);
never executed: str = QAccessibleWidget::text(t);
0
357 return
never executed: return str;
str;
never executed: return str;
0
358}-
359-
360-
361QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >-
362QAccessibleDisplay::relations(QAccessible::Relation match ) const-
363{-
364 QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > rels = QAccessibleWidget::relations(match);-
365 if (match & QAccessible::Labelled
match & QAccessible::LabelledDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
366 QVarLengthArray<QObject *, 4> relatedObjects;-
367-
368-
369 if (QLabel *label = qobject_cast<QLabel*>(object())
QLabel *label ...el*>(object())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
370 relatedObjects.append(label->buddy());-
371 }
never executed: end of block
0
372-
373 for (int i = 0; i < relatedObjects.count()
i < relatedObjects.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
374 const QAccessible::Relation rel = QAccessible::Labelled;-
375 QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(relatedObjects.at(i));-
376 if (iface
ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
377 rels.append(qMakePair(iface, rel));
never executed: rels.append(qMakePair(iface, rel));
0
378 }
never executed: end of block
0
379 }
never executed: end of block
0
380 return
never executed: return rels;
rels;
never executed: return rels;
0
381}-
382-
383void *QAccessibleDisplay::interface_cast(QAccessible::InterfaceType t)-
384{-
385 if (t == QAccessible::ImageInterface
t == QAccessib...ImageInterfaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
386 return
never executed: return static_cast<QAccessibleImageInterface*>(this);
static_cast<QAccessibleImageInterface*>(this);
never executed: return static_cast<QAccessibleImageInterface*>(this);
0
387 return
never executed: return QAccessibleWidget::interface_cast(t);
QAccessibleWidget::interface_cast(t);
never executed: return QAccessibleWidget::interface_cast(t);
0
388}-
389-
390-
391QString QAccessibleDisplay::imageDescription() const-
392{-
393-
394 return
never executed: return widget()->toolTip();
widget()->toolTip();
never executed: return widget()->toolTip();
0
395-
396-
397-
398}-
399-
400-
401QSize QAccessibleDisplay::imageSize() const-
402{-
403 QLabel *label = qobject_cast<QLabel *>(widget());-
404 if (!label
!labelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
405 return
never executed: return QSize();
QSize();
never executed: return QSize();
0
406 const QPixmap *pixmap = label->pixmap();-
407 if (!pixmap
!pixmapDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
408 return
never executed: return QSize();
QSize();
never executed: return QSize();
0
409 return
never executed: return pixmap->size();
pixmap->size();
never executed: return pixmap->size();
0
410}-
411-
412-
413QPoint QAccessibleDisplay::imagePosition() const-
414{-
415 QLabel *label = qobject_cast<QLabel *>(widget());-
416 if (!label
!labelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
417 return
never executed: return QPoint();
QPoint();
never executed: return QPoint();
0
418 const QPixmap *pixmap = label->pixmap();-
419 if (!pixmap
!pixmapDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
420 return
never executed: return QPoint();
QPoint();
never executed: return QPoint();
0
421-
422 return
never executed: return QPoint(label->mapToGlobal(label->pos()));
QPoint(label->mapToGlobal(label->pos()));
never executed: return QPoint(label->mapToGlobal(label->pos()));
0
423}-
424-
425-
426QAccessibleGroupBox::QAccessibleGroupBox(QWidget *w)-
427: QAccessibleWidget(w)-
428{-
429}
never executed: end of block
0
430-
431QGroupBox* QAccessibleGroupBox::groupBox() const-
432{-
433 return
never executed: return static_cast<QGroupBox *>(widget());
static_cast<QGroupBox *>(widget());
never executed: return static_cast<QGroupBox *>(widget());
0
434}-
435-
436QString QAccessibleGroupBox::text(QAccessible::Text t) const-
437{-
438 QString txt = QAccessibleWidget::text(t);-
439-
440 if (txt.isEmpty()
txt.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
441 switch (t) {-
442 case
never executed: case QAccessible::Name:
QAccessible::Name:
never executed: case QAccessible::Name:
0
443 txt = qt_accStripAmp(groupBox()->title());-
444 break;
never executed: break;
0
445 case
never executed: case QAccessible::Description:
QAccessible::Description:
never executed: case QAccessible::Description:
0
446 txt = groupBox()->toolTip();-
447 break;
never executed: break;
0
448 case
never executed: case QAccessible::Accelerator:
QAccessible::Accelerator:
never executed: case QAccessible::Accelerator:
0
449 txt = qt_accHotKey(groupBox()->title());-
450 break;
never executed: break;
0
451 default
never executed: default:
:
never executed: default:
0
452 break;
never executed: break;
0
453 }-
454 }-
455-
456 return
never executed: return txt;
txt;
never executed: return txt;
0
457}-
458-
459QAccessible::State QAccessibleGroupBox::state() const-
460{-
461 QAccessible::State st = QAccessibleWidget::state();-
462 st.checkable = groupBox()->isCheckable();-
463 st.checked = groupBox()->isChecked();-
464 return
never executed: return st;
st;
never executed: return st;
0
465}-
466-
467QAccessible::Role QAccessibleGroupBox::role() const-
468{-
469 return
never executed: return groupBox()->isCheckable() ? QAccessible::CheckBox : QAccessible::Grouping;
groupBox()->isCheckable() ? QAccessible::CheckBox : QAccessible::Grouping;
never executed: return groupBox()->isCheckable() ? QAccessible::CheckBox : QAccessible::Grouping;
0
470}-
471-
472QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >-
473QAccessibleGroupBox::relations(QAccessible::Relation match ) const-
474{-
475 QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > rels = QAccessibleWidget::relations(match);-
476-
477 if ((
(match & QAcce...ble::Labelled)Description
TRUEnever evaluated
FALSEnever evaluated
match & QAccessible::Labelled)
(match & QAcce...ble::Labelled)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(!groupBox()->...e().isEmpty())Description
TRUEnever evaluated
FALSEnever evaluated
!groupBox()->title().isEmpty())
(!groupBox()->...e().isEmpty())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
478 const QList<QWidget*> kids = childWidgets(widget());-
479 for (QWidget *kid : kids) {-
480 QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(kid);-
481 if (iface
ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
482 rels.append(qMakePair(iface, QAccessible::Relation(QAccessible::Labelled)));
never executed: rels.append(qMakePair(iface, QAccessible::Relation(QAccessible::Labelled)));
0
483 }
never executed: end of block
0
484 }
never executed: end of block
0
485 return
never executed: return rels;
rels;
never executed: return rels;
0
486}-
487-
488QStringList QAccessibleGroupBox::actionNames() const-
489{-
490 QStringList actions = QAccessibleWidget::actionNames();-
491-
492 if (groupBox()->isCheckable()
groupBox()->isCheckable()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
493 actions.prepend(QAccessibleActionInterface::toggleAction());-
494 }
never executed: end of block
0
495 return
never executed: return actions;
actions;
never executed: return actions;
0
496}-
497-
498void QAccessibleGroupBox::doAction(const QString &actionName)-
499{-
500 if (actionName == QAccessibleActionInterface::toggleAction()
actionName == ...toggleAction()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
501 groupBox()->setChecked(!groupBox()->isChecked());
never executed: groupBox()->setChecked(!groupBox()->isChecked());
0
502}
never executed: end of block
0
503-
504QStringList QAccessibleGroupBox::keyBindingsForAction(const QString &) const-
505{-
506 return
never executed: return QStringList();
QStringList();
never executed: return QStringList();
0
507}-
508QAccessibleLineEdit::QAccessibleLineEdit(QWidget *w, const QString &name)-
509: QAccessibleWidget(w, QAccessible::EditableText, name)-
510{-
511 addControllingSignal(QLatin1String("textChanged(const QString&)"));-
512 addControllingSignal(QLatin1String("returnPressed()"));-
513}
never executed: end of block
0
514-
515-
516QLineEdit *QAccessibleLineEdit::lineEdit() const-
517{-
518 return
never executed: return qobject_cast<QLineEdit*>(object());
qobject_cast<QLineEdit*>(object());
never executed: return qobject_cast<QLineEdit*>(object());
0
519}-
520-
521QString QAccessibleLineEdit::text(QAccessible::Text t) const-
522{-
523 QString str;-
524 switch (t) {-
525 case
never executed: case QAccessible::Value:
QAccessible::Value:
never executed: case QAccessible::Value:
0
526 if (lineEdit()->echoMode() == QLineEdit::Normal
lineEdit()->ec...neEdit::NormalDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
527 str = lineEdit()->text();
never executed: str = lineEdit()->text();
0
528 else if (lineEdit()->echoMode() != QLineEdit::NoEcho
lineEdit()->ec...neEdit::NoEchoDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
529 str = QString(lineEdit()->text().length(), QChar::fromLatin1('*'));
never executed: str = QString(lineEdit()->text().length(), QChar::fromLatin1('*'));
0
530 break;
never executed: break;
0
531 default
never executed: default:
:
never executed: default:
0
532 break;
never executed: break;
0
533 }-
534 if (str.isEmpty()
str.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
535 str = QAccessibleWidget::text(t);
never executed: str = QAccessibleWidget::text(t);
0
536 return
never executed: return str;
str;
never executed: return str;
0
537}-
538-
539void QAccessibleLineEdit::setText(QAccessible::Text t, const QString &text)-
540{-
541 if (t != QAccessible::Value
t != QAccessible::ValueDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
542 QAccessibleWidget::setText(t, text);-
543 return;
never executed: return;
0
544 }-
545-
546 QString newText = text;-
547 if (lineEdit()->validator()
lineEdit()->validator()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
548 int pos = 0;-
549 if (lineEdit()->validator()->validate(newText, pos) != QValidator::Acceptable
lineEdit()->va...or::AcceptableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
550 return;
never executed: return;
0
551 }
never executed: end of block
0
552 lineEdit()->setText(newText);-
553}
never executed: end of block
0
554-
555QAccessible::State QAccessibleLineEdit::state() const-
556{-
557 QAccessible::State state = QAccessibleWidget::state();-
558-
559 QLineEdit *l = lineEdit();-
560 if (l->isReadOnly()
l->isReadOnly()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
561 state.readOnly = true;
never executed: state.readOnly = true;
0
562 else-
563 state.editable = true;
never executed: state.editable = true;
0
564-
565 if (l->echoMode() != QLineEdit::Normal
l->echoMode() ...neEdit::NormalDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
566 state.passwordEdit = true;
never executed: state.passwordEdit = true;
0
567-
568 state.selectableText = true;-
569 return
never executed: return state;
state;
never executed: return state;
0
570}-
571-
572void *QAccessibleLineEdit::interface_cast(QAccessible::InterfaceType t)-
573{-
574 if (t == QAccessible::TextInterface
t == QAccessib...:TextInterfaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
575 return
never executed: return static_cast<QAccessibleTextInterface*>(this);
static_cast<QAccessibleTextInterface*>(this);
never executed: return static_cast<QAccessibleTextInterface*>(this);
0
576 if (t == QAccessible::EditableTextInterface
t == QAccessib...eTextInterfaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
577 return
never executed: return static_cast<QAccessibleEditableTextInterface*>(this);
static_cast<QAccessibleEditableTextInterface*>(this);
never executed: return static_cast<QAccessibleEditableTextInterface*>(this);
0
578 return
never executed: return QAccessibleWidget::interface_cast(t);
QAccessibleWidget::interface_cast(t);
never executed: return QAccessibleWidget::interface_cast(t);
0
579}-
580-
581void QAccessibleLineEdit::addSelection(int startOffset, int endOffset)-
582{-
583 setSelection(0, startOffset, endOffset);-
584}
never executed: end of block
0
585-
586QString QAccessibleLineEdit::attributes(int offset, int *startOffset, int *endOffset) const-
587{-
588-
589 *startOffset = *endOffset = offset;-
590 return
never executed: return QString();
QString();
never executed: return QString();
0
591}-
592-
593int QAccessibleLineEdit::cursorPosition() const-
594{-
595 return
never executed: return lineEdit()->cursorPosition();
lineEdit()->cursorPosition();
never executed: return lineEdit()->cursorPosition();
0
596}-
597-
598QRect QAccessibleLineEdit::characterRect(int offset) const-
599{-
600 int x = lineEdit()->d_func()->control->cursorToX(offset);-
601 int y;-
602 lineEdit()->getTextMargins(0, &y, 0, 0);-
603 QFontMetrics fm(lineEdit()->font());-
604 const QString ch = text(offset, offset + 1);-
605 if (ch.isEmpty()
ch.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
606 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
607 int w = fm.width(ch);-
608 int h = fm.height();-
609 QRect r(x, y, w, h);-
610 r.moveTo(lineEdit()->mapToGlobal(r.topLeft()));-
611 return
never executed: return r;
r;
never executed: return r;
0
612}-
613-
614int QAccessibleLineEdit::selectionCount() const-
615{-
616 return
never executed: return lineEdit()->hasSelectedText() ? 1 : 0;
lineEdit()->hasSelectedText() ? 1 : 0;
never executed: return lineEdit()->hasSelectedText() ? 1 : 0;
0
617}-
618-
619int QAccessibleLineEdit::offsetAtPoint(const QPoint &point) const-
620{-
621 QPoint p = lineEdit()->mapFromGlobal(point);-
622-
623 return
never executed: return lineEdit()->cursorPositionAt(p);
lineEdit()->cursorPositionAt(p);
never executed: return lineEdit()->cursorPositionAt(p);
0
624}-
625-
626void QAccessibleLineEdit::selection(int selectionIndex, int *startOffset, int *endOffset) const-
627{-
628 *startOffset = *endOffset = 0;-
629 if (selectionIndex != 0
selectionIndex != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
630 return;
never executed: return;
0
631-
632 *startOffset = lineEdit()->selectionStart();-
633 *endOffset = *startOffset + lineEdit()->selectedText().count();-
634}
never executed: end of block
0
635-
636QString QAccessibleLineEdit::text(int startOffset, int endOffset) const-
637{-
638 if (startOffset > endOffset
startOffset > endOffsetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
639 return
never executed: return QString();
QString();
never executed: return QString();
0
640-
641 if (lineEdit()->echoMode() != QLineEdit::Normal
lineEdit()->ec...neEdit::NormalDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
642 return
never executed: return QString();
QString();
never executed: return QString();
0
643-
644 return
never executed: return lineEdit()->text().mid(startOffset, endOffset - startOffset);
lineEdit()->text().mid(startOffset, endOffset - startOffset);
never executed: return lineEdit()->text().mid(startOffset, endOffset - startOffset);
0
645}-
646-
647QString QAccessibleLineEdit::textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType,-
648 int *startOffset, int *endOffset) const-
649{-
650 if (lineEdit()->echoMode() != QLineEdit::Normal
lineEdit()->ec...neEdit::NormalDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
651 *startOffset = *endOffset = -1;-
652 return
never executed: return QString();
QString();
never executed: return QString();
0
653 }-
654 if (offset == -2
offset == -2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
655 offset = cursorPosition();
never executed: offset = cursorPosition();
0
656 return
never executed: return QAccessibleTextInterface::textBeforeOffset(offset, boundaryType, startOffset, endOffset);
QAccessibleTextInterface::textBeforeOffset(offset, boundaryType, startOffset, endOffset);
never executed: return QAccessibleTextInterface::textBeforeOffset(offset, boundaryType, startOffset, endOffset);
0
657}-
658-
659QString QAccessibleLineEdit::textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType,-
660 int *startOffset, int *endOffset) const-
661{-
662 if (lineEdit()->echoMode() != QLineEdit::Normal
lineEdit()->ec...neEdit::NormalDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
663 *startOffset = *endOffset = -1;-
664 return
never executed: return QString();
QString();
never executed: return QString();
0
665 }-
666 if (offset == -2
offset == -2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
667 offset = cursorPosition();
never executed: offset = cursorPosition();
0
668 return
never executed: return QAccessibleTextInterface::textAfterOffset(offset, boundaryType, startOffset, endOffset);
QAccessibleTextInterface::textAfterOffset(offset, boundaryType, startOffset, endOffset);
never executed: return QAccessibleTextInterface::textAfterOffset(offset, boundaryType, startOffset, endOffset);
0
669}-
670-
671QString QAccessibleLineEdit::textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType,-
672 int *startOffset, int *endOffset) const-
673{-
674 if (lineEdit()->echoMode() != QLineEdit::Normal
lineEdit()->ec...neEdit::NormalDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
675 *startOffset = *endOffset = -1;-
676 return
never executed: return QString();
QString();
never executed: return QString();
0
677 }-
678 if (offset == -2
offset == -2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
679 offset = cursorPosition();
never executed: offset = cursorPosition();
0
680 return
never executed: return QAccessibleTextInterface::textAtOffset(offset, boundaryType, startOffset, endOffset);
QAccessibleTextInterface::textAtOffset(offset, boundaryType, startOffset, endOffset);
never executed: return QAccessibleTextInterface::textAtOffset(offset, boundaryType, startOffset, endOffset);
0
681}-
682-
683void QAccessibleLineEdit::removeSelection(int selectionIndex)-
684{-
685 if (selectionIndex != 0
selectionIndex != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
686 return;
never executed: return;
0
687-
688 lineEdit()->deselect();-
689}
never executed: end of block
0
690-
691void QAccessibleLineEdit::setCursorPosition(int position)-
692{-
693 lineEdit()->setCursorPosition(position);-
694}
never executed: end of block
0
695-
696void QAccessibleLineEdit::setSelection(int selectionIndex, int startOffset, int endOffset)-
697{-
698 if (selectionIndex != 0
selectionIndex != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
699 return;
never executed: return;
0
700-
701 lineEdit()->setSelection(startOffset, endOffset - startOffset);-
702}
never executed: end of block
0
703-
704int QAccessibleLineEdit::characterCount() const-
705{-
706 return
never executed: return lineEdit()->text().count();
lineEdit()->text().count();
never executed: return lineEdit()->text().count();
0
707}-
708-
709void QAccessibleLineEdit::scrollToSubstring(int startIndex, int endIndex)-
710{-
711 lineEdit()->setCursorPosition(endIndex);-
712 lineEdit()->setCursorPosition(startIndex);-
713}
never executed: end of block
0
714-
715void QAccessibleLineEdit::deleteText(int startOffset, int endOffset)-
716{-
717 lineEdit()->setText(lineEdit()->text().remove(startOffset, endOffset - startOffset));-
718}
never executed: end of block
0
719-
720void QAccessibleLineEdit::insertText(int offset, const QString &text)-
721{-
722 lineEdit()->setText(lineEdit()->text().insert(offset, text));-
723}
never executed: end of block
0
724-
725void QAccessibleLineEdit::replaceText(int startOffset, int endOffset, const QString &text)-
726{-
727 lineEdit()->setText(lineEdit()->text().replace(startOffset, endOffset - startOffset, text));-
728}
never executed: end of block
0
729-
730-
731-
732-
733QAccessibleProgressBar::QAccessibleProgressBar(QWidget *o)-
734 : QAccessibleDisplay(o)-
735{-
736 ((!(progressBar())) ? qt_assert("progressBar()",__FILE__,852) : qt_noop());-
737}
never executed: end of block
0
738-
739void *QAccessibleProgressBar::interface_cast(QAccessible::InterfaceType t)-
740{-
741 if (t == QAccessible::ValueInterface
t == QAccessib...ValueInterfaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
742 return
never executed: return static_cast<QAccessibleValueInterface*>(this);
static_cast<QAccessibleValueInterface*>(this);
never executed: return static_cast<QAccessibleValueInterface*>(this);
0
743 return
never executed: return QAccessibleDisplay::interface_cast(t);
QAccessibleDisplay::interface_cast(t);
never executed: return QAccessibleDisplay::interface_cast(t);
0
744}-
745-
746QVariant QAccessibleProgressBar::currentValue() const-
747{-
748 return
never executed: return progressBar()->value();
progressBar()->value();
never executed: return progressBar()->value();
0
749}-
750-
751QVariant QAccessibleProgressBar::maximumValue() const-
752{-
753 return
never executed: return progressBar()->maximum();
progressBar()->maximum();
never executed: return progressBar()->maximum();
0
754}-
755-
756QVariant QAccessibleProgressBar::minimumValue() const-
757{-
758 return
never executed: return progressBar()->minimum();
progressBar()->minimum();
never executed: return progressBar()->minimum();
0
759}-
760-
761QVariant QAccessibleProgressBar::minimumStepSize() const-
762{-
763-
764-
765-
766 return
never executed: return (progressBar()->maximum() - progressBar()->minimum()) / 100.0;
(progressBar()->maximum() - progressBar()->minimum()) / 100.0;
never executed: return (progressBar()->maximum() - progressBar()->minimum()) / 100.0;
0
767}-
768-
769QProgressBar *QAccessibleProgressBar::progressBar() const-
770{-
771 return
never executed: return qobject_cast<QProgressBar *>(object());
qobject_cast<QProgressBar *>(object());
never executed: return qobject_cast<QProgressBar *>(object());
0
772}-
773-
774-
775-
776QAccessibleWindowContainer::QAccessibleWindowContainer(QWidget *w)-
777 : QAccessibleWidget(w)-
778{-
779}
never executed: end of block
0
780-
781int QAccessibleWindowContainer::childCount() const-
782{-
783 if (container()->containedWindow()
container()->containedWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
784 return
never executed: return 1;
1;
never executed: return 1;
0
785 return
never executed: return 0;
0;
never executed: return 0;
0
786}-
787-
788int QAccessibleWindowContainer::indexOfChild(const QAccessibleInterface *child) const-
789{-
790 if (child->object() == container()->containedWindow()
child->object(...tainedWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
791 return
never executed: return 0;
0;
never executed: return 0;
0
792 return
never executed: return -1;
-1;
never executed: return -1;
0
793}-
794-
795QAccessibleInterface *QAccessibleWindowContainer::child(int i) const-
796{-
797 if (i == 0
i == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
798 return
never executed: return QAccessible::queryAccessibleInterface(container()->containedWindow());
QAccessible::queryAccessibleInterface(container()->containedWindow());
never executed: return QAccessible::queryAccessibleInterface(container()->containedWindow());
0
799 return
never executed: return 0;
0;
never executed: return 0;
0
800}-
801-
802QWindowContainer *QAccessibleWindowContainer::container() const-
803{-
804 return
never executed: return static_cast<QWindowContainer *>(widget());
static_cast<QWindowContainer *>(widget());
never executed: return static_cast<QWindowContainer *>(widget());
0
805}-
806-
807-
808-
809-
Switch to Source codePreprocessed file

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