| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/accessible/qaccessiblewidgets.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | QString qt_accStripAmp(const QString &text); | - | ||||||||||||||||||||||||
| 7 | QString qt_accHotKey(const QString &text); | - | ||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||
| 9 | QList<QWidget*> childWidgets(const QWidget *widget) | - | ||||||||||||||||||||||||
| 10 | { | - | ||||||||||||||||||||||||
| 11 | if (widget == 0
| 0 | ||||||||||||||||||||||||
| 12 | return never executed: QList<QWidget*>();return 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
| 0 | ||||||||||||||||||||||||
| 17 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 18 | QString objectName = w->objectName(); | - | ||||||||||||||||||||||||
| 19 | if (!w->isWindow()
| 0 | ||||||||||||||||||||||||
| 20 | && !qobject_cast<QFocusFrame*>(w)
| 0 | ||||||||||||||||||||||||
| 21 | && !qobject_cast<QMenu*>(w)
| 0 | ||||||||||||||||||||||||
| 22 | && objectName != QLatin1String("qt_rubberband")
| 0 | ||||||||||||||||||||||||
| 23 | && objectName != QLatin1String("qt_qmainwindow_extended_splitter")
| 0 | ||||||||||||||||||||||||
| 24 | widgets.append(w); | - | ||||||||||||||||||||||||
| 25 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 26 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 27 | return never executed: widgets;return widgets;never executed: return widgets; | 0 | ||||||||||||||||||||||||
| 28 | } | - | ||||||||||||||||||||||||
| 29 | - | |||||||||||||||||||||||||
| 30 | - | |||||||||||||||||||||||||
| 31 | - | |||||||||||||||||||||||||
| 32 | QAccessiblePlainTextEdit::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 | - | |||||||||||||||||||||||||
| 38 | QPlainTextEdit* QAccessiblePlainTextEdit::plainTextEdit() const | - | ||||||||||||||||||||||||
| 39 | { | - | ||||||||||||||||||||||||
| 40 | return never executed: static_cast<QPlainTextEdit *>(widget());return static_cast<QPlainTextEdit *>(widget());never executed: return static_cast<QPlainTextEdit *>(widget()); | 0 | ||||||||||||||||||||||||
| 41 | } | - | ||||||||||||||||||||||||
| 42 | - | |||||||||||||||||||||||||
| 43 | QString QAccessiblePlainTextEdit::text(QAccessible::Text t) const | - | ||||||||||||||||||||||||
| 44 | { | - | ||||||||||||||||||||||||
| 45 | if (t == QAccessible::Value
| 0 | ||||||||||||||||||||||||
| 46 | return never executed: plainTextEdit()->toPlainText();return plainTextEdit()->toPlainText();never executed: return plainTextEdit()->toPlainText(); | 0 | ||||||||||||||||||||||||
| 47 | - | |||||||||||||||||||||||||
| 48 | return never executed: QAccessibleWidget::text(t);return QAccessibleWidget::text(t);never executed: return QAccessibleWidget::text(t); | 0 | ||||||||||||||||||||||||
| 49 | } | - | ||||||||||||||||||||||||
| 50 | - | |||||||||||||||||||||||||
| 51 | void QAccessiblePlainTextEdit::setText(QAccessible::Text t, const QString &text) | - | ||||||||||||||||||||||||
| 52 | { | - | ||||||||||||||||||||||||
| 53 | if (t != QAccessible::Value
| 0 | ||||||||||||||||||||||||
| 54 | QAccessibleWidget::setText(t, text); | - | ||||||||||||||||||||||||
| 55 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 56 | } | - | ||||||||||||||||||||||||
| 57 | if (plainTextEdit()->isReadOnly()
| 0 | ||||||||||||||||||||||||
| 58 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 59 | - | |||||||||||||||||||||||||
| 60 | plainTextEdit()->setPlainText(text); | - | ||||||||||||||||||||||||
| 61 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 62 | - | |||||||||||||||||||||||||
| 63 | QAccessible::State QAccessiblePlainTextEdit::state() const | - | ||||||||||||||||||||||||
| 64 | { | - | ||||||||||||||||||||||||
| 65 | QAccessible::State st = QAccessibleTextWidget::state(); | - | ||||||||||||||||||||||||
| 66 | if (plainTextEdit()->isReadOnly()
| 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: st;return st;never executed: return st; | 0 | ||||||||||||||||||||||||
| 71 | } | - | ||||||||||||||||||||||||
| 72 | - | |||||||||||||||||||||||||
| 73 | void *QAccessiblePlainTextEdit::interface_cast(QAccessible::InterfaceType t) | - | ||||||||||||||||||||||||
| 74 | { | - | ||||||||||||||||||||||||
| 75 | if (t == QAccessible::TextInterface
| 0 | ||||||||||||||||||||||||
| 76 | return never executed: static_cast<QAccessibleTextInterface*>(this);return static_cast<QAccessibleTextInterface*>(this);never executed: return static_cast<QAccessibleTextInterface*>(this); | 0 | ||||||||||||||||||||||||
| 77 | else if (t == QAccessible::EditableTextInterface
| 0 | ||||||||||||||||||||||||
| 78 | return never executed: static_cast<QAccessibleEditableTextInterface*>(this);return static_cast<QAccessibleEditableTextInterface*>(this);never executed: return static_cast<QAccessibleEditableTextInterface*>(this); | 0 | ||||||||||||||||||||||||
| 79 | return never executed: QAccessibleWidget::interface_cast(t);return QAccessibleWidget::interface_cast(t);never executed: return QAccessibleWidget::interface_cast(t); | 0 | ||||||||||||||||||||||||
| 80 | } | - | ||||||||||||||||||||||||
| 81 | - | |||||||||||||||||||||||||
| 82 | QPoint 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: result;return result;never executed: return result; | 0 | ||||||||||||||||||||||||
| 88 | } | - | ||||||||||||||||||||||||
| 89 | - | |||||||||||||||||||||||||
| 90 | QTextCursor QAccessiblePlainTextEdit::textCursor() const | - | ||||||||||||||||||||||||
| 91 | { | - | ||||||||||||||||||||||||
| 92 | return never executed: plainTextEdit()->textCursor();return plainTextEdit()->textCursor();never executed: return plainTextEdit()->textCursor(); | 0 | ||||||||||||||||||||||||
| 93 | } | - | ||||||||||||||||||||||||
| 94 | - | |||||||||||||||||||||||||
| 95 | void QAccessiblePlainTextEdit::setTextCursor(const QTextCursor &textCursor) | - | ||||||||||||||||||||||||
| 96 | { | - | ||||||||||||||||||||||||
| 97 | plainTextEdit()->setTextCursor(textCursor); | - | ||||||||||||||||||||||||
| 98 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 99 | - | |||||||||||||||||||||||||
| 100 | QTextDocument* QAccessiblePlainTextEdit::textDocument() const | - | ||||||||||||||||||||||||
| 101 | { | - | ||||||||||||||||||||||||
| 102 | return never executed: plainTextEdit()->document();return plainTextEdit()->document();never executed: return plainTextEdit()->document(); | 0 | ||||||||||||||||||||||||
| 103 | } | - | ||||||||||||||||||||||||
| 104 | - | |||||||||||||||||||||||||
| 105 | QWidget* QAccessiblePlainTextEdit::viewport() const | - | ||||||||||||||||||||||||
| 106 | { | - | ||||||||||||||||||||||||
| 107 | return never executed: plainTextEdit()->viewport();return plainTextEdit()->viewport();never executed: return plainTextEdit()->viewport(); | 0 | ||||||||||||||||||||||||
| 108 | } | - | ||||||||||||||||||||||||
| 109 | - | |||||||||||||||||||||||||
| 110 | void QAccessiblePlainTextEdit::scrollToSubstring(int startIndex, int endIndex) | - | ||||||||||||||||||||||||
| 111 | { | - | ||||||||||||||||||||||||
| 112 | - | |||||||||||||||||||||||||
| 113 | (void)startIndex;; | - | ||||||||||||||||||||||||
| 114 | (void)endIndex;; | - | ||||||||||||||||||||||||
| 115 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 116 | QAccessibleTextEdit::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 | - | |||||||||||||||||||||||||
| 123 | QTextEdit *QAccessibleTextEdit::textEdit() const | - | ||||||||||||||||||||||||
| 124 | { | - | ||||||||||||||||||||||||
| 125 | return never executed: static_cast<QTextEdit *>(widget());return static_cast<QTextEdit *>(widget());never executed: return static_cast<QTextEdit *>(widget()); | 0 | ||||||||||||||||||||||||
| 126 | } | - | ||||||||||||||||||||||||
| 127 | - | |||||||||||||||||||||||||
| 128 | QTextCursor QAccessibleTextEdit::textCursor() const | - | ||||||||||||||||||||||||
| 129 | { | - | ||||||||||||||||||||||||
| 130 | return never executed: textEdit()->textCursor();return textEdit()->textCursor();never executed: return textEdit()->textCursor(); | 0 | ||||||||||||||||||||||||
| 131 | } | - | ||||||||||||||||||||||||
| 132 | - | |||||||||||||||||||||||||
| 133 | QTextDocument *QAccessibleTextEdit::textDocument() const | - | ||||||||||||||||||||||||
| 134 | { | - | ||||||||||||||||||||||||
| 135 | return never executed: textEdit()->document();return textEdit()->document();never executed: return textEdit()->document(); | 0 | ||||||||||||||||||||||||
| 136 | } | - | ||||||||||||||||||||||||
| 137 | - | |||||||||||||||||||||||||
| 138 | void QAccessibleTextEdit::setTextCursor(const QTextCursor &textCursor) | - | ||||||||||||||||||||||||
| 139 | { | - | ||||||||||||||||||||||||
| 140 | textEdit()->setTextCursor(textCursor); | - | ||||||||||||||||||||||||
| 141 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 142 | - | |||||||||||||||||||||||||
| 143 | QWidget *QAccessibleTextEdit::viewport() const | - | ||||||||||||||||||||||||
| 144 | { | - | ||||||||||||||||||||||||
| 145 | return never executed: textEdit()->viewport();return textEdit()->viewport();never executed: return textEdit()->viewport(); | 0 | ||||||||||||||||||||||||
| 146 | } | - | ||||||||||||||||||||||||
| 147 | - | |||||||||||||||||||||||||
| 148 | QPoint 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: result;return result;never executed: return result; | 0 | ||||||||||||||||||||||||
| 154 | } | - | ||||||||||||||||||||||||
| 155 | - | |||||||||||||||||||||||||
| 156 | QString QAccessibleTextEdit::text(QAccessible::Text t) const | - | ||||||||||||||||||||||||
| 157 | { | - | ||||||||||||||||||||||||
| 158 | if (t == QAccessible::Value
| 0 | ||||||||||||||||||||||||
| 159 | return never executed: textEdit()->toPlainText();return textEdit()->toPlainText();never executed: return textEdit()->toPlainText(); | 0 | ||||||||||||||||||||||||
| 160 | - | |||||||||||||||||||||||||
| 161 | return never executed: QAccessibleWidget::text(t);return QAccessibleWidget::text(t);never executed: return QAccessibleWidget::text(t); | 0 | ||||||||||||||||||||||||
| 162 | } | - | ||||||||||||||||||||||||
| 163 | - | |||||||||||||||||||||||||
| 164 | void QAccessibleTextEdit::setText(QAccessible::Text t, const QString &text) | - | ||||||||||||||||||||||||
| 165 | { | - | ||||||||||||||||||||||||
| 166 | if (t != QAccessible::Value
| 0 | ||||||||||||||||||||||||
| 167 | QAccessibleWidget::setText(t, text); | - | ||||||||||||||||||||||||
| 168 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 169 | } | - | ||||||||||||||||||||||||
| 170 | if (textEdit()->isReadOnly()
| 0 | ||||||||||||||||||||||||
| 171 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 172 | - | |||||||||||||||||||||||||
| 173 | textEdit()->setText(text); | - | ||||||||||||||||||||||||
| 174 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 175 | - | |||||||||||||||||||||||||
| 176 | QAccessible::State QAccessibleTextEdit::state() const | - | ||||||||||||||||||||||||
| 177 | { | - | ||||||||||||||||||||||||
| 178 | QAccessible::State st = QAccessibleTextWidget::state(); | - | ||||||||||||||||||||||||
| 179 | if (textEdit()->isReadOnly()
| 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: st;return st;never executed: return st; | 0 | ||||||||||||||||||||||||
| 184 | } | - | ||||||||||||||||||||||||
| 185 | - | |||||||||||||||||||||||||
| 186 | void *QAccessibleTextEdit::interface_cast(QAccessible::InterfaceType t) | - | ||||||||||||||||||||||||
| 187 | { | - | ||||||||||||||||||||||||
| 188 | if (t == QAccessible::TextInterface
| 0 | ||||||||||||||||||||||||
| 189 | return never executed: static_cast<QAccessibleTextInterface*>(this);return static_cast<QAccessibleTextInterface*>(this);never executed: return static_cast<QAccessibleTextInterface*>(this); | 0 | ||||||||||||||||||||||||
| 190 | else if (t == QAccessible::EditableTextInterface
| 0 | ||||||||||||||||||||||||
| 191 | return never executed: static_cast<QAccessibleEditableTextInterface*>(this);return static_cast<QAccessibleEditableTextInterface*>(this);never executed: return static_cast<QAccessibleEditableTextInterface*>(this); | 0 | ||||||||||||||||||||||||
| 192 | return never executed: QAccessibleWidget::interface_cast(t);return QAccessibleWidget::interface_cast(t);never executed: return QAccessibleWidget::interface_cast(t); | 0 | ||||||||||||||||||||||||
| 193 | } | - | ||||||||||||||||||||||||
| 194 | - | |||||||||||||||||||||||||
| 195 | void 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)
| 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 | - | |||||||||||||||||||||||||
| 218 | QAccessibleStackedWidget::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 | - | |||||||||||||||||||||||||
| 224 | QAccessibleInterface *QAccessibleStackedWidget::childAt(int x, int y) const | - | ||||||||||||||||||||||||
| 225 | { | - | ||||||||||||||||||||||||
| 226 | if (!stackedWidget()->isVisible()
| 0 | ||||||||||||||||||||||||
| 227 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 228 | QWidget *currentWidget = stackedWidget()->currentWidget(); | - | ||||||||||||||||||||||||
| 229 | if (!currentWidget
| 0 | ||||||||||||||||||||||||
| 230 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 231 | QPoint position = currentWidget->mapFromGlobal(QPoint(x, y)); | - | ||||||||||||||||||||||||
| 232 | if (currentWidget->rect().contains(position)
| 0 | ||||||||||||||||||||||||
| 233 | return never executed: child(stackedWidget()->currentIndex());return child(stackedWidget()->currentIndex());never executed: return child(stackedWidget()->currentIndex()); | 0 | ||||||||||||||||||||||||
| 234 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 235 | } | - | ||||||||||||||||||||||||
| 236 | - | |||||||||||||||||||||||||
| 237 | int QAccessibleStackedWidget::childCount() const | - | ||||||||||||||||||||||||
| 238 | { | - | ||||||||||||||||||||||||
| 239 | return never executed: stackedWidget()->count();return stackedWidget()->count();never executed: return stackedWidget()->count(); | 0 | ||||||||||||||||||||||||
| 240 | } | - | ||||||||||||||||||||||||
| 241 | - | |||||||||||||||||||||||||
| 242 | int QAccessibleStackedWidget::indexOfChild(const QAccessibleInterface *child) const | - | ||||||||||||||||||||||||
| 243 | { | - | ||||||||||||||||||||||||
| 244 | if (!child
| 0 | ||||||||||||||||||||||||
| 245 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 246 | - | |||||||||||||||||||||||||
| 247 | QWidget *widget = qobject_cast<QWidget*>(child->object()); | - | ||||||||||||||||||||||||
| 248 | return never executed: stackedWidget()->indexOf(widget);return stackedWidget()->indexOf(widget);never executed: return stackedWidget()->indexOf(widget); | 0 | ||||||||||||||||||||||||
| 249 | } | - | ||||||||||||||||||||||||
| 250 | - | |||||||||||||||||||||||||
| 251 | QAccessibleInterface *QAccessibleStackedWidget::child(int index) const | - | ||||||||||||||||||||||||
| 252 | { | - | ||||||||||||||||||||||||
| 253 | if (index < 0
| 0 | ||||||||||||||||||||||||
| 254 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 255 | return never executed: QAccessible::queryAccessibleInterface(stackedWidget()->widget(index));return QAccessible::queryAccessibleInterface(stackedWidget()->widget(index));never executed: return QAccessible::queryAccessibleInterface(stackedWidget()->widget(index)); | 0 | ||||||||||||||||||||||||
| 256 | } | - | ||||||||||||||||||||||||
| 257 | - | |||||||||||||||||||||||||
| 258 | QStackedWidget *QAccessibleStackedWidget::stackedWidget() const | - | ||||||||||||||||||||||||
| 259 | { | - | ||||||||||||||||||||||||
| 260 | return never executed: static_cast<QStackedWidget *>(object());return static_cast<QStackedWidget *>(object());never executed: return static_cast<QStackedWidget *>(object()); | 0 | ||||||||||||||||||||||||
| 261 | } | - | ||||||||||||||||||||||||
| 262 | - | |||||||||||||||||||||||||
| 263 | - | |||||||||||||||||||||||||
| 264 | - | |||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||
| 266 | QAccessibleToolBox::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 | - | |||||||||||||||||||||||||
| 272 | QToolBox * QAccessibleToolBox::toolBox() const | - | ||||||||||||||||||||||||
| 273 | { | - | ||||||||||||||||||||||||
| 274 | return never executed: static_cast<QToolBox *>(object());return static_cast<QToolBox *>(object());never executed: return static_cast<QToolBox *>(object()); | 0 | ||||||||||||||||||||||||
| 275 | } | - | ||||||||||||||||||||||||
| 276 | - | |||||||||||||||||||||||||
| 277 | - | |||||||||||||||||||||||||
| 278 | - | |||||||||||||||||||||||||
| 279 | - | |||||||||||||||||||||||||
| 280 | QAccessibleMdiArea::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 | - | |||||||||||||||||||||||||
| 286 | int QAccessibleMdiArea::childCount() const | - | ||||||||||||||||||||||||
| 287 | { | - | ||||||||||||||||||||||||
| 288 | return never executed: mdiArea()->subWindowList().count();return mdiArea()->subWindowList().count();never executed: return mdiArea()->subWindowList().count(); | 0 | ||||||||||||||||||||||||
| 289 | } | - | ||||||||||||||||||||||||
| 290 | - | |||||||||||||||||||||||||
| 291 | QAccessibleInterface *QAccessibleMdiArea::child(int index) const | - | ||||||||||||||||||||||||
| 292 | { | - | ||||||||||||||||||||||||
| 293 | QList<QMdiSubWindow *> subWindows = mdiArea()->subWindowList(); | - | ||||||||||||||||||||||||
| 294 | QWidget *targetObject = subWindows.value(index); | - | ||||||||||||||||||||||||
| 295 | if (!targetObject
| 0 | ||||||||||||||||||||||||
| 296 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 297 | return never executed: QAccessible::queryAccessibleInterface(targetObject);return QAccessible::queryAccessibleInterface(targetObject);never executed: return QAccessible::queryAccessibleInterface(targetObject); | 0 | ||||||||||||||||||||||||
| 298 | } | - | ||||||||||||||||||||||||
| 299 | - | |||||||||||||||||||||||||
| 300 | - | |||||||||||||||||||||||||
| 301 | int QAccessibleMdiArea::indexOfChild(const QAccessibleInterface *child) const | - | ||||||||||||||||||||||||
| 302 | { | - | ||||||||||||||||||||||||
| 303 | if (!child
| 0 | ||||||||||||||||||||||||
| 304 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 305 | if (QMdiSubWindow *window = qobject_cast<QMdiSubWindow *>(child->object())
| 0 | ||||||||||||||||||||||||
| 306 | return never executed: mdiArea()->subWindowList().indexOf(window);return mdiArea()->subWindowList().indexOf(window);never executed: return mdiArea()->subWindowList().indexOf(window); | 0 | ||||||||||||||||||||||||
| 307 | } | - | ||||||||||||||||||||||||
| 308 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 309 | } | - | ||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||
| 311 | QMdiArea *QAccessibleMdiArea::mdiArea() const | - | ||||||||||||||||||||||||
| 312 | { | - | ||||||||||||||||||||||||
| 313 | return never executed: static_cast<QMdiArea *>(object());return static_cast<QMdiArea *>(object());never executed: return static_cast<QMdiArea *>(object()); | 0 | ||||||||||||||||||||||||
| 314 | } | - | ||||||||||||||||||||||||
| 315 | - | |||||||||||||||||||||||||
| 316 | - | |||||||||||||||||||||||||
| 317 | QAccessibleMdiSubWindow::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 | - | |||||||||||||||||||||||||
| 323 | QString QAccessibleMdiSubWindow::text(QAccessible::Text textType) const | - | ||||||||||||||||||||||||
| 324 | { | - | ||||||||||||||||||||||||
| 325 | if (textType == QAccessible::Name
| 0 | ||||||||||||||||||||||||
| 326 | QString title = mdiSubWindow()->windowTitle(); | - | ||||||||||||||||||||||||
| 327 | title.replace(QLatin1String("[*]"), QLatin1String("")); | - | ||||||||||||||||||||||||
| 328 | return never executed: title;return title;never executed: return title; | 0 | ||||||||||||||||||||||||
| 329 | } | - | ||||||||||||||||||||||||
| 330 | return never executed: QAccessibleWidget::text(textType);return QAccessibleWidget::text(textType);never executed: return QAccessibleWidget::text(textType); | 0 | ||||||||||||||||||||||||
| 331 | } | - | ||||||||||||||||||||||||
| 332 | - | |||||||||||||||||||||||||
| 333 | void QAccessibleMdiSubWindow::setText(QAccessible::Text textType, const QString &text) | - | ||||||||||||||||||||||||
| 334 | { | - | ||||||||||||||||||||||||
| 335 | if (textType == QAccessible::Name
| 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 | - | |||||||||||||||||||||||||
| 341 | QAccessible::State QAccessibleMdiSubWindow::state() const | - | ||||||||||||||||||||||||
| 342 | { | - | ||||||||||||||||||||||||
| 343 | QAccessible::State state; | - | ||||||||||||||||||||||||
| 344 | state.focusable = true; | - | ||||||||||||||||||||||||
| 345 | if (!mdiSubWindow()->isMaximized()
| 0 | ||||||||||||||||||||||||
| 346 | state.movable = true; | - | ||||||||||||||||||||||||
| 347 | state.sizeable = true; | - | ||||||||||||||||||||||||
| 348 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 349 | if (mdiSubWindow()->isAncestorOf(QApplication::focusWidget())
| 0 | ||||||||||||||||||||||||
| 350 | || QApplication::focusWidget() == mdiSubWindow()
| 0 | ||||||||||||||||||||||||
| 351 | state.focused = true; never executed: state.focused = true; | 0 | ||||||||||||||||||||||||
| 352 | if (!mdiSubWindow()->isVisible()
| 0 | ||||||||||||||||||||||||
| 353 | state.invisible = true; never executed: state.invisible = true; | 0 | ||||||||||||||||||||||||
| 354 | if (const
| 0 | ||||||||||||||||||||||||
| 355 | if (!parent->contentsRect().contains(mdiSubWindow()->geometry())
| 0 | ||||||||||||||||||||||||
| 356 | state.offscreen = true; never executed: state.offscreen = true; | 0 | ||||||||||||||||||||||||
| 357 | if (!mdiSubWindow()->isEnabled()
| 0 | ||||||||||||||||||||||||
| 358 | state.disabled = true; never executed: state.disabled = true; | 0 | ||||||||||||||||||||||||
| 359 | return never executed: state;return state;never executed: return state; | 0 | ||||||||||||||||||||||||
| 360 | } | - | ||||||||||||||||||||||||
| 361 | - | |||||||||||||||||||||||||
| 362 | int QAccessibleMdiSubWindow::childCount() const | - | ||||||||||||||||||||||||
| 363 | { | - | ||||||||||||||||||||||||
| 364 | if (mdiSubWindow()->widget()
| 0 | ||||||||||||||||||||||||
| 365 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||
| 366 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 367 | } | - | ||||||||||||||||||||||||
| 368 | - | |||||||||||||||||||||||||
| 369 | QAccessibleInterface *QAccessibleMdiSubWindow::child(int index) const | - | ||||||||||||||||||||||||
| 370 | { | - | ||||||||||||||||||||||||
| 371 | QMdiSubWindow *source = mdiSubWindow(); | - | ||||||||||||||||||||||||
| 372 | if (index != 0
| 0 | ||||||||||||||||||||||||
| 373 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 374 | - | |||||||||||||||||||||||||
| 375 | return never executed: QAccessible::queryAccessibleInterface(source->widget());return QAccessible::queryAccessibleInterface(source->widget());never executed: return QAccessible::queryAccessibleInterface(source->widget()); | 0 | ||||||||||||||||||||||||
| 376 | } | - | ||||||||||||||||||||||||
| 377 | - | |||||||||||||||||||||||||
| 378 | int QAccessibleMdiSubWindow::indexOfChild(const QAccessibleInterface *child) const | - | ||||||||||||||||||||||||
| 379 | { | - | ||||||||||||||||||||||||
| 380 | if (child
| 0 | ||||||||||||||||||||||||
| 381 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 382 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 383 | } | - | ||||||||||||||||||||||||
| 384 | - | |||||||||||||||||||||||||
| 385 | QRect QAccessibleMdiSubWindow::rect() const | - | ||||||||||||||||||||||||
| 386 | { | - | ||||||||||||||||||||||||
| 387 | if (mdiSubWindow()->isHidden()
| 0 | ||||||||||||||||||||||||
| 388 | return never executed: QRect();return QRect();never executed: return QRect(); | 0 | ||||||||||||||||||||||||
| 389 | if (!mdiSubWindow()->parent()
| 0 | ||||||||||||||||||||||||
| 390 | return never executed: QAccessibleWidget::rect();return QAccessibleWidget::rect();never executed: return QAccessibleWidget::rect(); | 0 | ||||||||||||||||||||||||
| 391 | const QPoint pos = mdiSubWindow()->mapToGlobal(QPoint(0, 0)); | - | ||||||||||||||||||||||||
| 392 | return never executed: QRect(pos, mdiSubWindow()->size());return QRect(pos, mdiSubWindow()->size());never executed: return QRect(pos, mdiSubWindow()->size()); | 0 | ||||||||||||||||||||||||
| 393 | } | - | ||||||||||||||||||||||||
| 394 | - | |||||||||||||||||||||||||
| 395 | QMdiSubWindow *QAccessibleMdiSubWindow::mdiSubWindow() const | - | ||||||||||||||||||||||||
| 396 | { | - | ||||||||||||||||||||||||
| 397 | return never executed: static_cast<QMdiSubWindow *>(object());return static_cast<QMdiSubWindow *>(object());never executed: return static_cast<QMdiSubWindow *>(object()); | 0 | ||||||||||||||||||||||||
| 398 | } | - | ||||||||||||||||||||||||
| 399 | - | |||||||||||||||||||||||||
| 400 | - | |||||||||||||||||||||||||
| 401 | - | |||||||||||||||||||||||||
| 402 | - | |||||||||||||||||||||||||
| 403 | QAccessibleDialogButtonBox::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 | - | |||||||||||||||||||||||||
| 412 | QAccessibleTextBrowser::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 | - | |||||||||||||||||||||||||
| 418 | QAccessible::Role QAccessibleTextBrowser::role() const | - | ||||||||||||||||||||||||
| 419 | { | - | ||||||||||||||||||||||||
| 420 | return never executed: QAccessible::StaticText;return QAccessible::StaticText;never executed: return QAccessible::StaticText; | 0 | ||||||||||||||||||||||||
| 421 | } | - | ||||||||||||||||||||||||
| 422 | - | |||||||||||||||||||||||||
| 423 | - | |||||||||||||||||||||||||
| 424 | - | |||||||||||||||||||||||||
| 425 | - | |||||||||||||||||||||||||
| 426 | QAccessibleCalendarWidget::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 | - | |||||||||||||||||||||||||
| 432 | int QAccessibleCalendarWidget::childCount() const | - | ||||||||||||||||||||||||
| 433 | { | - | ||||||||||||||||||||||||
| 434 | return never executed: calendarWidget()->isNavigationBarVisible() ? 2 : 1;return calendarWidget()->isNavigationBarVisible() ? 2 : 1;never executed: return calendarWidget()->isNavigationBarVisible() ? 2 : 1; | 0 | ||||||||||||||||||||||||
| 435 | } | - | ||||||||||||||||||||||||
| 436 | - | |||||||||||||||||||||||||
| 437 | int QAccessibleCalendarWidget::indexOfChild(const QAccessibleInterface *child) const | - | ||||||||||||||||||||||||
| 438 | { | - | ||||||||||||||||||||||||
| 439 | if (!child
| 0 | ||||||||||||||||||||||||
| 440 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 441 | if (qobject_cast<QAbstractItemView *>(child->object())
| 0 | ||||||||||||||||||||||||
| 442 | return never executed: childCount() - 1;return childCount() - 1;never executed: return childCount() - 1; | 0 | ||||||||||||||||||||||||
| 443 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 444 | } | - | ||||||||||||||||||||||||
| 445 | - | |||||||||||||||||||||||||
| 446 | QAccessibleInterface *QAccessibleCalendarWidget::child(int index) const | - | ||||||||||||||||||||||||
| 447 | { | - | ||||||||||||||||||||||||
| 448 | if (index < 0
| 0 | ||||||||||||||||||||||||
| 449 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 450 | - | |||||||||||||||||||||||||
| 451 | if (childCount() > 1
| 0 | ||||||||||||||||||||||||
| 452 | return never executed: QAccessible::queryAccessibleInterface(navigationBar());return QAccessible::queryAccessibleInterface(navigationBar());never executed: return QAccessible::queryAccessibleInterface(navigationBar()); | 0 | ||||||||||||||||||||||||
| 453 | - | |||||||||||||||||||||||||
| 454 | return never executed: QAccessible::queryAccessibleInterface(calendarView());return QAccessible::queryAccessibleInterface(calendarView());never executed: return QAccessible::queryAccessibleInterface(calendarView()); | 0 | ||||||||||||||||||||||||
| 455 | } | - | ||||||||||||||||||||||||
| 456 | - | |||||||||||||||||||||||||
| 457 | QCalendarWidget *QAccessibleCalendarWidget::calendarWidget() const | - | ||||||||||||||||||||||||
| 458 | { | - | ||||||||||||||||||||||||
| 459 | return never executed: static_cast<QCalendarWidget *>(object());return static_cast<QCalendarWidget *>(object());never executed: return static_cast<QCalendarWidget *>(object()); | 0 | ||||||||||||||||||||||||
| 460 | } | - | ||||||||||||||||||||||||
| 461 | - | |||||||||||||||||||||||||
| 462 | QAbstractItemView *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")
| 0 | ||||||||||||||||||||||||
| 466 | return never executed: static_cast<QAbstractItemView *>(child);return static_cast<QAbstractItemView *>(child);never executed: return static_cast<QAbstractItemView *>(child); | 0 | ||||||||||||||||||||||||
| 467 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 468 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 469 | } | - | ||||||||||||||||||||||||
| 470 | - | |||||||||||||||||||||||||
| 471 | QWidget *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")
| 0 | ||||||||||||||||||||||||
| 475 | return never executed: static_cast<QWidget *>(child);return static_cast<QWidget *>(child);never executed: return static_cast<QWidget *>(child); | 0 | ||||||||||||||||||||||||
| 476 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 477 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 478 | } | - | ||||||||||||||||||||||||
| 479 | QAccessibleDockWidget::QAccessibleDockWidget(QWidget *widget) | - | ||||||||||||||||||||||||
| 480 | : QAccessibleWidget(widget, QAccessible::Window) | - | ||||||||||||||||||||||||
| 481 | { | - | ||||||||||||||||||||||||
| 482 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 483 | - | |||||||||||||||||||||||||
| 484 | QDockWidgetLayout *QAccessibleDockWidget::dockWidgetLayout() const | - | ||||||||||||||||||||||||
| 485 | { | - | ||||||||||||||||||||||||
| 486 | return never executed: qobject_cast<QDockWidgetLayout*>(dockWidget()->layout());return qobject_cast<QDockWidgetLayout*>(dockWidget()->layout());never executed: return qobject_cast<QDockWidgetLayout*>(dockWidget()->layout()); | 0 | ||||||||||||||||||||||||
| 487 | } | - | ||||||||||||||||||||||||
| 488 | - | |||||||||||||||||||||||||
| 489 | int QAccessibleDockWidget::childCount() const | - | ||||||||||||||||||||||||
| 490 | { | - | ||||||||||||||||||||||||
| 491 | if (dockWidget()->titleBarWidget()
| 0 | ||||||||||||||||||||||||
| 492 | return never executed: dockWidget()->widget() ? 2 : 1;return dockWidget()->widget() ? 2 : 1;never executed: return dockWidget()->widget() ? 2 : 1; | 0 | ||||||||||||||||||||||||
| 493 | } | - | ||||||||||||||||||||||||
| 494 | return never executed: dockWidgetLayout()->count();return dockWidgetLayout()->count();never executed: return dockWidgetLayout()->count(); | 0 | ||||||||||||||||||||||||
| 495 | } | - | ||||||||||||||||||||||||
| 496 | - | |||||||||||||||||||||||||
| 497 | QAccessibleInterface *QAccessibleDockWidget::child(int index) const | - | ||||||||||||||||||||||||
| 498 | { | - | ||||||||||||||||||||||||
| 499 | if (dockWidget()->titleBarWidget()
| 0 | ||||||||||||||||||||||||
| 500 | if ((!dockWidget()->widget()
| 0 | ||||||||||||||||||||||||
| 501 | return never executed: QAccessible::queryAccessibleInterface(dockWidget()->titleBarWidget());return QAccessible::queryAccessibleInterface(dockWidget()->titleBarWidget());never executed: return QAccessible::queryAccessibleInterface(dockWidget()->titleBarWidget()); | 0 | ||||||||||||||||||||||||
| 502 | if (index == 0
| 0 | ||||||||||||||||||||||||
| 503 | return never executed: QAccessible::queryAccessibleInterface(dockWidget()->widget());return QAccessible::queryAccessibleInterface(dockWidget()->widget());never executed: return QAccessible::queryAccessibleInterface(dockWidget()->widget()); | 0 | ||||||||||||||||||||||||
| 504 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 505 | QLayoutItem *item = dockWidgetLayout()->itemAt(index); | - | ||||||||||||||||||||||||
| 506 | if (item
| 0 | ||||||||||||||||||||||||
| 507 | return never executed: QAccessible::queryAccessibleInterface(item->widget());return QAccessible::queryAccessibleInterface(item->widget());never executed: return QAccessible::queryAccessibleInterface(item->widget()); | 0 | ||||||||||||||||||||||||
| 508 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 509 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 510 | } | - | ||||||||||||||||||||||||
| 511 | - | |||||||||||||||||||||||||
| 512 | int QAccessibleDockWidget::indexOfChild(const QAccessibleInterface *child) const | - | ||||||||||||||||||||||||
| 513 | { | - | ||||||||||||||||||||||||
| 514 | if (!child
| 0 | ||||||||||||||||||||||||
| 515 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 516 | - | |||||||||||||||||||||||||
| 517 | if (dockWidget()->titleBarWidget() == child->object()
| 0 | ||||||||||||||||||||||||
| 518 | return never executed: dockWidget()->widget() ? 1 : 0;return dockWidget()->widget() ? 1 : 0;never executed: return dockWidget()->widget() ? 1 : 0; | 0 | ||||||||||||||||||||||||
| 519 | } | - | ||||||||||||||||||||||||
| 520 | - | |||||||||||||||||||||||||
| 521 | return never executed: dockWidgetLayout()->indexOf(qobject_cast<QWidget*>(child->object()));return dockWidgetLayout()->indexOf(qobject_cast<QWidget*>(child->object()));never executed: return dockWidgetLayout()->indexOf(qobject_cast<QWidget*>(child->object())); | 0 | ||||||||||||||||||||||||
| 522 | } | - | ||||||||||||||||||||||||
| 523 | - | |||||||||||||||||||||||||
| 524 | QRect QAccessibleDockWidget::rect() const | - | ||||||||||||||||||||||||
| 525 | { | - | ||||||||||||||||||||||||
| 526 | QRect rect; | - | ||||||||||||||||||||||||
| 527 | - | |||||||||||||||||||||||||
| 528 | if (dockWidget()->isFloating()
| 0 | ||||||||||||||||||||||||
| 529 | rect = dockWidget()->frameGeometry(); | - | ||||||||||||||||||||||||
| 530 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 531 | rect = dockWidget()->rect(); | - | ||||||||||||||||||||||||
| 532 | rect.moveTopLeft(dockWidget()->mapToGlobal(rect.topLeft())); | - | ||||||||||||||||||||||||
| 533 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 534 | - | |||||||||||||||||||||||||
| 535 | return never executed: rect;return rect;never executed: return rect; | 0 | ||||||||||||||||||||||||
| 536 | } | - | ||||||||||||||||||||||||
| 537 | - | |||||||||||||||||||||||||
| 538 | QDockWidget *QAccessibleDockWidget::dockWidget() const | - | ||||||||||||||||||||||||
| 539 | { | - | ||||||||||||||||||||||||
| 540 | return never executed: static_cast<QDockWidget *>(object());return static_cast<QDockWidget *>(object());never executed: return static_cast<QDockWidget *>(object()); | 0 | ||||||||||||||||||||||||
| 541 | } | - | ||||||||||||||||||||||||
| 542 | - | |||||||||||||||||||||||||
| 543 | QString QAccessibleDockWidget::text(QAccessible::Text t) const | - | ||||||||||||||||||||||||
| 544 | { | - | ||||||||||||||||||||||||
| 545 | if (t == QAccessible::Name
| 0 | ||||||||||||||||||||||||
| 546 | return never executed: qt_accStripAmp(dockWidget()->windowTitle());return qt_accStripAmp(dockWidget()->windowTitle());never executed: return qt_accStripAmp(dockWidget()->windowTitle()); | 0 | ||||||||||||||||||||||||
| 547 | } else if (t == QAccessible::Accelerator
| 0 | ||||||||||||||||||||||||
| 548 | return never executed: qt_accHotKey(dockWidget()->windowTitle());return qt_accHotKey(dockWidget()->windowTitle());never executed: return qt_accHotKey(dockWidget()->windowTitle()); | 0 | ||||||||||||||||||||||||
| 549 | } | - | ||||||||||||||||||||||||
| 550 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||
| 551 | } | - | ||||||||||||||||||||||||
| 552 | - | |||||||||||||||||||||||||
| 553 | - | |||||||||||||||||||||||||
| 554 | - | |||||||||||||||||||||||||
| 555 | - | |||||||||||||||||||||||||
| 556 | QAccessibleTextWidget::QAccessibleTextWidget(QWidget *o, QAccessible::Role r, const QString &name): | - | ||||||||||||||||||||||||
| 557 | QAccessibleWidget(o, r, name) | - | ||||||||||||||||||||||||
| 558 | { | - | ||||||||||||||||||||||||
| 559 | - | |||||||||||||||||||||||||
| 560 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 561 | - | |||||||||||||||||||||||||
| 562 | QAccessible::State QAccessibleTextWidget::state() const | - | ||||||||||||||||||||||||
| 563 | { | - | ||||||||||||||||||||||||
| 564 | QAccessible::State s = QAccessibleWidget::state(); | - | ||||||||||||||||||||||||
| 565 | s.selectableText = true; | - | ||||||||||||||||||||||||
| 566 | s.multiLine = true; | - | ||||||||||||||||||||||||
| 567 | return never executed: s;return s;never executed: return s; | 0 | ||||||||||||||||||||||||
| 568 | } | - | ||||||||||||||||||||||||
| 569 | - | |||||||||||||||||||||||||
| 570 | QRect QAccessibleTextWidget::characterRect(int offset) const | - | ||||||||||||||||||||||||
| 571 | { | - | ||||||||||||||||||||||||
| 572 | QTextBlock block = textDocument()->findBlock(offset); | - | ||||||||||||||||||||||||
| 573 | if (!block.isValid()
| 0 | ||||||||||||||||||||||||
| 574 | return never executed: QRect();return 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()
| 0 | ||||||||||||||||||||||||
| 584 | qreal x = line.cursorToX(relativeOffset); | - | ||||||||||||||||||||||||
| 585 | - | |||||||||||||||||||||||||
| 586 | QTextCharFormat format; | - | ||||||||||||||||||||||||
| 587 | QTextBlock::iterator iter = block.begin(); | - | ||||||||||||||||||||||||
| 588 | if (iter.atEnd()
| 0 | ||||||||||||||||||||||||
| 589 | format = block.charFormat(); never executed: format = block.charFormat(); | 0 | ||||||||||||||||||||||||
| 590 | else { | - | ||||||||||||||||||||||||
| 591 | while (!iter.atEnd()
| 0 | ||||||||||||||||||||||||
| 592 | ++ never executed: iter;++iter;never executed: ++iter; | 0 | ||||||||||||||||||||||||
| 593 | if (iter.atEnd()
| 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()
| 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: r;return r;never executed: return r; | 0 | ||||||||||||||||||||||||
| 611 | } | - | ||||||||||||||||||||||||
| 612 | - | |||||||||||||||||||||||||
| 613 | int QAccessibleTextWidget::offsetAtPoint(const QPoint &point) const | - | ||||||||||||||||||||||||
| 614 | { | - | ||||||||||||||||||||||||
| 615 | QPoint p = viewport()->mapFromGlobal(point); | - | ||||||||||||||||||||||||
| 616 | - | |||||||||||||||||||||||||
| 617 | p += scrollBarPosition(); | - | ||||||||||||||||||||||||
| 618 | return never executed: textDocument()->documentLayout()->hitTest(p, Qt::ExactHit);return textDocument()->documentLayout()->hitTest(p, Qt::ExactHit);never executed: return textDocument()->documentLayout()->hitTest(p, Qt::ExactHit); | 0 | ||||||||||||||||||||||||
| 619 | } | - | ||||||||||||||||||||||||
| 620 | - | |||||||||||||||||||||||||
| 621 | int QAccessibleTextWidget::selectionCount() const | - | ||||||||||||||||||||||||
| 622 | { | - | ||||||||||||||||||||||||
| 623 | return never executed: textCursor().hasSelection() ? 1 : 0;return textCursor().hasSelection() ? 1 : 0;never executed: return textCursor().hasSelection() ? 1 : 0; | 0 | ||||||||||||||||||||||||
| 624 | } | - | ||||||||||||||||||||||||
| 625 | - | |||||||||||||||||||||||||
| 626 | namespace { | - | ||||||||||||||||||||||||
| 627 | class 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 | ||||||||||||||||||||||||
| 632 | public: | - | ||||||||||||||||||||||||
| 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 | }; | - | ||||||||||||||||||||||||
| 637 | class AttributeFormatter { | - | ||||||||||||||||||||||||
| 638 | QString string; | - | ||||||||||||||||||||||||
| 639 | public: | - | ||||||||||||||||||||||||
| 640 | AttributeFormatterRef operator[](const char *key) | - | ||||||||||||||||||||||||
| 641 | { return never executed: AttributeFormatterRef(string, key);return AttributeFormatterRef(string, key);never executed: }return AttributeFormatterRef(string, key); | 0 | ||||||||||||||||||||||||
| 642 | - | |||||||||||||||||||||||||
| 643 | QString toFormatted() const { return never executed: string;return string;never executed: }return string; | 0 | ||||||||||||||||||||||||
| 644 | }; | - | ||||||||||||||||||||||||
| 645 | } | - | ||||||||||||||||||||||||
| 646 | - | |||||||||||||||||||||||||
| 647 | QString QAccessibleTextWidget::attributes(int offset, int *startOffset, int *endOffset) const | - | ||||||||||||||||||||||||
| 648 | { | - | ||||||||||||||||||||||||
| 649 | - | |||||||||||||||||||||||||
| 650 | - | |||||||||||||||||||||||||
| 651 | - | |||||||||||||||||||||||||
| 652 | - | |||||||||||||||||||||||||
| 653 | - | |||||||||||||||||||||||||
| 654 | if (offset == -2
| 0 | ||||||||||||||||||||||||
| 655 | offset = cursorPosition(); never executed: offset = cursorPosition(); | 0 | ||||||||||||||||||||||||
| 656 | - | |||||||||||||||||||||||||
| 657 | const int charCount = characterCount(); | - | ||||||||||||||||||||||||
| 658 | - | |||||||||||||||||||||||||
| 659 | - | |||||||||||||||||||||||||
| 660 | - | |||||||||||||||||||||||||
| 661 | if (offset == -1
| 0 | ||||||||||||||||||||||||
| 662 | offset = charCount - 1; never executed: offset = charCount - 1; | 0 | ||||||||||||||||||||||||
| 663 | - | |||||||||||||||||||||||||
| 664 | if (offset < 0
| 0 | ||||||||||||||||||||||||
| 665 | *startOffset = -1; | - | ||||||||||||||||||||||||
| 666 | *endOffset = -1; | - | ||||||||||||||||||||||||
| 667 | return never executed: QString();return 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()
| 0 | ||||||||||||||||||||||||
| 681 | QTextFragment f = iter.fragment(); | - | ||||||||||||||||||||||||
| 682 | if (f.contains(offset)
| 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()
| 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: else {end of block | 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()
| 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
| 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
| 0 | ||||||||||||||||||||||||
| 732 | underlineStyle = QTextCharFormat::SingleUnderline; never executed: underlineStyle = QTextCharFormat::SingleUnderline; | 0 | ||||||||||||||||||||||||
| 733 | QString underlineStyleValue; | - | ||||||||||||||||||||||||
| 734 | switch (underlineStyle) { | - | ||||||||||||||||||||||||
| 735 | case never executed: QTextCharFormat::NoUnderline:case QTextCharFormat::NoUnderline:never executed: case QTextCharFormat::NoUnderline: | 0 | ||||||||||||||||||||||||
| 736 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 737 | case never executed: QTextCharFormat::SingleUnderline:case 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: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 739 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 740 | case never executed: QTextCharFormat::DashUnderline:case 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: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 742 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 743 | case never executed: QTextCharFormat::DotLine:case 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: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 745 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 746 | case never executed: QTextCharFormat::DashDotLine:case 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: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 748 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 749 | case never executed: QTextCharFormat::DashDotDotLine:case 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: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 751 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 752 | case never executed: QTextCharFormat::WaveUnderline:case 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: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 754 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 755 | case never executed: QTextCharFormat::SpellCheckUnderline:case 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: qstring_literal_temp;return 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()
| 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: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 765 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 766 | - | |||||||||||||||||||||||||
| 767 | if (block.textDirection() == Qt::RightToLeft
| 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: qstring_literal_temp;return 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
| 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
| 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: Qt::AlignLeft:case 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: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 786 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 787 | case never executed: Qt::AlignRight:case 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: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 789 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 790 | case never executed: Qt::AlignHCenter:case 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: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 792 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 793 | case never executed: Qt::AlignJustify:case 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: qstring_literal_temp;return qstring_literal_temp;never executed: }());return qstring_literal_temp; | 0 | ||||||||||||||||||||||||
| 795 | break; never executed: break; | 0 | ||||||||||||||||||||||||
| 796 | } | - | ||||||||||||||||||||||||
| 797 | - | |||||||||||||||||||||||||
| 798 | return never executed: attrs.toFormatted();return attrs.toFormatted();never executed: return attrs.toFormatted(); | 0 | ||||||||||||||||||||||||
| 799 | } | - | ||||||||||||||||||||||||
| 800 | - | |||||||||||||||||||||||||
| 801 | int QAccessibleTextWidget::cursorPosition() const | - | ||||||||||||||||||||||||
| 802 | { | - | ||||||||||||||||||||||||
| 803 | return never executed: textCursor().position();return textCursor().position();never executed: return textCursor().position(); | 0 | ||||||||||||||||||||||||
| 804 | } | - | ||||||||||||||||||||||||
| 805 | - | |||||||||||||||||||||||||
| 806 | void QAccessibleTextWidget::selection(int selectionIndex, int *startOffset, int *endOffset) const | - | ||||||||||||||||||||||||
| 807 | { | - | ||||||||||||||||||||||||
| 808 | *startOffset = *endOffset = 0; | - | ||||||||||||||||||||||||
| 809 | QTextCursor cursor = textCursor(); | - | ||||||||||||||||||||||||
| 810 | - | |||||||||||||||||||||||||
| 811 | if (selectionIndex != 0
| 0 | ||||||||||||||||||||||||
| 812 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 813 | - | |||||||||||||||||||||||||
| 814 | *startOffset = cursor.selectionStart(); | - | ||||||||||||||||||||||||
| 815 | *endOffset = cursor.selectionEnd(); | - | ||||||||||||||||||||||||
| 816 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 817 | - | |||||||||||||||||||||||||
| 818 | QString 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: cursor.selectedText().replace(QChar(QChar::ParagraphSeparator), QLatin1Char('\n'));return cursor.selectedText().replace(QChar(QChar::ParagraphSeparator), QLatin1Char('\n'));never executed: return cursor.selectedText().replace(QChar(QChar::ParagraphSeparator), QLatin1Char('\n')); | 0 | ||||||||||||||||||||||||
| 826 | } | - | ||||||||||||||||||||||||
| 827 | - | |||||||||||||||||||||||||
| 828 | QPoint QAccessibleTextWidget::scrollBarPosition() const | - | ||||||||||||||||||||||||
| 829 | { | - | ||||||||||||||||||||||||
| 830 | return never executed: QPoint(0, 0);return QPoint(0, 0);never executed: return QPoint(0, 0); | 0 | ||||||||||||||||||||||||
| 831 | } | - | ||||||||||||||||||||||||
| 832 | - | |||||||||||||||||||||||||
| 833 | - | |||||||||||||||||||||||||
| 834 | QString 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: text(boundaries.first, boundaries.second);return text(boundaries.first, boundaries.second);never executed: return text(boundaries.first, boundaries.second); | 0 | ||||||||||||||||||||||||
| 850 | } | - | ||||||||||||||||||||||||
| 851 | - | |||||||||||||||||||||||||
| 852 | - | |||||||||||||||||||||||||
| 853 | QString 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: text(boundaries.first, boundaries.second);return text(boundaries.first, boundaries.second);never executed: return text(boundaries.first, boundaries.second); | 0 | ||||||||||||||||||||||||
| 869 | } | - | ||||||||||||||||||||||||
| 870 | - | |||||||||||||||||||||||||
| 871 | QString 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: text(boundaries.first, boundaries.second);return text(boundaries.first, boundaries.second);never executed: return text(boundaries.first, boundaries.second); | 0 | ||||||||||||||||||||||||
| 885 | } | - | ||||||||||||||||||||||||
| 886 | - | |||||||||||||||||||||||||
| 887 | void QAccessibleTextWidget::setCursorPosition(int position) | - | ||||||||||||||||||||||||
| 888 | { | - | ||||||||||||||||||||||||
| 889 | QTextCursor cursor = textCursor(); | - | ||||||||||||||||||||||||
| 890 | cursor.setPosition(position); | - | ||||||||||||||||||||||||
| 891 | setTextCursor(cursor); | - | ||||||||||||||||||||||||
| 892 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 893 | - | |||||||||||||||||||||||||
| 894 | void QAccessibleTextWidget::addSelection(int startOffset, int endOffset) | - | ||||||||||||||||||||||||
| 895 | { | - | ||||||||||||||||||||||||
| 896 | setSelection(0, startOffset, endOffset); | - | ||||||||||||||||||||||||
| 897 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 898 | - | |||||||||||||||||||||||||
| 899 | void QAccessibleTextWidget::removeSelection(int selectionIndex) | - | ||||||||||||||||||||||||
| 900 | { | - | ||||||||||||||||||||||||
| 901 | if (selectionIndex != 0
| 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 | - | |||||||||||||||||||||||||
| 909 | void QAccessibleTextWidget::setSelection(int selectionIndex, int startOffset, int endOffset) | - | ||||||||||||||||||||||||
| 910 | { | - | ||||||||||||||||||||||||
| 911 | if (selectionIndex != 0
| 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 | - | |||||||||||||||||||||||||
| 920 | int QAccessibleTextWidget::characterCount() const | - | ||||||||||||||||||||||||
| 921 | { | - | ||||||||||||||||||||||||
| 922 | QTextCursor cursor = textCursor(); | - | ||||||||||||||||||||||||
| 923 | cursor.movePosition(QTextCursor::End); | - | ||||||||||||||||||||||||
| 924 | return never executed: cursor.position();return cursor.position();never executed: return cursor.position(); | 0 | ||||||||||||||||||||||||
| 925 | } | - | ||||||||||||||||||||||||
| 926 | - | |||||||||||||||||||||||||
| 927 | QTextCursor 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: cursor;return cursor;never executed: return cursor; | 0 | ||||||||||||||||||||||||
| 934 | } | - | ||||||||||||||||||||||||
| 935 | - | |||||||||||||||||||||||||
| 936 | void QAccessibleTextWidget::deleteText(int startOffset, int endOffset) | - | ||||||||||||||||||||||||
| 937 | { | - | ||||||||||||||||||||||||
| 938 | QTextCursor cursor = textCursorForRange(startOffset, endOffset); | - | ||||||||||||||||||||||||
| 939 | cursor.removeSelectedText(); | - | ||||||||||||||||||||||||
| 940 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 941 | - | |||||||||||||||||||||||||
| 942 | void 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 | - | |||||||||||||||||||||||||
| 949 | void 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 | - | |||||||||||||||||||||||||
| 959 | QAccessibleMainWindow::QAccessibleMainWindow(QWidget *widget) | - | ||||||||||||||||||||||||
| 960 | : QAccessibleWidget(widget, QAccessible::Window) { } never executed: end of block | 0 | ||||||||||||||||||||||||
| 961 | - | |||||||||||||||||||||||||
| 962 | QAccessibleInterface *QAccessibleMainWindow::child(int index) const | - | ||||||||||||||||||||||||
| 963 | { | - | ||||||||||||||||||||||||
| 964 | QList<QWidget*> kids = childWidgets(mainWindow()); | - | ||||||||||||||||||||||||
| 965 | if (index >= 0
| 0 | ||||||||||||||||||||||||
| 966 | return never executed: QAccessible::queryAccessibleInterface(kids.at(index));return QAccessible::queryAccessibleInterface(kids.at(index));never executed: return QAccessible::queryAccessibleInterface(kids.at(index)); | 0 | ||||||||||||||||||||||||
| 967 | } | - | ||||||||||||||||||||||||
| 968 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 969 | } | - | ||||||||||||||||||||||||
| 970 | - | |||||||||||||||||||||||||
| 971 | int QAccessibleMainWindow::childCount() const | - | ||||||||||||||||||||||||
| 972 | { | - | ||||||||||||||||||||||||
| 973 | QList<QWidget*> kids = childWidgets(mainWindow()); | - | ||||||||||||||||||||||||
| 974 | return never executed: kids.count();return kids.count();never executed: return kids.count(); | 0 | ||||||||||||||||||||||||
| 975 | } | - | ||||||||||||||||||||||||
| 976 | - | |||||||||||||||||||||||||
| 977 | int QAccessibleMainWindow::indexOfChild(const QAccessibleInterface *iface) const | - | ||||||||||||||||||||||||
| 978 | { | - | ||||||||||||||||||||||||
| 979 | QList<QWidget*> kids = childWidgets(mainWindow()); | - | ||||||||||||||||||||||||
| 980 | return never executed: kids.indexOf(static_cast<QWidget*>(iface->object()));return kids.indexOf(static_cast<QWidget*>(iface->object()));never executed: return kids.indexOf(static_cast<QWidget*>(iface->object())); | 0 | ||||||||||||||||||||||||
| 981 | } | - | ||||||||||||||||||||||||
| 982 | - | |||||||||||||||||||||||||
| 983 | QAccessibleInterface *QAccessibleMainWindow::childAt(int x, int y) const | - | ||||||||||||||||||||||||
| 984 | { | - | ||||||||||||||||||||||||
| 985 | QWidget *w = widget(); | - | ||||||||||||||||||||||||
| 986 | if (!w->isVisible()
| 0 | ||||||||||||||||||||||||
| 987 | return never executed: 0;return 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)
| 0 | ||||||||||||||||||||||||
| 990 | return never executed: 0;return 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()
| 0 | ||||||||||||||||||||||||
| 996 | return never executed: QAccessible::queryAccessibleInterface(child);return QAccessible::queryAccessibleInterface(child);never executed: return QAccessible::queryAccessibleInterface(child); | 0 | ||||||||||||||||||||||||
| 997 | } | - | ||||||||||||||||||||||||
| 998 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 999 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 1000 | } | - | ||||||||||||||||||||||||
| 1001 | - | |||||||||||||||||||||||||
| 1002 | QMainWindow *QAccessibleMainWindow::mainWindow() const | - | ||||||||||||||||||||||||
| 1003 | { | - | ||||||||||||||||||||||||
| 1004 | return never executed: qobject_cast<QMainWindow *>(object());return qobject_cast<QMainWindow *>(object());never executed: return qobject_cast<QMainWindow *>(object()); | 0 | ||||||||||||||||||||||||
| 1005 | } | - | ||||||||||||||||||||||||
| 1006 | - | |||||||||||||||||||||||||
| 1007 | - | |||||||||||||||||||||||||
| 1008 | - | |||||||||||||||||||||||||
| 1009 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |