qaccessiblewidgets.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/accessible/qaccessiblewidgets.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6QString qt_accStripAmp(const QString &text);-
7QString qt_accHotKey(const QString &text);-
8-
9QList<QWidget*> childWidgets(const QWidget *widget)-
10{-
11 if (widget == 0
widget == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
12 return
never executed: return QList<QWidget*>();
QList<QWidget*>();
never executed: return QList<QWidget*>();
0
13 QList<QWidget*> widgets;-
14 for (QObject *o : widget->children()) {-
15 QWidget *w = qobject_cast<QWidget *>(o);-
16 if (!w
!wDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
17 continue;
never executed: continue;
0
18 QString objectName = w->objectName();-
19 if (!w->isWindow()
!w->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
0
20 && !qobject_cast<QFocusFrame*>(w)
!qobject_cast<QFocusFrame*>(w)Description
TRUEnever evaluated
FALSEnever evaluated
0
21 && !qobject_cast<QMenu*>(w)
!qobject_cast<QMenu*>(w)Description
TRUEnever evaluated
FALSEnever evaluated
0
22 && objectName != QLatin1String("qt_rubberband")
objectName != ...t_rubberband")Description
TRUEnever evaluated
FALSEnever evaluated
0
23 && objectName != QLatin1String("qt_qmainwindow_extended_splitter")
objectName != ...ded_splitter")Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
24 widgets.append(w);-
25 }
never executed: end of block
0
26 }
never executed: end of block
0
27 return
never executed: return widgets;
widgets;
never executed: return widgets;
0
28}-
29-
30-
31-
32QAccessiblePlainTextEdit::QAccessiblePlainTextEdit(QWidget* o)-
33 :QAccessibleTextWidget(o)-
34{-
35 ((!(widget()->inherits("QPlainTextEdit"))) ? qt_assert("widget()->inherits(\"QPlainTextEdit\")",__FILE__,102) : qt_noop());-
36}
never executed: end of block
0
37-
38QPlainTextEdit* QAccessiblePlainTextEdit::plainTextEdit() const-
39{-
40 return
never executed: return static_cast<QPlainTextEdit *>(widget());
static_cast<QPlainTextEdit *>(widget());
never executed: return static_cast<QPlainTextEdit *>(widget());
0
41}-
42-
43QString QAccessiblePlainTextEdit::text(QAccessible::Text t) const-
44{-
45 if (t == QAccessible::Value
t == QAccessible::ValueDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
46 return
never executed: return plainTextEdit()->toPlainText();
plainTextEdit()->toPlainText();
never executed: return plainTextEdit()->toPlainText();
0
47-
48 return
never executed: return QAccessibleWidget::text(t);
QAccessibleWidget::text(t);
never executed: return QAccessibleWidget::text(t);
0
49}-
50-
51void QAccessiblePlainTextEdit::setText(QAccessible::Text t, const QString &text)-
52{-
53 if (t != QAccessible::Value
t != QAccessible::ValueDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
54 QAccessibleWidget::setText(t, text);-
55 return;
never executed: return;
0
56 }-
57 if (plainTextEdit()->isReadOnly()
plainTextEdit()->isReadOnly()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
58 return;
never executed: return;
0
59-
60 plainTextEdit()->setPlainText(text);-
61}
never executed: end of block
0
62-
63QAccessible::State QAccessiblePlainTextEdit::state() const-
64{-
65 QAccessible::State st = QAccessibleTextWidget::state();-
66 if (plainTextEdit()->isReadOnly()
plainTextEdit()->isReadOnly()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
67 st.readOnly = true;
never executed: st.readOnly = true;
0
68 else-
69 st.editable = true;
never executed: st.editable = true;
0
70 return
never executed: return st;
st;
never executed: return st;
0
71}-
72-
73void *QAccessiblePlainTextEdit::interface_cast(QAccessible::InterfaceType t)-
74{-
75 if (t == QAccessible::TextInterface
t == QAccessib...:TextInterfaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
76 return
never executed: return static_cast<QAccessibleTextInterface*>(this);
static_cast<QAccessibleTextInterface*>(this);
never executed: return static_cast<QAccessibleTextInterface*>(this);
0
77 else if (t == QAccessible::EditableTextInterface
t == QAccessib...eTextInterfaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
78 return
never executed: return static_cast<QAccessibleEditableTextInterface*>(this);
static_cast<QAccessibleEditableTextInterface*>(this);
never executed: return static_cast<QAccessibleEditableTextInterface*>(this);
0
79 return
never executed: return QAccessibleWidget::interface_cast(t);
QAccessibleWidget::interface_cast(t);
never executed: return QAccessibleWidget::interface_cast(t);
0
80}-
81-
82QPoint QAccessiblePlainTextEdit::scrollBarPosition() const-
83{-
84 QPoint result;-
85 result.setX(plainTextEdit()->horizontalScrollBar() ? plainTextEdit()->horizontalScrollBar()->sliderPosition() : 0);-
86 result.setY(plainTextEdit()->verticalScrollBar() ? plainTextEdit()->verticalScrollBar()->sliderPosition() : 0);-
87 return
never executed: return result;
result;
never executed: return result;
0
88}-
89-
90QTextCursor QAccessiblePlainTextEdit::textCursor() const-
91{-
92 return
never executed: return plainTextEdit()->textCursor();
plainTextEdit()->textCursor();
never executed: return plainTextEdit()->textCursor();
0
93}-
94-
95void QAccessiblePlainTextEdit::setTextCursor(const QTextCursor &textCursor)-
96{-
97 plainTextEdit()->setTextCursor(textCursor);-
98}
never executed: end of block
0
99-
100QTextDocument* QAccessiblePlainTextEdit::textDocument() const-
101{-
102 return
never executed: return plainTextEdit()->document();
plainTextEdit()->document();
never executed: return plainTextEdit()->document();
0
103}-
104-
105QWidget* QAccessiblePlainTextEdit::viewport() const-
106{-
107 return
never executed: return plainTextEdit()->viewport();
plainTextEdit()->viewport();
never executed: return plainTextEdit()->viewport();
0
108}-
109-
110void QAccessiblePlainTextEdit::scrollToSubstring(int startIndex, int endIndex)-
111{-
112-
113 (void)startIndex;;-
114 (void)endIndex;;-
115}
never executed: end of block
0
116QAccessibleTextEdit::QAccessibleTextEdit(QWidget *o)-
117: QAccessibleTextWidget(o, QAccessible::EditableText)-
118{-
119 ((!(widget()->inherits("QTextEdit"))) ? qt_assert("widget()->inherits(\"QTextEdit\")",__FILE__,199) : qt_noop());-
120}
never executed: end of block
0
121-
122-
123QTextEdit *QAccessibleTextEdit::textEdit() const-
124{-
125 return
never executed: return static_cast<QTextEdit *>(widget());
static_cast<QTextEdit *>(widget());
never executed: return static_cast<QTextEdit *>(widget());
0
126}-
127-
128QTextCursor QAccessibleTextEdit::textCursor() const-
129{-
130 return
never executed: return textEdit()->textCursor();
textEdit()->textCursor();
never executed: return textEdit()->textCursor();
0
131}-
132-
133QTextDocument *QAccessibleTextEdit::textDocument() const-
134{-
135 return
never executed: return textEdit()->document();
textEdit()->document();
never executed: return textEdit()->document();
0
136}-
137-
138void QAccessibleTextEdit::setTextCursor(const QTextCursor &textCursor)-
139{-
140 textEdit()->setTextCursor(textCursor);-
141}
never executed: end of block
0
142-
143QWidget *QAccessibleTextEdit::viewport() const-
144{-
145 return
never executed: return textEdit()->viewport();
textEdit()->viewport();
never executed: return textEdit()->viewport();
0
146}-
147-
148QPoint QAccessibleTextEdit::scrollBarPosition() const-
149{-
150 QPoint result;-
151 result.setX(textEdit()->horizontalScrollBar() ? textEdit()->horizontalScrollBar()->sliderPosition() : 0);-
152 result.setY(textEdit()->verticalScrollBar() ? textEdit()->verticalScrollBar()->sliderPosition() : 0);-
153 return
never executed: return result;
result;
never executed: return result;
0
154}-
155-
156QString QAccessibleTextEdit::text(QAccessible::Text t) const-
157{-
158 if (t == QAccessible::Value
t == QAccessible::ValueDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
159 return
never executed: return textEdit()->toPlainText();
textEdit()->toPlainText();
never executed: return textEdit()->toPlainText();
0
160-
161 return
never executed: return QAccessibleWidget::text(t);
QAccessibleWidget::text(t);
never executed: return QAccessibleWidget::text(t);
0
162}-
163-
164void QAccessibleTextEdit::setText(QAccessible::Text t, const QString &text)-
165{-
166 if (t != QAccessible::Value
t != QAccessible::ValueDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
167 QAccessibleWidget::setText(t, text);-
168 return;
never executed: return;
0
169 }-
170 if (textEdit()->isReadOnly()
textEdit()->isReadOnly()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
171 return;
never executed: return;
0
172-
173 textEdit()->setText(text);-
174}
never executed: end of block
0
175-
176QAccessible::State QAccessibleTextEdit::state() const-
177{-
178 QAccessible::State st = QAccessibleTextWidget::state();-
179 if (textEdit()->isReadOnly()
textEdit()->isReadOnly()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
180 st.readOnly = true;
never executed: st.readOnly = true;
0
181 else-
182 st.editable = true;
never executed: st.editable = true;
0
183 return
never executed: return st;
st;
never executed: return st;
0
184}-
185-
186void *QAccessibleTextEdit::interface_cast(QAccessible::InterfaceType t)-
187{-
188 if (t == QAccessible::TextInterface
t == QAccessib...:TextInterfaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
189 return
never executed: return static_cast<QAccessibleTextInterface*>(this);
static_cast<QAccessibleTextInterface*>(this);
never executed: return static_cast<QAccessibleTextInterface*>(this);
0
190 else if (t == QAccessible::EditableTextInterface
t == QAccessib...eTextInterfaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
191 return
never executed: return static_cast<QAccessibleEditableTextInterface*>(this);
static_cast<QAccessibleEditableTextInterface*>(this);
never executed: return static_cast<QAccessibleEditableTextInterface*>(this);
0
192 return
never executed: return QAccessibleWidget::interface_cast(t);
QAccessibleWidget::interface_cast(t);
never executed: return QAccessibleWidget::interface_cast(t);
0
193}-
194-
195void QAccessibleTextEdit::scrollToSubstring(int startIndex, int endIndex)-
196{-
197 QTextEdit *edit = textEdit();-
198-
199 QTextCursor cursor = textCursor();-
200 cursor.setPosition(startIndex);-
201 QRect r = edit->cursorRect(cursor);-
202-
203 cursor.setPosition(endIndex);-
204 r.setBottomRight(edit->cursorRect(cursor).bottomRight());-
205-
206 r.moveTo(r.x() + edit->horizontalScrollBar()->value(),-
207 r.y() + edit->verticalScrollBar()->value());-
208-
209-
210 if (__builtin_expect(!!(!QMetaObject::invokeMethod(edit, "_q_ensureVisible", QArgument<QRectF >("QRectF", r))), false)
__builtin_expe..., r))), false)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
211 QMessageLogger(__FILE__, 291, __PRETTY_FUNCTION__).warning("AccessibleTextEdit::scrollToSubstring failed!");
never executed: QMessageLogger(__FILE__, 291, __PRETTY_FUNCTION__).warning("AccessibleTextEdit::scrollToSubstring failed!");
0
212}
never executed: end of block
0
213-
214-
215-
216-
217-
218QAccessibleStackedWidget::QAccessibleStackedWidget(QWidget *widget)-
219 : QAccessibleWidget(widget, QAccessible::LayeredPane)-
220{-
221 ((!(qobject_cast<QStackedWidget *>(widget))) ? qt_assert("qobject_cast<QStackedWidget *>(widget)",__FILE__,301) : qt_noop());-
222}
never executed: end of block
0
223-
224QAccessibleInterface *QAccessibleStackedWidget::childAt(int x, int y) const-
225{-
226 if (!stackedWidget()->isVisible()
!stackedWidget()->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
227 return
never executed: return 0;
0;
never executed: return 0;
0
228 QWidget *currentWidget = stackedWidget()->currentWidget();-
229 if (!currentWidget
!currentWidgetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
230 return
never executed: return 0;
0;
never executed: return 0;
0
231 QPoint position = currentWidget->mapFromGlobal(QPoint(x, y));-
232 if (currentWidget->rect().contains(position)
currentWidget-...ains(position)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
233 return
never executed: return child(stackedWidget()->currentIndex());
child(stackedWidget()->currentIndex());
never executed: return child(stackedWidget()->currentIndex());
0
234 return
never executed: return 0;
0;
never executed: return 0;
0
235}-
236-
237int QAccessibleStackedWidget::childCount() const-
238{-
239 return
never executed: return stackedWidget()->count();
stackedWidget()->count();
never executed: return stackedWidget()->count();
0
240}-
241-
242int QAccessibleStackedWidget::indexOfChild(const QAccessibleInterface *child) const-
243{-
244 if (!child
!childDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
245 return
never executed: return -1;
-1;
never executed: return -1;
0
246-
247 QWidget *widget = qobject_cast<QWidget*>(child->object());-
248 return
never executed: return stackedWidget()->indexOf(widget);
stackedWidget()->indexOf(widget);
never executed: return stackedWidget()->indexOf(widget);
0
249}-
250-
251QAccessibleInterface *QAccessibleStackedWidget::child(int index) const-
252{-
253 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| index >= stackedWidget()->count()
index >= stack...get()->count()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
254 return
never executed: return 0;
0;
never executed: return 0;
0
255 return
never executed: return QAccessible::queryAccessibleInterface(stackedWidget()->widget(index));
QAccessible::queryAccessibleInterface(stackedWidget()->widget(index));
never executed: return QAccessible::queryAccessibleInterface(stackedWidget()->widget(index));
0
256}-
257-
258QStackedWidget *QAccessibleStackedWidget::stackedWidget() const-
259{-
260 return
never executed: return static_cast<QStackedWidget *>(object());
static_cast<QStackedWidget *>(object());
never executed: return static_cast<QStackedWidget *>(object());
0
261}-
262-
263-
264-
265-
266QAccessibleToolBox::QAccessibleToolBox(QWidget *widget)-
267 : QAccessibleWidget(widget, QAccessible::LayeredPane)-
268{-
269 ((!(qobject_cast<QToolBox *>(widget))) ? qt_assert("qobject_cast<QToolBox *>(widget)",__FILE__,349) : qt_noop());-
270}
never executed: end of block
0
271-
272QToolBox * QAccessibleToolBox::toolBox() const-
273{-
274 return
never executed: return static_cast<QToolBox *>(object());
static_cast<QToolBox *>(object());
never executed: return static_cast<QToolBox *>(object());
0
275}-
276-
277-
278-
279-
280QAccessibleMdiArea::QAccessibleMdiArea(QWidget *widget)-
281 : QAccessibleWidget(widget, QAccessible::LayeredPane)-
282{-
283 ((!(qobject_cast<QMdiArea *>(widget))) ? qt_assert("qobject_cast<QMdiArea *>(widget)",__FILE__,363) : qt_noop());-
284}
never executed: end of block
0
285-
286int QAccessibleMdiArea::childCount() const-
287{-
288 return
never executed: return mdiArea()->subWindowList().count();
mdiArea()->subWindowList().count();
never executed: return mdiArea()->subWindowList().count();
0
289}-
290-
291QAccessibleInterface *QAccessibleMdiArea::child(int index) const-
292{-
293 QList<QMdiSubWindow *> subWindows = mdiArea()->subWindowList();-
294 QWidget *targetObject = subWindows.value(index);-
295 if (!targetObject
!targetObjectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
296 return
never executed: return 0;
0;
never executed: return 0;
0
297 return
never executed: return QAccessible::queryAccessibleInterface(targetObject);
QAccessible::queryAccessibleInterface(targetObject);
never executed: return QAccessible::queryAccessibleInterface(targetObject);
0
298}-
299-
300-
301int QAccessibleMdiArea::indexOfChild(const QAccessibleInterface *child) const-
302{-
303 if (!child
!childDescription
TRUEnever evaluated
FALSEnever evaluated
|| !child->object()
!child->object()Description
TRUEnever evaluated
FALSEnever evaluated
|| mdiArea()->subWindowList().isEmpty()
mdiArea()->sub...st().isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
304 return
never executed: return -1;
-1;
never executed: return -1;
0
305 if (QMdiSubWindow *window = qobject_cast<QMdiSubWindow *>(child->object())
QMdiSubWindow ...ild->object())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
306 return
never executed: return mdiArea()->subWindowList().indexOf(window);
mdiArea()->subWindowList().indexOf(window);
never executed: return mdiArea()->subWindowList().indexOf(window);
0
307 }-
308 return
never executed: return -1;
-1;
never executed: return -1;
0
309}-
310-
311QMdiArea *QAccessibleMdiArea::mdiArea() const-
312{-
313 return
never executed: return static_cast<QMdiArea *>(object());
static_cast<QMdiArea *>(object());
never executed: return static_cast<QMdiArea *>(object());
0
314}-
315-
316-
317QAccessibleMdiSubWindow::QAccessibleMdiSubWindow(QWidget *widget)-
318 : QAccessibleWidget(widget, QAccessible::Window)-
319{-
320 ((!(qobject_cast<QMdiSubWindow *>(widget))) ? qt_assert("qobject_cast<QMdiSubWindow *>(widget)",__FILE__,400) : qt_noop());-
321}
never executed: end of block
0
322-
323QString QAccessibleMdiSubWindow::text(QAccessible::Text textType) const-
324{-
325 if (textType == QAccessible::Name
textType == QAccessible::NameDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
326 QString title = mdiSubWindow()->windowTitle();-
327 title.replace(QLatin1String("[*]"), QLatin1String(""));-
328 return
never executed: return title;
title;
never executed: return title;
0
329 }-
330 return
never executed: return QAccessibleWidget::text(textType);
QAccessibleWidget::text(textType);
never executed: return QAccessibleWidget::text(textType);
0
331}-
332-
333void QAccessibleMdiSubWindow::setText(QAccessible::Text textType, const QString &text)-
334{-
335 if (textType == QAccessible::Name
textType == QAccessible::NameDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
336 mdiSubWindow()->setWindowTitle(text);
never executed: mdiSubWindow()->setWindowTitle(text);
0
337 else-
338 QAccessibleWidget::setText(textType, text);
never executed: QAccessibleWidget::setText(textType, text);
0
339}-
340-
341QAccessible::State QAccessibleMdiSubWindow::state() const-
342{-
343 QAccessible::State state;-
344 state.focusable = true;-
345 if (!mdiSubWindow()->isMaximized()
!mdiSubWindow()->isMaximized()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
346 state.movable = true;-
347 state.sizeable = true;-
348 }
never executed: end of block
0
349 if (mdiSubWindow()->isAncestorOf(QApplication::focusWidget())
mdiSubWindow()...focusWidget())Description
TRUEnever evaluated
FALSEnever evaluated
0
350 || QApplication::focusWidget() == mdiSubWindow()
QApplication::...mdiSubWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
351 state.focused = true;
never executed: state.focused = true;
0
352 if (!mdiSubWindow()->isVisible()
!mdiSubWindow()->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
353 state.invisible = true;
never executed: state.invisible = true;
0
354 if (const
const QWidget ...parentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
QWidget *parent = mdiSubWindow()->parentWidget()
const QWidget ...parentWidget()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
355 if (!parent->contentsRect().contains(mdiSubWindow()->geometry())
!parent->conte...)->geometry())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
356 state.offscreen = true;
never executed: state.offscreen = true;
0
357 if (!mdiSubWindow()->isEnabled()
!mdiSubWindow()->isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
358 state.disabled = true;
never executed: state.disabled = true;
0
359 return
never executed: return state;
state;
never executed: return state;
0
360}-
361-
362int QAccessibleMdiSubWindow::childCount() const-
363{-
364 if (mdiSubWindow()->widget()
mdiSubWindow()->widget()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
365 return
never executed: return 1;
1;
never executed: return 1;
0
366 return
never executed: return 0;
0;
never executed: return 0;
0
367}-
368-
369QAccessibleInterface *QAccessibleMdiSubWindow::child(int index) const-
370{-
371 QMdiSubWindow *source = mdiSubWindow();-
372 if (index != 0
index != 0Description
TRUEnever evaluated
FALSEnever evaluated
|| !source->widget()
!source->widget()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
373 return
never executed: return 0;
0;
never executed: return 0;
0
374-
375 return
never executed: return QAccessible::queryAccessibleInterface(source->widget());
QAccessible::queryAccessibleInterface(source->widget());
never executed: return QAccessible::queryAccessibleInterface(source->widget());
0
376}-
377-
378int QAccessibleMdiSubWindow::indexOfChild(const QAccessibleInterface *child) const-
379{-
380 if (child
childDescription
TRUEnever evaluated
FALSEnever evaluated
&& child->object()
child->object()Description
TRUEnever evaluated
FALSEnever evaluated
&& child->object() == mdiSubWindow()->widget()
child->object(...ow()->widget()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
381 return
never executed: return 0;
0;
never executed: return 0;
0
382 return
never executed: return -1;
-1;
never executed: return -1;
0
383}-
384-
385QRect QAccessibleMdiSubWindow::rect() const-
386{-
387 if (mdiSubWindow()->isHidden()
mdiSubWindow()->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
388 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
389 if (!mdiSubWindow()->parent()
!mdiSubWindow()->parent()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
390 return
never executed: return QAccessibleWidget::rect();
QAccessibleWidget::rect();
never executed: return QAccessibleWidget::rect();
0
391 const QPoint pos = mdiSubWindow()->mapToGlobal(QPoint(0, 0));-
392 return
never executed: return QRect(pos, mdiSubWindow()->size());
QRect(pos, mdiSubWindow()->size());
never executed: return QRect(pos, mdiSubWindow()->size());
0
393}-
394-
395QMdiSubWindow *QAccessibleMdiSubWindow::mdiSubWindow() const-
396{-
397 return
never executed: return static_cast<QMdiSubWindow *>(object());
static_cast<QMdiSubWindow *>(object());
never executed: return static_cast<QMdiSubWindow *>(object());
0
398}-
399-
400-
401-
402-
403QAccessibleDialogButtonBox::QAccessibleDialogButtonBox(QWidget *widget)-
404 : QAccessibleWidget(widget, QAccessible::Grouping)-
405{-
406 ((!(qobject_cast<QDialogButtonBox*>(widget))) ? qt_assert("qobject_cast<QDialogButtonBox*>(widget)",__FILE__,486) : qt_noop());-
407}
never executed: end of block
0
408-
409-
410-
411-
412QAccessibleTextBrowser::QAccessibleTextBrowser(QWidget *widget)-
413 : QAccessibleTextEdit(widget)-
414{-
415 ((!(qobject_cast<QTextBrowser *>(widget))) ? qt_assert("qobject_cast<QTextBrowser *>(widget)",__FILE__,495) : qt_noop());-
416}
never executed: end of block
0
417-
418QAccessible::Role QAccessibleTextBrowser::role() const-
419{-
420 return
never executed: return QAccessible::StaticText;
QAccessible::StaticText;
never executed: return QAccessible::StaticText;
0
421}-
422-
423-
424-
425-
426QAccessibleCalendarWidget::QAccessibleCalendarWidget(QWidget *widget)-
427 : QAccessibleWidget(widget, QAccessible::Table)-
428{-
429 ((!(qobject_cast<QCalendarWidget *>(widget))) ? qt_assert("qobject_cast<QCalendarWidget *>(widget)",__FILE__,509) : qt_noop());-
430}
never executed: end of block
0
431-
432int QAccessibleCalendarWidget::childCount() const-
433{-
434 return
never executed: return calendarWidget()->isNavigationBarVisible() ? 2 : 1;
calendarWidget()->isNavigationBarVisible() ? 2 : 1;
never executed: return calendarWidget()->isNavigationBarVisible() ? 2 : 1;
0
435}-
436-
437int QAccessibleCalendarWidget::indexOfChild(const QAccessibleInterface *child) const-
438{-
439 if (!child
!childDescription
TRUEnever evaluated
FALSEnever evaluated
|| !child->object()
!child->object()Description
TRUEnever evaluated
FALSEnever evaluated
|| childCount() <= 0
childCount() <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
440 return
never executed: return -1;
-1;
never executed: return -1;
0
441 if (qobject_cast<QAbstractItemView *>(child->object())
qobject_cast<Q...ild->object())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
442 return
never executed: return childCount() - 1;
childCount() - 1;
never executed: return childCount() - 1;
0
443 return
never executed: return 0;
0;
never executed: return 0;
0
444}-
445-
446QAccessibleInterface *QAccessibleCalendarWidget::child(int index) const-
447{-
448 if (index < 0
index < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| index >= childCount()
index >= childCount()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
449 return
never executed: return 0;
0;
never executed: return 0;
0
450-
451 if (childCount() > 1
childCount() > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& index == 0
index == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
452 return
never executed: return QAccessible::queryAccessibleInterface(navigationBar());
QAccessible::queryAccessibleInterface(navigationBar());
never executed: return QAccessible::queryAccessibleInterface(navigationBar());
0
453-
454 return
never executed: return QAccessible::queryAccessibleInterface(calendarView());
QAccessible::queryAccessibleInterface(calendarView());
never executed: return QAccessible::queryAccessibleInterface(calendarView());
0
455}-
456-
457QCalendarWidget *QAccessibleCalendarWidget::calendarWidget() const-
458{-
459 return
never executed: return static_cast<QCalendarWidget *>(object());
static_cast<QCalendarWidget *>(object());
never executed: return static_cast<QCalendarWidget *>(object());
0
460}-
461-
462QAbstractItemView *QAccessibleCalendarWidget::calendarView() const-
463{-
464 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(calendarWidget()->children())>::type> _container_((calendarWidget()->children())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QObject *child = *_container_.i; _container_.control; _container_.control = 0) {-
465 if (child->objectName() == QLatin1String("qt_calendar_calendarview")
child->objectN...calendarview")Description
TRUEnever evaluated
FALSEnever evaluated
)
0
466 return
never executed: return static_cast<QAbstractItemView *>(child);
static_cast<QAbstractItemView *>(child);
never executed: return static_cast<QAbstractItemView *>(child);
0
467 }
never executed: end of block
0
468 return
never executed: return 0;
0;
never executed: return 0;
0
469}-
470-
471QWidget *QAccessibleCalendarWidget::navigationBar() const-
472{-
473 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(calendarWidget()->children())>::type> _container_((calendarWidget()->children())); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QObject *child = *_container_.i; _container_.control; _container_.control = 0) {-
474 if (child->objectName() == QLatin1String("qt_calendar_navigationbar")
child->objectN...avigationbar")Description
TRUEnever evaluated
FALSEnever evaluated
)
0
475 return
never executed: return static_cast<QWidget *>(child);
static_cast<QWidget *>(child);
never executed: return static_cast<QWidget *>(child);
0
476 }
never executed: end of block
0
477 return
never executed: return 0;
0;
never executed: return 0;
0
478}-
479QAccessibleDockWidget::QAccessibleDockWidget(QWidget *widget)-
480 : QAccessibleWidget(widget, QAccessible::Window)-
481{-
482}
never executed: end of block
0
483-
484QDockWidgetLayout *QAccessibleDockWidget::dockWidgetLayout() const-
485{-
486 return
never executed: return qobject_cast<QDockWidgetLayout*>(dockWidget()->layout());
qobject_cast<QDockWidgetLayout*>(dockWidget()->layout());
never executed: return qobject_cast<QDockWidgetLayout*>(dockWidget()->layout());
0
487}-
488-
489int QAccessibleDockWidget::childCount() const-
490{-
491 if (dockWidget()->titleBarWidget()
dockWidget()->titleBarWidget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
492 return
never executed: return dockWidget()->widget() ? 2 : 1;
dockWidget()->widget() ? 2 : 1;
never executed: return dockWidget()->widget() ? 2 : 1;
0
493 }-
494 return
never executed: return dockWidgetLayout()->count();
dockWidgetLayout()->count();
never executed: return dockWidgetLayout()->count();
0
495}-
496-
497QAccessibleInterface *QAccessibleDockWidget::child(int index) const-
498{-
499 if (dockWidget()->titleBarWidget()
dockWidget()->titleBarWidget()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
500 if ((!dockWidget()->widget()
!dockWidget()->widget()Description
TRUEnever evaluated
FALSEnever evaluated
&& index == 0
index == 0Description
TRUEnever evaluated
FALSEnever evaluated
) || (
(index == 1)Description
TRUEnever evaluated
FALSEnever evaluated
index == 1)
(index == 1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
501 return
never executed: return QAccessible::queryAccessibleInterface(dockWidget()->titleBarWidget());
QAccessible::queryAccessibleInterface(dockWidget()->titleBarWidget());
never executed: return QAccessible::queryAccessibleInterface(dockWidget()->titleBarWidget());
0
502 if (index == 0
index == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
503 return
never executed: return QAccessible::queryAccessibleInterface(dockWidget()->widget());
QAccessible::queryAccessibleInterface(dockWidget()->widget());
never executed: return QAccessible::queryAccessibleInterface(dockWidget()->widget());
0
504 }
never executed: end of block
else {
0
505 QLayoutItem *item = dockWidgetLayout()->itemAt(index);-
506 if (item
itemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
507 return
never executed: return QAccessible::queryAccessibleInterface(item->widget());
QAccessible::queryAccessibleInterface(item->widget());
never executed: return QAccessible::queryAccessibleInterface(item->widget());
0
508 }
never executed: end of block
0
509 return
never executed: return 0;
0;
never executed: return 0;
0
510}-
511-
512int QAccessibleDockWidget::indexOfChild(const QAccessibleInterface *child) const-
513{-
514 if (!child
!childDescription
TRUEnever evaluated
FALSEnever evaluated
|| !child->object()
!child->object()Description
TRUEnever evaluated
FALSEnever evaluated
|| child->object()->parent() != object()
child->object(...() != object()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
515 return
never executed: return -1;
-1;
never executed: return -1;
0
516-
517 if (dockWidget()->titleBarWidget() == child->object()
dockWidget()->...hild->object()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
518 return
never executed: return dockWidget()->widget() ? 1 : 0;
dockWidget()->widget() ? 1 : 0;
never executed: return dockWidget()->widget() ? 1 : 0;
0
519 }-
520-
521 return
never executed: return dockWidgetLayout()->indexOf(qobject_cast<QWidget*>(child->object()));
dockWidgetLayout()->indexOf(qobject_cast<QWidget*>(child->object()));
never executed: return dockWidgetLayout()->indexOf(qobject_cast<QWidget*>(child->object()));
0
522}-
523-
524QRect QAccessibleDockWidget::rect() const-
525{-
526 QRect rect;-
527-
528 if (dockWidget()->isFloating()
dockWidget()->isFloating()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
529 rect = dockWidget()->frameGeometry();-
530 }
never executed: end of block
else {
0
531 rect = dockWidget()->rect();-
532 rect.moveTopLeft(dockWidget()->mapToGlobal(rect.topLeft()));-
533 }
never executed: end of block
0
534-
535 return
never executed: return rect;
rect;
never executed: return rect;
0
536}-
537-
538QDockWidget *QAccessibleDockWidget::dockWidget() const-
539{-
540 return
never executed: return static_cast<QDockWidget *>(object());
static_cast<QDockWidget *>(object());
never executed: return static_cast<QDockWidget *>(object());
0
541}-
542-
543QString QAccessibleDockWidget::text(QAccessible::Text t) const-
544{-
545 if (t == QAccessible::Name
t == QAccessible::NameDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
546 return
never executed: return qt_accStripAmp(dockWidget()->windowTitle());
qt_accStripAmp(dockWidget()->windowTitle());
never executed: return qt_accStripAmp(dockWidget()->windowTitle());
0
547 } else if (t == QAccessible::Accelerator
t == QAccessible::AcceleratorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
548 return
never executed: return qt_accHotKey(dockWidget()->windowTitle());
qt_accHotKey(dockWidget()->windowTitle());
never executed: return qt_accHotKey(dockWidget()->windowTitle());
0
549 }-
550 return
never executed: return QString();
QString();
never executed: return QString();
0
551}-
552-
553-
554-
555-
556QAccessibleTextWidget::QAccessibleTextWidget(QWidget *o, QAccessible::Role r, const QString &name):-
557 QAccessibleWidget(o, r, name)-
558{-
559-
560}
never executed: end of block
0
561-
562QAccessible::State QAccessibleTextWidget::state() const-
563{-
564 QAccessible::State s = QAccessibleWidget::state();-
565 s.selectableText = true;-
566 s.multiLine = true;-
567 return
never executed: return s;
s;
never executed: return s;
0
568}-
569-
570QRect QAccessibleTextWidget::characterRect(int offset) const-
571{-
572 QTextBlock block = textDocument()->findBlock(offset);-
573 if (!block.isValid()
!block.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
574 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
575-
576 QTextLayout *layout = block.layout();-
577 QPointF layoutPosition = layout->position();-
578 int relativeOffset = offset - block.position();-
579 QTextLine line = layout->lineForTextPosition(relativeOffset);-
580-
581 QRect r;-
582-
583 if (line.isValid()
line.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
584 qreal x = line.cursorToX(relativeOffset);-
585-
586 QTextCharFormat format;-
587 QTextBlock::iterator iter = block.begin();-
588 if (iter.atEnd()
iter.atEnd()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
589 format = block.charFormat();
never executed: format = block.charFormat();
0
590 else {-
591 while (!iter.atEnd()
!iter.atEnd()Description
TRUEnever evaluated
FALSEnever evaluated
&& !iter.fragment().contains(offset)
!iter.fragment...ntains(offset)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
592 ++
never executed: ++iter;
iter;
never executed: ++iter;
0
593 if (iter.atEnd()
iter.atEnd()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
594 --
never executed: --iter;
iter;
never executed: --iter;
0
595 format = iter.fragment().charFormat();-
596 }
never executed: end of block
0
597-
598 QFontMetrics fm(format.font());-
599 const QString ch = text(offset, offset + 1);-
600 if (!ch.isEmpty()
!ch.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
601 int w = fm.width(ch);-
602 int h = fm.height();-
603 r = QRect(layoutPosition.x() + x, layoutPosition.y() + line.y() + line.ascent() + fm.descent() - h,-
604 w, h);-
605 r.moveTo(viewport()->mapToGlobal(r.topLeft()));-
606 }
never executed: end of block
0
607 r.translate(-scrollBarPosition());-
608 }
never executed: end of block
0
609-
610 return
never executed: return r;
r;
never executed: return r;
0
611}-
612-
613int QAccessibleTextWidget::offsetAtPoint(const QPoint &point) const-
614{-
615 QPoint p = viewport()->mapFromGlobal(point);-
616-
617 p += scrollBarPosition();-
618 return
never executed: return textDocument()->documentLayout()->hitTest(p, Qt::ExactHit);
textDocument()->documentLayout()->hitTest(p, Qt::ExactHit);
never executed: return textDocument()->documentLayout()->hitTest(p, Qt::ExactHit);
0
619}-
620-
621int QAccessibleTextWidget::selectionCount() const-
622{-
623 return
never executed: return textCursor().hasSelection() ? 1 : 0;
textCursor().hasSelection() ? 1 : 0;
never executed: return textCursor().hasSelection() ? 1 : 0;
0
624}-
625-
626namespace {-
627class AttributeFormatterRef {-
628 QString &string;-
629 const char *key;-
630 friend class AttributeFormatter;-
631 AttributeFormatterRef(QString &string, const char *key) : string(string), key(key) {}
never executed: end of block
0
632public:-
633 template <typename RHS>-
634 void operator=(RHS &&rhs)-
635 { string += QLatin1String(key) + QLatin1Char(':') + std::forward<RHS>(rhs) + QLatin1Char(';'); }
never executed: end of block
0
636};-
637class AttributeFormatter {-
638 QString string;-
639public:-
640 AttributeFormatterRef operator[](const char *key)-
641 { return
never executed: return AttributeFormatterRef(string, key);
AttributeFormatterRef(string, key);
never executed: return AttributeFormatterRef(string, key);
}
0
642-
643 QString toFormatted() const { return
never executed: return string;
string;
never executed: return string;
}
0
644};-
645}-
646-
647QString QAccessibleTextWidget::attributes(int offset, int *startOffset, int *endOffset) const-
648{-
649-
650-
651-
652-
653-
654 if (offset == -2
offset == -2Description
TRUEnever evaluated
FALSEnever evaluated
)
0
655 offset = cursorPosition();
never executed: offset = cursorPosition();
0
656-
657 const int charCount = characterCount();-
658-
659-
660-
661 if (offset == -1
offset == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| offset == charCount
offset == charCountDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
662 offset = charCount - 1;
never executed: offset = charCount - 1;
0
663-
664 if (offset < 0
offset < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| offset > charCount
offset > charCountDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
665 *startOffset = -1;-
666 *endOffset = -1;-
667 return
never executed: return QString();
QString();
never executed: return QString();
0
668 }-
669-
670-
671 QTextCursor cursor = textCursor();-
672 cursor.setPosition(offset);-
673 QTextBlock block = cursor.block();-
674-
675 int blockStart = block.position();-
676 int blockEnd = blockStart + block.length();-
677-
678 QTextBlock::iterator iter = block.begin();-
679 int lastFragmentIndex = blockStart;-
680 while (!iter.atEnd()
!iter.atEnd()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
681 QTextFragment f = iter.fragment();-
682 if (f.contains(offset)
f.contains(offset)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
683 break;
never executed: break;
0
684 lastFragmentIndex = f.position() + f.length();-
685 ++iter;-
686 }
never executed: end of block
0
687-
688 QTextCharFormat charFormat;-
689 if (!iter.atEnd()
!iter.atEnd()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
690 QTextFragment fragment = iter.fragment();-
691 charFormat = fragment.charFormat();-
692 int pos = fragment.position();-
693-
694 *startOffset = qMax(pos, blockStart);-
695 *endOffset = qMin(pos + fragment.length(), blockEnd);-
696 }
never executed: end of block
else {
0
697 charFormat = block.charFormat();-
698 *startOffset = lastFragmentIndex;-
699 *endOffset = blockEnd;-
700 }
never executed: end of block
0
701 ((!(*startOffset <= offset)) ? qt_assert("*startOffset <= offset",__FILE__,817) : qt_noop());-
702 ((!(*endOffset >= offset)) ? qt_assert("*endOffset >= offset",__FILE__,818) : qt_noop());-
703-
704 QTextBlockFormat blockFormat = cursor.blockFormat();-
705-
706 const QFont charFormatFont = charFormat.font();-
707-
708 AttributeFormatter attrs;-
709 QString family = charFormatFont.family();-
710 if (!family.isEmpty()
!family.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
711 family = family.replace('\\', QLatin1String("\\\\"));-
712 family = family.replace(':', QLatin1String("\\:"));-
713 family = family.replace(',', QLatin1String("\\,"));-
714 family = family.replace('=', QLatin1String("\\="));-
715 family = family.replace(';', QLatin1String("\\;"));-
716 family = family.replace('\"', QLatin1String("\\\""));-
717 attrs["font-family"] = QString::fromLatin1("\"%1\"").arg(family);-
718 }
never executed: end of block
0
719-
720 int fontSize = int(charFormatFont.pointSize());-
721 if (fontSize
fontSizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
722 attrs["font-size"] = QString::fromLatin1("%1pt").arg(fontSize);
never executed: attrs["font-size"] = QString::fromLatin1("%1pt").arg(fontSize);
0
723-
724-
725 attrs["font-weight"] = QString::fromLatin1(charFormatFont.weight() > QFont::Normal ? "bold" : "normal");-
726-
727 QFont::Style style = charFormatFont.style();-
728 attrs["font-style"] = QString::fromLatin1((style == QFont::StyleItalic) ? "italic" : ((style == QFont::StyleOblique) ? "oblique": "normal"));-
729-
730 QTextCharFormat::UnderlineStyle underlineStyle = charFormat.underlineStyle();-
731 if (underlineStyle == QTextCharFormat::NoUnderline
underlineStyle...t::NoUnderlineDescription
TRUEnever evaluated
FALSEnever evaluated
&& charFormatFont.underline()
charFormatFont.underline()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
732 underlineStyle = QTextCharFormat::SingleUnderline;
never executed: underlineStyle = QTextCharFormat::SingleUnderline;
0
733 QString underlineStyleValue;-
734 switch (underlineStyle) {-
735 case
never executed: case QTextCharFormat::NoUnderline:
QTextCharFormat::NoUnderline:
never executed: case QTextCharFormat::NoUnderline:
0
736 break;
never executed: break;
0
737 case
never executed: case QTextCharFormat::SingleUnderline:
QTextCharFormat::SingleUnderline:
never executed: case QTextCharFormat::SingleUnderline:
0
738 underlineStyleValue = ([]() -> QString { enum { Size = sizeof(u"" "solid")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "solid" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
0
739 break;
never executed: break;
0
740 case
never executed: case QTextCharFormat::DashUnderline:
QTextCharFormat::DashUnderline:
never executed: case QTextCharFormat::DashUnderline:
0
741 underlineStyleValue = ([]() -> QString { enum { Size = sizeof(u"" "dash")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "dash" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
0
742 break;
never executed: break;
0
743 case
never executed: case QTextCharFormat::DotLine:
QTextCharFormat::DotLine:
never executed: case QTextCharFormat::DotLine:
0
744 underlineStyleValue = ([]() -> QString { enum { Size = sizeof(u"" "dash")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "dash" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
0
745 break;
never executed: break;
0
746 case
never executed: case QTextCharFormat::DashDotLine:
QTextCharFormat::DashDotLine:
never executed: case QTextCharFormat::DashDotLine:
0
747 underlineStyleValue = ([]() -> QString { enum { Size = sizeof(u"" "dot-dash")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "dot-dash" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
0
748 break;
never executed: break;
0
749 case
never executed: case QTextCharFormat::DashDotDotLine:
QTextCharFormat::DashDotDotLine:
never executed: case QTextCharFormat::DashDotDotLine:
0
750 underlineStyleValue = ([]() -> QString { enum { Size = sizeof(u"" "dot-dot-dash")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "dot-dot-dash" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
0
751 break;
never executed: break;
0
752 case
never executed: case QTextCharFormat::WaveUnderline:
QTextCharFormat::WaveUnderline:
never executed: case QTextCharFormat::WaveUnderline:
0
753 underlineStyleValue = ([]() -> QString { enum { Size = sizeof(u"" "wave")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "wave" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
0
754 break;
never executed: break;
0
755 case
never executed: case QTextCharFormat::SpellCheckUnderline:
QTextCharFormat::SpellCheckUnderline:
never executed: case QTextCharFormat::SpellCheckUnderline:
0
756 underlineStyleValue = ([]() -> QString { enum { Size = sizeof(u"" "wave")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "wave" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
0
757 break;
never executed: break;
0
758 default
never executed: default:
:
never executed: default:
0
759 QMessageLogger(__FILE__, 875, __PRETTY_FUNCTION__).warning() << "Unknown QTextCharFormat::​UnderlineStyle value " << underlineStyle << " could not be translated to IAccessible2 value";-
760 break;
never executed: break;
0
761 }-
762 if (!underlineStyleValue.isNull()
!underlineStyleValue.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
763 attrs["text-underline-style"] = underlineStyleValue;-
764 attrs["text-underline-type"] = ([]() -> QString { enum { Size = sizeof(u"" "single")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "single" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
0
765 }
never executed: end of block
0
766-
767 if (block.textDirection() == Qt::RightToLeft
block.textDire...t::RightToLeftDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
768 attrs["writing-mode"] = ([]() -> QString { enum { Size = sizeof(u"" "rl")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "rl" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
never executed: attrs["writing-mode"] = ([]() -> QString { enum { Size = sizeof(u"" "rl")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "rl" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }());
0
769-
770 QTextCharFormat::VerticalAlignment alignment = charFormat.verticalAlignment();-
771 attrs["text-position"] = QString::fromLatin1((alignment == QTextCharFormat::AlignSubScript) ? "sub" : ((alignment == QTextCharFormat::AlignSuperScript) ? "super" : "baseline" ));-
772-
773 QBrush background = charFormat.background();-
774 if (background.style() == Qt::SolidPattern
background.sty...::SolidPatternDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
775 attrs["background-color"] = QString::fromLatin1("rgb(%1,%2,%3)").arg(background.color().red()).arg(background.color().green()).arg(background.color().blue());-
776 }
never executed: end of block
0
777-
778 QBrush foreground = charFormat.foreground();-
779 if (foreground.style() == Qt::SolidPattern
foreground.sty...::SolidPatternDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
780 attrs["color"] = QString::fromLatin1("rgb(%1,%2,%3)").arg(foreground.color().red()).arg(foreground.color().green()).arg(foreground.color().blue());-
781 }
never executed: end of block
0
782-
783 switch (blockFormat.alignment() & (Qt::AlignLeft | Qt::AlignRight | Qt::AlignHCenter | Qt::AlignJustify)) {-
784 case
never executed: case Qt::AlignLeft:
Qt::AlignLeft:
never executed: case Qt::AlignLeft:
0
785 attrs["text-align"] = ([]() -> QString { enum { Size = sizeof(u"" "left")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "left" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
0
786 break;
never executed: break;
0
787 case
never executed: case Qt::AlignRight:
Qt::AlignRight:
never executed: case Qt::AlignRight:
0
788 attrs["text-align"] = ([]() -> QString { enum { Size = sizeof(u"" "right")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "right" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
0
789 break;
never executed: break;
0
790 case
never executed: case Qt::AlignHCenter:
Qt::AlignHCenter:
never executed: case Qt::AlignHCenter:
0
791 attrs["text-align"] = ([]() -> QString { enum { Size = sizeof(u"" "center")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "center" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
0
792 break;
never executed: break;
0
793 case
never executed: case Qt::AlignJustify:
Qt::AlignJustify:
never executed: case Qt::AlignJustify:
0
794 attrs["text-align"] = ([]() -> QString { enum { Size = sizeof(u"" "justify")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "justify" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
never executed: return qstring_literal_temp;
qstring_literal_temp;
never executed: return qstring_literal_temp;
}());
0
795 break;
never executed: break;
0
796 }-
797-
798 return
never executed: return attrs.toFormatted();
attrs.toFormatted();
never executed: return attrs.toFormatted();
0
799}-
800-
801int QAccessibleTextWidget::cursorPosition() const-
802{-
803 return
never executed: return textCursor().position();
textCursor().position();
never executed: return textCursor().position();
0
804}-
805-
806void QAccessibleTextWidget::selection(int selectionIndex, int *startOffset, int *endOffset) const-
807{-
808 *startOffset = *endOffset = 0;-
809 QTextCursor cursor = textCursor();-
810-
811 if (selectionIndex != 0
selectionIndex != 0Description
TRUEnever evaluated
FALSEnever evaluated
|| !cursor.hasSelection()
!cursor.hasSelection()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
812 return;
never executed: return;
0
813-
814 *startOffset = cursor.selectionStart();-
815 *endOffset = cursor.selectionEnd();-
816}
never executed: end of block
0
817-
818QString QAccessibleTextWidget::text(int startOffset, int endOffset) const-
819{-
820 QTextCursor cursor(textCursor());-
821-
822 cursor.setPosition(startOffset, QTextCursor::MoveAnchor);-
823 cursor.setPosition(endOffset, QTextCursor::KeepAnchor);-
824-
825 return
never executed: return cursor.selectedText().replace(QChar(QChar::ParagraphSeparator), QLatin1Char('\n'));
cursor.selectedText().replace(QChar(QChar::ParagraphSeparator), QLatin1Char('\n'));
never executed: return cursor.selectedText().replace(QChar(QChar::ParagraphSeparator), QLatin1Char('\n'));
0
826}-
827-
828QPoint QAccessibleTextWidget::scrollBarPosition() const-
829{-
830 return
never executed: return QPoint(0, 0);
QPoint(0, 0);
never executed: return QPoint(0, 0);
0
831}-
832-
833-
834QString QAccessibleTextWidget::textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType,-
835 int *startOffset, int *endOffset) const-
836{-
837 ((!(startOffset)) ? qt_assert("startOffset",__FILE__,953) : qt_noop());-
838 ((!(endOffset)) ? qt_assert("endOffset",__FILE__,954) : qt_noop());-
839-
840 QTextCursor cursor = textCursor();-
841 cursor.setPosition(offset);-
842 QPair<int, int> boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType);-
843 cursor.setPosition(boundaries.first - 1);-
844 boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType);-
845-
846 *startOffset = boundaries.first;-
847 *endOffset = boundaries.second;-
848-
849 return
never executed: return text(boundaries.first, boundaries.second);
text(boundaries.first, boundaries.second);
never executed: return text(boundaries.first, boundaries.second);
0
850 }-
851-
852-
853QString QAccessibleTextWidget::textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType,-
854 int *startOffset, int *endOffset) const-
855{-
856 ((!(startOffset)) ? qt_assert("startOffset",__FILE__,972) : qt_noop());-
857 ((!(endOffset)) ? qt_assert("endOffset",__FILE__,973) : qt_noop());-
858-
859 QTextCursor cursor = textCursor();-
860 cursor.setPosition(offset);-
861 QPair<int, int> boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType);-
862 cursor.setPosition(boundaries.second);-
863 boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType);-
864-
865 *startOffset = boundaries.first;-
866 *endOffset = boundaries.second;-
867-
868 return
never executed: return text(boundaries.first, boundaries.second);
text(boundaries.first, boundaries.second);
never executed: return text(boundaries.first, boundaries.second);
0
869}-
870-
871QString QAccessibleTextWidget::textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType,-
872 int *startOffset, int *endOffset) const-
873{-
874 ((!(startOffset)) ? qt_assert("startOffset",__FILE__,990) : qt_noop());-
875 ((!(endOffset)) ? qt_assert("endOffset",__FILE__,991) : qt_noop());-
876-
877 QTextCursor cursor = textCursor();-
878 cursor.setPosition(offset);-
879 QPair<int, int> boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType);-
880-
881 *startOffset = boundaries.first;-
882 *endOffset = boundaries.second;-
883-
884 return
never executed: return text(boundaries.first, boundaries.second);
text(boundaries.first, boundaries.second);
never executed: return text(boundaries.first, boundaries.second);
0
885}-
886-
887void QAccessibleTextWidget::setCursorPosition(int position)-
888{-
889 QTextCursor cursor = textCursor();-
890 cursor.setPosition(position);-
891 setTextCursor(cursor);-
892}
never executed: end of block
0
893-
894void QAccessibleTextWidget::addSelection(int startOffset, int endOffset)-
895{-
896 setSelection(0, startOffset, endOffset);-
897}
never executed: end of block
0
898-
899void QAccessibleTextWidget::removeSelection(int selectionIndex)-
900{-
901 if (selectionIndex != 0
selectionIndex != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
902 return;
never executed: return;
0
903-
904 QTextCursor cursor = textCursor();-
905 cursor.clearSelection();-
906 setTextCursor(cursor);-
907}
never executed: end of block
0
908-
909void QAccessibleTextWidget::setSelection(int selectionIndex, int startOffset, int endOffset)-
910{-
911 if (selectionIndex != 0
selectionIndex != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
912 return;
never executed: return;
0
913-
914 QTextCursor cursor = textCursor();-
915 cursor.setPosition(startOffset, QTextCursor::MoveAnchor);-
916 cursor.setPosition(endOffset, QTextCursor::KeepAnchor);-
917 setTextCursor(cursor);-
918}
never executed: end of block
0
919-
920int QAccessibleTextWidget::characterCount() const-
921{-
922 QTextCursor cursor = textCursor();-
923 cursor.movePosition(QTextCursor::End);-
924 return
never executed: return cursor.position();
cursor.position();
never executed: return cursor.position();
0
925}-
926-
927QTextCursor QAccessibleTextWidget::textCursorForRange(int startOffset, int endOffset) const-
928{-
929 QTextCursor cursor = textCursor();-
930 cursor.setPosition(startOffset, QTextCursor::MoveAnchor);-
931 cursor.setPosition(endOffset, QTextCursor::KeepAnchor);-
932-
933 return
never executed: return cursor;
cursor;
never executed: return cursor;
0
934}-
935-
936void QAccessibleTextWidget::deleteText(int startOffset, int endOffset)-
937{-
938 QTextCursor cursor = textCursorForRange(startOffset, endOffset);-
939 cursor.removeSelectedText();-
940}
never executed: end of block
0
941-
942void QAccessibleTextWidget::insertText(int offset, const QString &text)-
943{-
944 QTextCursor cursor = textCursor();-
945 cursor.setPosition(offset);-
946 cursor.insertText(text);-
947}
never executed: end of block
0
948-
949void QAccessibleTextWidget::replaceText(int startOffset, int endOffset, const QString &text)-
950{-
951 QTextCursor cursor = textCursorForRange(startOffset, endOffset);-
952 cursor.removeSelectedText();-
953 cursor.insertText(text);-
954}
never executed: end of block
0
955-
956-
957-
958-
959QAccessibleMainWindow::QAccessibleMainWindow(QWidget *widget)-
960 : QAccessibleWidget(widget, QAccessible::Window) { }
never executed: end of block
0
961-
962QAccessibleInterface *QAccessibleMainWindow::child(int index) const-
963{-
964 QList<QWidget*> kids = childWidgets(mainWindow());-
965 if (index >= 0
index >= 0Description
TRUEnever evaluated
FALSEnever evaluated
&& index < kids.count()
index < kids.count()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
966 return
never executed: return QAccessible::queryAccessibleInterface(kids.at(index));
QAccessible::queryAccessibleInterface(kids.at(index));
never executed: return QAccessible::queryAccessibleInterface(kids.at(index));
0
967 }-
968 return
never executed: return 0;
0;
never executed: return 0;
0
969}-
970-
971int QAccessibleMainWindow::childCount() const-
972{-
973 QList<QWidget*> kids = childWidgets(mainWindow());-
974 return
never executed: return kids.count();
kids.count();
never executed: return kids.count();
0
975}-
976-
977int QAccessibleMainWindow::indexOfChild(const QAccessibleInterface *iface) const-
978{-
979 QList<QWidget*> kids = childWidgets(mainWindow());-
980 return
never executed: return kids.indexOf(static_cast<QWidget*>(iface->object()));
kids.indexOf(static_cast<QWidget*>(iface->object()));
never executed: return kids.indexOf(static_cast<QWidget*>(iface->object()));
0
981}-
982-
983QAccessibleInterface *QAccessibleMainWindow::childAt(int x, int y) const-
984{-
985 QWidget *w = widget();-
986 if (!w->isVisible()
!w->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
987 return
never executed: return 0;
0;
never executed: return 0;
0
988 QPoint gp = w->mapToGlobal(QPoint(0, 0));-
989 if (!QRect(gp.x(), gp.y(), w->width(), w->height()).contains(x, y)
!QRect(gp.x(),...contains(x, y)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
990 return
never executed: return 0;
0;
never executed: return 0;
0
991-
992 const QWidgetList kids = childWidgets(mainWindow());-
993 QPoint rp = mainWindow()->mapFromGlobal(QPoint(x, y));-
994 for (QWidget *child : kids) {-
995 if (!child->isWindow()
!child->isWindow()Description
TRUEnever evaluated
FALSEnever evaluated
&& !child->isHidden()
!child->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
&& child->geometry().contains(rp)
child->geometry().contains(rp)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
996 return
never executed: return QAccessible::queryAccessibleInterface(child);
QAccessible::queryAccessibleInterface(child);
never executed: return QAccessible::queryAccessibleInterface(child);
0
997 }-
998 }
never executed: end of block
0
999 return
never executed: return 0;
0;
never executed: return 0;
0
1000}-
1001-
1002QMainWindow *QAccessibleMainWindow::mainWindow() const-
1003{-
1004 return
never executed: return qobject_cast<QMainWindow *>(object());
qobject_cast<QMainWindow *>(object());
never executed: return qobject_cast<QMainWindow *>(object());
0
1005}-
1006-
1007-
1008-
1009-
Switch to Source codePreprocessed file

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