| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/accessible/qaccessiblequickitem.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||||||||
| 7 | QAccessibleQuickItem::QAccessibleQuickItem(QQuickItem *item) | - | ||||||||||||||||||||||||||||||||||||
| 8 | : QAccessibleObject(item), m_doc(textDocument()) | - | ||||||||||||||||||||||||||||||||||||
| 9 | { | - | ||||||||||||||||||||||||||||||||||||
| 10 | } executed 84 times by 2 tests: end of blockExecuted by:
| 84 | ||||||||||||||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||||||||||||||
| 12 | QWindow *QAccessibleQuickItem::window() const | - | ||||||||||||||||||||||||||||||||||||
| 13 | { | - | ||||||||||||||||||||||||||||||||||||
| 14 | return never executed: item()->window();return item()->window();never executed: return item()->window(); | 0 | ||||||||||||||||||||||||||||||||||||
| 15 | } | - | ||||||||||||||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||||||||||||||
| 17 | int QAccessibleQuickItem::childCount() const | - | ||||||||||||||||||||||||||||||||||||
| 18 | { | - | ||||||||||||||||||||||||||||||||||||
| 19 | return executed 28 times by 1 test: childItems().count();return childItems().count();Executed by:
executed 28 times by 1 test: return childItems().count();Executed by:
| 28 | ||||||||||||||||||||||||||||||||||||
| 20 | } | - | ||||||||||||||||||||||||||||||||||||
| 21 | - | |||||||||||||||||||||||||||||||||||||
| 22 | QRect QAccessibleQuickItem::rect() const | - | ||||||||||||||||||||||||||||||||||||
| 23 | { | - | ||||||||||||||||||||||||||||||||||||
| 24 | const QRect r = itemScreenRect(item()); | - | ||||||||||||||||||||||||||||||||||||
| 25 | return executed 164 times by 1 test: r;return r;Executed by:
executed 164 times by 1 test: return r;Executed by:
| 164 | ||||||||||||||||||||||||||||||||||||
| 26 | } | - | ||||||||||||||||||||||||||||||||||||
| 27 | - | |||||||||||||||||||||||||||||||||||||
| 28 | QRect QAccessibleQuickItem::viewRect() const | - | ||||||||||||||||||||||||||||||||||||
| 29 | { | - | ||||||||||||||||||||||||||||||||||||
| 30 | - | |||||||||||||||||||||||||||||||||||||
| 31 | if (!item()->window()
| 0-80 | ||||||||||||||||||||||||||||||||||||
| 32 | return never executed: QRect();return QRect();never executed: return QRect(); | 0 | ||||||||||||||||||||||||||||||||||||
| 33 | } | - | ||||||||||||||||||||||||||||||||||||
| 34 | - | |||||||||||||||||||||||||||||||||||||
| 35 | QQuickWindow *window = item()->window(); | - | ||||||||||||||||||||||||||||||||||||
| 36 | QPoint screenPos = window->mapToGlobal(QPoint(0,0)); | - | ||||||||||||||||||||||||||||||||||||
| 37 | return executed 80 times by 1 test: QRect(screenPos, window->size());return QRect(screenPos, window->size());Executed by:
executed 80 times by 1 test: return QRect(screenPos, window->size());Executed by:
| 80 | ||||||||||||||||||||||||||||||||||||
| 38 | } | - | ||||||||||||||||||||||||||||||||||||
| 39 | - | |||||||||||||||||||||||||||||||||||||
| 40 | - | |||||||||||||||||||||||||||||||||||||
| 41 | bool QAccessibleQuickItem::clipsChildren() const | - | ||||||||||||||||||||||||||||||||||||
| 42 | { | - | ||||||||||||||||||||||||||||||||||||
| 43 | return never executed: static_cast<QQuickItem *>(item())->clip();return static_cast<QQuickItem *>(item())->clip();never executed: return static_cast<QQuickItem *>(item())->clip(); | 0 | ||||||||||||||||||||||||||||||||||||
| 44 | } | - | ||||||||||||||||||||||||||||||||||||
| 45 | - | |||||||||||||||||||||||||||||||||||||
| 46 | QAccessibleInterface *QAccessibleQuickItem::childAt(int x, int y) const | - | ||||||||||||||||||||||||||||||||||||
| 47 | { | - | ||||||||||||||||||||||||||||||||||||
| 48 | if (item()->clip()
| 8-52 | ||||||||||||||||||||||||||||||||||||
| 49 | if (!rect().contains(x, y)
| 2-6 | ||||||||||||||||||||||||||||||||||||
| 50 | return executed 2 times by 1 test: nullptr;return nullptr;Executed by:
executed 2 times by 1 test: return nullptr;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 51 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 52 | - | |||||||||||||||||||||||||||||||||||||
| 53 | const QList<QQuickItem*> kids = accessibleUnignoredChildren(item(), true); | - | ||||||||||||||||||||||||||||||||||||
| 54 | for (int i = kids.count() - 1; i >= 0
| 46-48 | ||||||||||||||||||||||||||||||||||||
| 55 | QAccessibleInterface *childIface = QAccessible::queryAccessibleInterface(kids.at(i)); | - | ||||||||||||||||||||||||||||||||||||
| 56 | if (QAccessibleInterface *childChild = childIface->childAt(x, y)
| 4-44 | ||||||||||||||||||||||||||||||||||||
| 57 | return executed 4 times by 1 test: childChild;return childChild;Executed by:
executed 4 times by 1 test: return childChild;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 58 | if (childIface
| 0-44 | ||||||||||||||||||||||||||||||||||||
| 59 | if (childIface->rect().contains(x, y)
| 8-36 | ||||||||||||||||||||||||||||||||||||
| 60 | return executed 8 times by 1 test: childIface;return childIface;Executed by:
executed 8 times by 1 test: return childIface;Executed by:
| 8 | ||||||||||||||||||||||||||||||||||||
| 61 | } executed 36 times by 1 test: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 62 | } executed 36 times by 1 test: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||||||||||||||
| 63 | - | |||||||||||||||||||||||||||||||||||||
| 64 | return executed 46 times by 1 test: nullptr;return nullptr;Executed by:
executed 46 times by 1 test: return nullptr;Executed by:
| 46 | ||||||||||||||||||||||||||||||||||||
| 65 | } | - | ||||||||||||||||||||||||||||||||||||
| 66 | - | |||||||||||||||||||||||||||||||||||||
| 67 | QAccessibleInterface *QAccessibleQuickItem::parent() const | - | ||||||||||||||||||||||||||||||||||||
| 68 | { | - | ||||||||||||||||||||||||||||||||||||
| 69 | QQuickItem *parent = item()->parentItem(); | - | ||||||||||||||||||||||||||||||||||||
| 70 | QQuickWindow *window = item()->window(); | - | ||||||||||||||||||||||||||||||||||||
| 71 | QQuickItem *ci = window
| 0 | ||||||||||||||||||||||||||||||||||||
| 72 | while (parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 73 | parent = parent->parentItem(); never executed: parent = parent->parentItem(); | 0 | ||||||||||||||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||||||||||||||
| 75 | if (parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 76 | if (parent == ci
| 0 | ||||||||||||||||||||||||||||||||||||
| 77 | - | |||||||||||||||||||||||||||||||||||||
| 78 | - | |||||||||||||||||||||||||||||||||||||
| 79 | - | |||||||||||||||||||||||||||||||||||||
| 80 | - | |||||||||||||||||||||||||||||||||||||
| 81 | - | |||||||||||||||||||||||||||||||||||||
| 82 | return never executed: QAccessible::queryAccessibleInterface(window);return QAccessible::queryAccessibleInterface(window);never executed: return QAccessible::queryAccessibleInterface(window); | 0 | ||||||||||||||||||||||||||||||||||||
| 83 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 84 | while (parent
| 0 | ||||||||||||||||||||||||||||||||||||
| 85 | parent = parent->parentItem(); never executed: parent = parent->parentItem(); | 0 | ||||||||||||||||||||||||||||||||||||
| 86 | return never executed: QAccessible::queryAccessibleInterface(parent);return QAccessible::queryAccessibleInterface(parent);never executed: return QAccessible::queryAccessibleInterface(parent); | 0 | ||||||||||||||||||||||||||||||||||||
| 87 | } | - | ||||||||||||||||||||||||||||||||||||
| 88 | } | - | ||||||||||||||||||||||||||||||||||||
| 89 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||||||||||||||||||||||||||||||||
| 90 | } | - | ||||||||||||||||||||||||||||||||||||
| 91 | - | |||||||||||||||||||||||||||||||||||||
| 92 | QAccessibleInterface *QAccessibleQuickItem::child(int index) const | - | ||||||||||||||||||||||||||||||||||||
| 93 | { | - | ||||||||||||||||||||||||||||||||||||
| 94 | QList<QQuickItem *> children = childItems(); | - | ||||||||||||||||||||||||||||||||||||
| 95 | - | |||||||||||||||||||||||||||||||||||||
| 96 | if (index < 0
| 0-34 | ||||||||||||||||||||||||||||||||||||
| 97 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||||||||||||||||||||||||||||||||
| 98 | - | |||||||||||||||||||||||||||||||||||||
| 99 | QQuickItem *child = children.at(index); | - | ||||||||||||||||||||||||||||||||||||
| 100 | return executed 34 times by 1 test: QAccessible::queryAccessibleInterface(child);return QAccessible::queryAccessibleInterface(child);Executed by:
executed 34 times by 1 test: return QAccessible::queryAccessibleInterface(child);Executed by:
| 34 | ||||||||||||||||||||||||||||||||||||
| 101 | } | - | ||||||||||||||||||||||||||||||||||||
| 102 | - | |||||||||||||||||||||||||||||||||||||
| 103 | int QAccessibleQuickItem::indexOfChild(const QAccessibleInterface *iface) const | - | ||||||||||||||||||||||||||||||||||||
| 104 | { | - | ||||||||||||||||||||||||||||||||||||
| 105 | QList<QQuickItem*> kids = childItems(); | - | ||||||||||||||||||||||||||||||||||||
| 106 | return executed 6 times by 1 test: kids.indexOf(static_cast<QQuickItem*>(iface->object()));return kids.indexOf(static_cast<QQuickItem*>(iface->object()));Executed by:
executed 6 times by 1 test: return kids.indexOf(static_cast<QQuickItem*>(iface->object()));Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 107 | } | - | ||||||||||||||||||||||||||||||||||||
| 108 | - | |||||||||||||||||||||||||||||||||||||
| 109 | static void unignoredChildren(QQuickItem *item, QList<QQuickItem *> *items, bool paintOrder) | - | ||||||||||||||||||||||||||||||||||||
| 110 | { | - | ||||||||||||||||||||||||||||||||||||
| 111 | const QList<QQuickItem*> childItems = paintOrder
| 140-214 | ||||||||||||||||||||||||||||||||||||
| 112 | : item->childItems(); | - | ||||||||||||||||||||||||||||||||||||
| 113 | for (QQuickItem *child : childItems) { | - | ||||||||||||||||||||||||||||||||||||
| 114 | if (QQuickItemPrivate::get(child)->isAccessible
| 206-356 | ||||||||||||||||||||||||||||||||||||
| 115 | items->append(child); | - | ||||||||||||||||||||||||||||||||||||
| 116 | } executed 356 times by 1 test: else {end of blockExecuted by:
| 356 | ||||||||||||||||||||||||||||||||||||
| 117 | unignoredChildren(child, items, paintOrder); | - | ||||||||||||||||||||||||||||||||||||
| 118 | } executed 206 times by 1 test: end of blockExecuted by:
| 206 | ||||||||||||||||||||||||||||||||||||
| 119 | } | - | ||||||||||||||||||||||||||||||||||||
| 120 | } executed 354 times by 1 test: end of blockExecuted by:
| 354 | ||||||||||||||||||||||||||||||||||||
| 121 | - | |||||||||||||||||||||||||||||||||||||
| 122 | QList<QQuickItem *> accessibleUnignoredChildren(QQuickItem *item, bool paintOrder) | - | ||||||||||||||||||||||||||||||||||||
| 123 | { | - | ||||||||||||||||||||||||||||||||||||
| 124 | QList<QQuickItem *> items; | - | ||||||||||||||||||||||||||||||||||||
| 125 | unignoredChildren(item, &items, paintOrder); | - | ||||||||||||||||||||||||||||||||||||
| 126 | return executed 148 times by 1 test: items;return items;Executed by:
executed 148 times by 1 test: return items;Executed by:
| 148 | ||||||||||||||||||||||||||||||||||||
| 127 | } | - | ||||||||||||||||||||||||||||||||||||
| 128 | - | |||||||||||||||||||||||||||||||||||||
| 129 | QList<QQuickItem *> QAccessibleQuickItem::childItems() const | - | ||||||||||||||||||||||||||||||||||||
| 130 | { | - | ||||||||||||||||||||||||||||||||||||
| 131 | return executed 68 times by 1 test: accessibleUnignoredChildren(item());return accessibleUnignoredChildren(item());Executed by:
executed 68 times by 1 test: return accessibleUnignoredChildren(item());Executed by:
| 68 | ||||||||||||||||||||||||||||||||||||
| 132 | } | - | ||||||||||||||||||||||||||||||||||||
| 133 | - | |||||||||||||||||||||||||||||||||||||
| 134 | QAccessible::State QAccessibleQuickItem::state() const | - | ||||||||||||||||||||||||||||||||||||
| 135 | { | - | ||||||||||||||||||||||||||||||||||||
| 136 | QQuickAccessibleAttached *attached = QQuickAccessibleAttached::attachedProperties(item()); | - | ||||||||||||||||||||||||||||||||||||
| 137 | if (!attached
| 0-80 | ||||||||||||||||||||||||||||||||||||
| 138 | return never executed: QAccessible::State();return QAccessible::State();never executed: return QAccessible::State(); | 0 | ||||||||||||||||||||||||||||||||||||
| 139 | - | |||||||||||||||||||||||||||||||||||||
| 140 | QAccessible::State state = attached->state(); | - | ||||||||||||||||||||||||||||||||||||
| 141 | - | |||||||||||||||||||||||||||||||||||||
| 142 | QRect viewRect_ = viewRect(); | - | ||||||||||||||||||||||||||||||||||||
| 143 | QRect itemRect = rect(); | - | ||||||||||||||||||||||||||||||||||||
| 144 | - | |||||||||||||||||||||||||||||||||||||
| 145 | if (viewRect_.isNull()
| 0-80 | ||||||||||||||||||||||||||||||||||||
| 146 | state.invisible = true; never executed: state.invisible = true; | 0 | ||||||||||||||||||||||||||||||||||||
| 147 | if (!viewRect_.intersects(itemRect)
| 0-80 | ||||||||||||||||||||||||||||||||||||
| 148 | state.offscreen = true; never executed: state.offscreen = true; | 0 | ||||||||||||||||||||||||||||||||||||
| 149 | if ((role() == QAccessible::CheckBox
| 0-68 | ||||||||||||||||||||||||||||||||||||
| 150 | state.checked = true; executed 6 times by 1 test: state.checked = true;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 151 | if (item()->activeFocusOnTab()
| 0-80 | ||||||||||||||||||||||||||||||||||||
| 152 | state.focusable = true; never executed: state.focusable = true; | 0 | ||||||||||||||||||||||||||||||||||||
| 153 | if (item()->hasActiveFocus()
| 4-76 | ||||||||||||||||||||||||||||||||||||
| 154 | state.focused = true; executed 4 times by 1 test: state.focused = true;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 155 | return executed 80 times by 1 test: state;return state;Executed by:
executed 80 times by 1 test: return state;Executed by:
| 80 | ||||||||||||||||||||||||||||||||||||
| 156 | } | - | ||||||||||||||||||||||||||||||||||||
| 157 | - | |||||||||||||||||||||||||||||||||||||
| 158 | QAccessible::Role QAccessibleQuickItem::role() const | - | ||||||||||||||||||||||||||||||||||||
| 159 | { | - | ||||||||||||||||||||||||||||||||||||
| 160 | - | |||||||||||||||||||||||||||||||||||||
| 161 | - | |||||||||||||||||||||||||||||||||||||
| 162 | - | |||||||||||||||||||||||||||||||||||||
| 163 | if (qobject_cast<QQuickText*>(const_cast<QQuickItem *>(item()))
| 4-236 | ||||||||||||||||||||||||||||||||||||
| 164 | return executed 4 times by 1 test: QAccessible::StaticText;return QAccessible::StaticText;Executed by:
executed 4 times by 1 test: return QAccessible::StaticText;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 165 | - | |||||||||||||||||||||||||||||||||||||
| 166 | QAccessible::Role role = QAccessible::NoRole; | - | ||||||||||||||||||||||||||||||||||||
| 167 | if (item()
| 0-236 | ||||||||||||||||||||||||||||||||||||
| 168 | role = QQuickItemPrivate::get(item())->accessibleRole(); executed 236 times by 1 test: role = QQuickItemPrivate::get(item())->accessibleRole();Executed by:
| 236 | ||||||||||||||||||||||||||||||||||||
| 169 | if (role == QAccessible::NoRole
| 0-236 | ||||||||||||||||||||||||||||||||||||
| 170 | role = QAccessible::Client; never executed: role = QAccessible::Client; | 0 | ||||||||||||||||||||||||||||||||||||
| 171 | - | |||||||||||||||||||||||||||||||||||||
| 172 | return executed 236 times by 1 test: role;return role;Executed by:
executed 236 times by 1 test: return role;Executed by:
| 236 | ||||||||||||||||||||||||||||||||||||
| 173 | } | - | ||||||||||||||||||||||||||||||||||||
| 174 | - | |||||||||||||||||||||||||||||||||||||
| 175 | bool QAccessibleQuickItem::isAccessible() const | - | ||||||||||||||||||||||||||||||||||||
| 176 | { | - | ||||||||||||||||||||||||||||||||||||
| 177 | return never executed: item()->d_func()->isAccessible;return item()->d_func()->isAccessible;never executed: return item()->d_func()->isAccessible; | 0 | ||||||||||||||||||||||||||||||||||||
| 178 | } | - | ||||||||||||||||||||||||||||||||||||
| 179 | - | |||||||||||||||||||||||||||||||||||||
| 180 | QStringList QAccessibleQuickItem::actionNames() const | - | ||||||||||||||||||||||||||||||||||||
| 181 | { | - | ||||||||||||||||||||||||||||||||||||
| 182 | QStringList actions; | - | ||||||||||||||||||||||||||||||||||||
| 183 | switch (role()) { | - | ||||||||||||||||||||||||||||||||||||
| 184 | case never executed: QAccessible::PushButton:case QAccessible::PushButton:never executed: case QAccessible::PushButton: | 0 | ||||||||||||||||||||||||||||||||||||
| 185 | actions << QAccessibleActionInterface::pressAction(); | - | ||||||||||||||||||||||||||||||||||||
| 186 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 187 | case never executed: QAccessible::RadioButton:case QAccessible::RadioButton:never executed: case QAccessible::RadioButton: | 0 | ||||||||||||||||||||||||||||||||||||
| 188 | case never executed: QAccessible::CheckBox:case QAccessible::CheckBox:never executed: case QAccessible::CheckBox: | 0 | ||||||||||||||||||||||||||||||||||||
| 189 | actions << QAccessibleActionInterface::toggleAction() | - | ||||||||||||||||||||||||||||||||||||
| 190 | << QAccessibleActionInterface::pressAction(); | - | ||||||||||||||||||||||||||||||||||||
| 191 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 192 | case never executed: QAccessible::Slider:case QAccessible::Slider:never executed: case QAccessible::Slider: | 0 | ||||||||||||||||||||||||||||||||||||
| 193 | case never executed: QAccessible::SpinBox:case QAccessible::SpinBox:never executed: case QAccessible::SpinBox: | 0 | ||||||||||||||||||||||||||||||||||||
| 194 | case never executed: QAccessible::ScrollBar:case QAccessible::ScrollBar:never executed: case QAccessible::ScrollBar: | 0 | ||||||||||||||||||||||||||||||||||||
| 195 | actions << QAccessibleActionInterface::increaseAction() | - | ||||||||||||||||||||||||||||||||||||
| 196 | << QAccessibleActionInterface::decreaseAction(); | - | ||||||||||||||||||||||||||||||||||||
| 197 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 198 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 199 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 200 | } | - | ||||||||||||||||||||||||||||||||||||
| 201 | if (state().focusable
| 0 | ||||||||||||||||||||||||||||||||||||
| 202 | actions.append(QAccessibleActionInterface::setFocusAction()); never executed: actions.append(QAccessibleActionInterface::setFocusAction()); | 0 | ||||||||||||||||||||||||||||||||||||
| 203 | - | |||||||||||||||||||||||||||||||||||||
| 204 | - | |||||||||||||||||||||||||||||||||||||
| 205 | if (QQuickAccessibleAttached *attached = QQuickAccessibleAttached::attachedProperties(item())
| 0 | ||||||||||||||||||||||||||||||||||||
| 206 | attached->availableActions(&actions); never executed: attached->availableActions(&actions); | 0 | ||||||||||||||||||||||||||||||||||||
| 207 | return never executed: actions;return actions;never executed: return actions; | 0 | ||||||||||||||||||||||||||||||||||||
| 208 | } | - | ||||||||||||||||||||||||||||||||||||
| 209 | - | |||||||||||||||||||||||||||||||||||||
| 210 | void QAccessibleQuickItem::doAction(const QString &actionName) | - | ||||||||||||||||||||||||||||||||||||
| 211 | { | - | ||||||||||||||||||||||||||||||||||||
| 212 | bool accepted = false; | - | ||||||||||||||||||||||||||||||||||||
| 213 | if (actionName == QAccessibleActionInterface::setFocusAction()
| 0 | ||||||||||||||||||||||||||||||||||||
| 214 | item()->forceActiveFocus(); | - | ||||||||||||||||||||||||||||||||||||
| 215 | accepted = true; | - | ||||||||||||||||||||||||||||||||||||
| 216 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 217 | if (QQuickAccessibleAttached *attached = QQuickAccessibleAttached::attachedProperties(item())
| 0 | ||||||||||||||||||||||||||||||||||||
| 218 | accepted = attached->doAction(actionName); never executed: accepted = attached->doAction(actionName); | 0 | ||||||||||||||||||||||||||||||||||||
| 219 | - | |||||||||||||||||||||||||||||||||||||
| 220 | if (accepted
| 0 | ||||||||||||||||||||||||||||||||||||
| 221 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 222 | - | |||||||||||||||||||||||||||||||||||||
| 223 | - | |||||||||||||||||||||||||||||||||||||
| 224 | const QByteArray functionName = "accessible" + actionName.toLatin1() + "Action"; | - | ||||||||||||||||||||||||||||||||||||
| 225 | if (object()->metaObject()->indexOfMethod(QByteArray(functionName + "()")) != -1
| 0 | ||||||||||||||||||||||||||||||||||||
| 226 | QMetaObject::invokeMethod(object(), functionName); | - | ||||||||||||||||||||||||||||||||||||
| 227 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||
| 228 | } | - | ||||||||||||||||||||||||||||||||||||
| 229 | - | |||||||||||||||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||||||||||||||
| 231 | - | |||||||||||||||||||||||||||||||||||||
| 232 | - | |||||||||||||||||||||||||||||||||||||
| 233 | - | |||||||||||||||||||||||||||||||||||||
| 234 | - | |||||||||||||||||||||||||||||||||||||
| 235 | switch (role()) { | - | ||||||||||||||||||||||||||||||||||||
| 236 | case never executed: QAccessible::RadioButton:case QAccessible::RadioButton:never executed: case QAccessible::RadioButton: | 0 | ||||||||||||||||||||||||||||||||||||
| 237 | case never executed: QAccessible::CheckBox:case QAccessible::CheckBox:never executed: {case QAccessible::CheckBox: | 0 | ||||||||||||||||||||||||||||||||||||
| 238 | QVariant checked = object()->property("checked"); | - | ||||||||||||||||||||||||||||||||||||
| 239 | if (checked.
| 0 | ||||||||||||||||||||||||||||||||||||
| 240 | if (actionName == QAccessibleActionInterface::toggleAction()
| 0 | ||||||||||||||||||||||||||||||||||||
| 241 | actionName == QAccessibleActionInterface::pressAction()
| 0 | ||||||||||||||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||||||||||||||
| 243 | object()->setProperty("checked", QVariant(!checked.toBool())); | - | ||||||||||||||||||||||||||||||||||||
| 244 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 245 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 246 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 247 | } | - | ||||||||||||||||||||||||||||||||||||
| 248 | case never executed: QAccessible::Slider:case QAccessible::Slider:never executed: case QAccessible::Slider: | 0 | ||||||||||||||||||||||||||||||||||||
| 249 | case never executed: QAccessible::SpinBox:case QAccessible::SpinBox:never executed: case QAccessible::SpinBox: | 0 | ||||||||||||||||||||||||||||||||||||
| 250 | case never executed: QAccessible::Dial:case QAccessible::Dial:never executed: case QAccessible::Dial: | 0 | ||||||||||||||||||||||||||||||||||||
| 251 | case never executed: QAccessible::ScrollBar:case QAccessible::ScrollBar:never executed: {case QAccessible::ScrollBar: | 0 | ||||||||||||||||||||||||||||||||||||
| 252 | if (actionName != QAccessibleActionInterface::increaseAction()
| 0 | ||||||||||||||||||||||||||||||||||||
| 253 | actionName != QAccessibleActionInterface::decreaseAction()
| 0 | ||||||||||||||||||||||||||||||||||||
| 254 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 255 | - | |||||||||||||||||||||||||||||||||||||
| 256 | - | |||||||||||||||||||||||||||||||||||||
| 257 | - | |||||||||||||||||||||||||||||||||||||
| 258 | - | |||||||||||||||||||||||||||||||||||||
| 259 | if (QAccessibleValueInterface *valueIface = valueInterface()
| 0 | ||||||||||||||||||||||||||||||||||||
| 260 | QVariant valueV = valueIface->currentValue(); | - | ||||||||||||||||||||||||||||||||||||
| 261 | qreal newValue = valueV.toReal(); | - | ||||||||||||||||||||||||||||||||||||
| 262 | - | |||||||||||||||||||||||||||||||||||||
| 263 | QVariant stepSizeV = object()->property("stepSize"); | - | ||||||||||||||||||||||||||||||||||||
| 264 | qreal stepSize = stepSizeV.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 265 | if (actionName == QAccessibleActionInterface::increaseAction()
| 0 | ||||||||||||||||||||||||||||||||||||
| 266 | newValue += stepSize; | - | ||||||||||||||||||||||||||||||||||||
| 267 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 268 | newValue -= stepSize; | - | ||||||||||||||||||||||||||||||||||||
| 269 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 270 | - | |||||||||||||||||||||||||||||||||||||
| 271 | QVariant minimumValueV = valueIface->minimumValue(); | - | ||||||||||||||||||||||||||||||||||||
| 272 | if (minimumValueV.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 273 | newValue = qMax(newValue, minimumValueV.toReal()); | - | ||||||||||||||||||||||||||||||||||||
| 274 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 275 | QVariant maximumValueV = valueIface->maximumValue(); | - | ||||||||||||||||||||||||||||||||||||
| 276 | if (maximumValueV.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||
| 277 | newValue = qMin(newValue, maximumValueV.toReal()); | - | ||||||||||||||||||||||||||||||||||||
| 278 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 279 | - | |||||||||||||||||||||||||||||||||||||
| 280 | valueIface->setCurrentValue(QVariant(newValue)); | - | ||||||||||||||||||||||||||||||||||||
| 281 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 282 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 283 | } | - | ||||||||||||||||||||||||||||||||||||
| 284 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 285 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 286 | } | - | ||||||||||||||||||||||||||||||||||||
| 287 | } | - | ||||||||||||||||||||||||||||||||||||
| 288 | - | |||||||||||||||||||||||||||||||||||||
| 289 | QStringList QAccessibleQuickItem::keyBindingsForAction(const QString &actionName) const | - | ||||||||||||||||||||||||||||||||||||
| 290 | { | - | ||||||||||||||||||||||||||||||||||||
| 291 | (void)actionName; | - | ||||||||||||||||||||||||||||||||||||
| 292 | return never executed: QStringList();return QStringList();never executed: return QStringList(); | 0 | ||||||||||||||||||||||||||||||||||||
| 293 | } | - | ||||||||||||||||||||||||||||||||||||
| 294 | - | |||||||||||||||||||||||||||||||||||||
| 295 | QString QAccessibleQuickItem::text(QAccessible::Text textType) const | - | ||||||||||||||||||||||||||||||||||||
| 296 | { | - | ||||||||||||||||||||||||||||||||||||
| 297 | - | |||||||||||||||||||||||||||||||||||||
| 298 | switch (textType) { | - | ||||||||||||||||||||||||||||||||||||
| 299 | case executed 34 times by 1 test: QAccessible::Name:case QAccessible::Name:Executed by:
executed 34 times by 1 test: {case QAccessible::Name:Executed by:
| 34 | ||||||||||||||||||||||||||||||||||||
| 300 | QVariant accessibleName = QQuickAccessibleAttached::property(object(), "name"); | - | ||||||||||||||||||||||||||||||||||||
| 301 | if (!accessibleName.isNull()
| 0-34 | ||||||||||||||||||||||||||||||||||||
| 302 | return executed 34 times by 1 test: accessibleName.toString();return accessibleName.toString();Executed by:
executed 34 times by 1 test: return accessibleName.toString();Executed by:
| 34 | ||||||||||||||||||||||||||||||||||||
| 303 | break; never executed: }break; | 0 | ||||||||||||||||||||||||||||||||||||
| 304 | case never executed: QAccessible::Description:case QAccessible::Description:never executed: {case QAccessible::Description: | 0 | ||||||||||||||||||||||||||||||||||||
| 305 | QVariant accessibleDecription = QQuickAccessibleAttached::property(object(), "description"); | - | ||||||||||||||||||||||||||||||||||||
| 306 | if (!accessibleDecription.isNull()
| 0 | ||||||||||||||||||||||||||||||||||||
| 307 | return never executed: accessibleDecription.toString();return accessibleDecription.toString();never executed: return accessibleDecription.toString(); | 0 | ||||||||||||||||||||||||||||||||||||
| 308 | break; never executed: }break; | 0 | ||||||||||||||||||||||||||||||||||||
| 309 | case never executed: QAccessible::Value:case QAccessible::Value:never executed: case QAccessible::Value: | 0 | ||||||||||||||||||||||||||||||||||||
| 310 | case never executed: QAccessible::Help:case QAccessible::Help:never executed: case QAccessible::Help: | 0 | ||||||||||||||||||||||||||||||||||||
| 311 | case never executed: QAccessible::Accelerator:case QAccessible::Accelerator:never executed: case QAccessible::Accelerator: | 0 | ||||||||||||||||||||||||||||||||||||
| 312 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 313 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||
| 314 | } | - | ||||||||||||||||||||||||||||||||||||
| 315 | - | |||||||||||||||||||||||||||||||||||||
| 316 | - | |||||||||||||||||||||||||||||||||||||
| 317 | if (role() == QAccessible::EditableText
| 0 | ||||||||||||||||||||||||||||||||||||
| 318 | if (textType == QAccessible::Value
| 0 | ||||||||||||||||||||||||||||||||||||
| 319 | if (QTextDocument *doc = textDocument()
| 0 | ||||||||||||||||||||||||||||||||||||
| 320 | return never executed: doc->toPlainText();return doc->toPlainText();never executed: return doc->toPlainText(); | 0 | ||||||||||||||||||||||||||||||||||||
| 321 | } | - | ||||||||||||||||||||||||||||||||||||
| 322 | QVariant text = object()->property("text"); | - | ||||||||||||||||||||||||||||||||||||
| 323 | return never executed: text.toString();return text.toString();never executed: return text.toString(); | 0 | ||||||||||||||||||||||||||||||||||||
| 324 | } | - | ||||||||||||||||||||||||||||||||||||
| 325 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||||||||||||||
| 327 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||||||||||||||
| 328 | } | - | ||||||||||||||||||||||||||||||||||||
| 329 | - | |||||||||||||||||||||||||||||||||||||
| 330 | void *QAccessibleQuickItem::interface_cast(QAccessible::InterfaceType t) | - | ||||||||||||||||||||||||||||||||||||
| 331 | { | - | ||||||||||||||||||||||||||||||||||||
| 332 | QAccessible::Role r = role(); | - | ||||||||||||||||||||||||||||||||||||
| 333 | if (t == QAccessible::ActionInterface
| 0 | ||||||||||||||||||||||||||||||||||||
| 334 | return never executed: static_cast<QAccessibleActionInterface*>(this);return static_cast<QAccessibleActionInterface*>(this);never executed: return static_cast<QAccessibleActionInterface*>(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 335 | if (t == QAccessible::ValueInterface
| 0 | ||||||||||||||||||||||||||||||||||||
| 336 | (r == QAccessible::Slider
| 0 | ||||||||||||||||||||||||||||||||||||
| 337 | r == QAccessible::SpinBox
| 0 | ||||||||||||||||||||||||||||||||||||
| 338 | r == QAccessible::Dial
| 0 | ||||||||||||||||||||||||||||||||||||
| 339 | r == QAccessible::ScrollBar
| 0 | ||||||||||||||||||||||||||||||||||||
| 340 | return never executed: static_cast<QAccessibleValueInterface*>(this);return static_cast<QAccessibleValueInterface*>(this);never executed: return static_cast<QAccessibleValueInterface*>(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 341 | - | |||||||||||||||||||||||||||||||||||||
| 342 | if (t == QAccessible::TextInterface
| 0 | ||||||||||||||||||||||||||||||||||||
| 343 | (
| 0 | ||||||||||||||||||||||||||||||||||||
| 344 | return never executed: static_cast<QAccessibleTextInterface*>(this);return static_cast<QAccessibleTextInterface*>(this);never executed: return static_cast<QAccessibleTextInterface*>(this); | 0 | ||||||||||||||||||||||||||||||||||||
| 345 | - | |||||||||||||||||||||||||||||||||||||
| 346 | return never executed: QAccessibleObject::interface_cast(t);return QAccessibleObject::interface_cast(t);never executed: return QAccessibleObject::interface_cast(t); | 0 | ||||||||||||||||||||||||||||||||||||
| 347 | } | - | ||||||||||||||||||||||||||||||||||||
| 348 | - | |||||||||||||||||||||||||||||||||||||
| 349 | QVariant QAccessibleQuickItem::currentValue() const | - | ||||||||||||||||||||||||||||||||||||
| 350 | { | - | ||||||||||||||||||||||||||||||||||||
| 351 | return never executed: item()->property("value");return item()->property("value");never executed: return item()->property("value"); | 0 | ||||||||||||||||||||||||||||||||||||
| 352 | } | - | ||||||||||||||||||||||||||||||||||||
| 353 | - | |||||||||||||||||||||||||||||||||||||
| 354 | void QAccessibleQuickItem::setCurrentValue(const QVariant &value) | - | ||||||||||||||||||||||||||||||||||||
| 355 | { | - | ||||||||||||||||||||||||||||||||||||
| 356 | item()->setProperty("value", value); | - | ||||||||||||||||||||||||||||||||||||
| 357 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 358 | - | |||||||||||||||||||||||||||||||||||||
| 359 | QVariant QAccessibleQuickItem::maximumValue() const | - | ||||||||||||||||||||||||||||||||||||
| 360 | { | - | ||||||||||||||||||||||||||||||||||||
| 361 | return never executed: item()->property("maximumValue");return item()->property("maximumValue");never executed: return item()->property("maximumValue"); | 0 | ||||||||||||||||||||||||||||||||||||
| 362 | } | - | ||||||||||||||||||||||||||||||||||||
| 363 | - | |||||||||||||||||||||||||||||||||||||
| 364 | QVariant QAccessibleQuickItem::minimumValue() const | - | ||||||||||||||||||||||||||||||||||||
| 365 | { | - | ||||||||||||||||||||||||||||||||||||
| 366 | return never executed: item()->property("minimumValue");return item()->property("minimumValue");never executed: return item()->property("minimumValue"); | 0 | ||||||||||||||||||||||||||||||||||||
| 367 | } | - | ||||||||||||||||||||||||||||||||||||
| 368 | - | |||||||||||||||||||||||||||||||||||||
| 369 | QVariant QAccessibleQuickItem::minimumStepSize() const | - | ||||||||||||||||||||||||||||||||||||
| 370 | { | - | ||||||||||||||||||||||||||||||||||||
| 371 | return never executed: item()->property("stepSize");return item()->property("stepSize");never executed: return item()->property("stepSize"); | 0 | ||||||||||||||||||||||||||||||||||||
| 372 | } | - | ||||||||||||||||||||||||||||||||||||
| 373 | - | |||||||||||||||||||||||||||||||||||||
| 374 | - | |||||||||||||||||||||||||||||||||||||
| 375 | - | |||||||||||||||||||||||||||||||||||||
| 376 | - | |||||||||||||||||||||||||||||||||||||
| 377 | - | |||||||||||||||||||||||||||||||||||||
| 378 | QRect itemScreenRect(QQuickItem *item) | - | ||||||||||||||||||||||||||||||||||||
| 379 | { | - | ||||||||||||||||||||||||||||||||||||
| 380 | - | |||||||||||||||||||||||||||||||||||||
| 381 | - | |||||||||||||||||||||||||||||||||||||
| 382 | if (!item->window()
| 0-164 | ||||||||||||||||||||||||||||||||||||
| 383 | return never executed: QRect();return QRect();never executed: return QRect(); | 0 | ||||||||||||||||||||||||||||||||||||
| 384 | } | - | ||||||||||||||||||||||||||||||||||||
| 385 | - | |||||||||||||||||||||||||||||||||||||
| 386 | QSize itemSize((int)item->width(), (int)item->height()); | - | ||||||||||||||||||||||||||||||||||||
| 387 | - | |||||||||||||||||||||||||||||||||||||
| 388 | - | |||||||||||||||||||||||||||||||||||||
| 389 | if (itemSize.isEmpty()
| 0-164 | ||||||||||||||||||||||||||||||||||||
| 390 | itemSize = QSize((int)item->implicitWidth(), (int)item->implicitHeight()); | - | ||||||||||||||||||||||||||||||||||||
| 391 | if (itemSize.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||
| 392 | - | |||||||||||||||||||||||||||||||||||||
| 393 | itemSize = QSize((int)item->parentItem()->width(), (int)item->parentItem()->height()); never executed: itemSize = QSize((int)item->parentItem()->width(), (int)item->parentItem()->height()); | 0 | ||||||||||||||||||||||||||||||||||||
| 394 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 395 | - | |||||||||||||||||||||||||||||||||||||
| 396 | QPointF scenePoint = item->mapToScene(QPointF(0, 0)); | - | ||||||||||||||||||||||||||||||||||||
| 397 | QPoint screenPos = item->window()->mapToGlobal(scenePoint.toPoint()); | - | ||||||||||||||||||||||||||||||||||||
| 398 | return executed 164 times by 1 test: QRect(screenPos, itemSize);return QRect(screenPos, itemSize);Executed by:
executed 164 times by 1 test: return QRect(screenPos, itemSize);Executed by:
| 164 | ||||||||||||||||||||||||||||||||||||
| 399 | } | - | ||||||||||||||||||||||||||||||||||||
| 400 | - | |||||||||||||||||||||||||||||||||||||
| 401 | QTextDocument *QAccessibleQuickItem::textDocument() const | - | ||||||||||||||||||||||||||||||||||||
| 402 | { | - | ||||||||||||||||||||||||||||||||||||
| 403 | QVariant docVariant = item()->property("textDocument"); | - | ||||||||||||||||||||||||||||||||||||
| 404 | if (docVariant.canConvert<QQuickTextDocument*>()
| 0-84 | ||||||||||||||||||||||||||||||||||||
| 405 | QQuickTextDocument *qqdoc = docVariant.value<QQuickTextDocument*>(); | - | ||||||||||||||||||||||||||||||||||||
| 406 | return never executed: qqdoc->textDocument();return qqdoc->textDocument();never executed: return qqdoc->textDocument(); | 0 | ||||||||||||||||||||||||||||||||||||
| 407 | } | - | ||||||||||||||||||||||||||||||||||||
| 408 | return executed 84 times by 2 tests: nullptr;return nullptr;Executed by:
executed 84 times by 2 tests: return nullptr;Executed by:
| 84 | ||||||||||||||||||||||||||||||||||||
| 409 | } | - | ||||||||||||||||||||||||||||||||||||
| 410 | - | |||||||||||||||||||||||||||||||||||||
| 411 | int QAccessibleQuickItem::characterCount() const | - | ||||||||||||||||||||||||||||||||||||
| 412 | { | - | ||||||||||||||||||||||||||||||||||||
| 413 | if (m_doc
| 0 | ||||||||||||||||||||||||||||||||||||
| 414 | QTextCursor cursor = QTextCursor(m_doc); | - | ||||||||||||||||||||||||||||||||||||
| 415 | cursor.movePosition(QTextCursor::End); | - | ||||||||||||||||||||||||||||||||||||
| 416 | return never executed: cursor.position();return cursor.position();never executed: return cursor.position(); | 0 | ||||||||||||||||||||||||||||||||||||
| 417 | } | - | ||||||||||||||||||||||||||||||||||||
| 418 | return never executed: text(QAccessible::Value).size();return text(QAccessible::Value).size();never executed: return text(QAccessible::Value).size(); | 0 | ||||||||||||||||||||||||||||||||||||
| 419 | } | - | ||||||||||||||||||||||||||||||||||||
| 420 | - | |||||||||||||||||||||||||||||||||||||
| 421 | int QAccessibleQuickItem::cursorPosition() const | - | ||||||||||||||||||||||||||||||||||||
| 422 | { | - | ||||||||||||||||||||||||||||||||||||
| 423 | QVariant pos = item()->property("cursorPosition"); | - | ||||||||||||||||||||||||||||||||||||
| 424 | return never executed: pos.toInt();return pos.toInt();never executed: return pos.toInt(); | 0 | ||||||||||||||||||||||||||||||||||||
| 425 | } | - | ||||||||||||||||||||||||||||||||||||
| 426 | - | |||||||||||||||||||||||||||||||||||||
| 427 | void QAccessibleQuickItem::setCursorPosition(int position) | - | ||||||||||||||||||||||||||||||||||||
| 428 | { | - | ||||||||||||||||||||||||||||||||||||
| 429 | item()->setProperty("cursorPosition", position); | - | ||||||||||||||||||||||||||||||||||||
| 430 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 431 | - | |||||||||||||||||||||||||||||||||||||
| 432 | QString QAccessibleQuickItem::text(int startOffset, int endOffset) const | - | ||||||||||||||||||||||||||||||||||||
| 433 | { | - | ||||||||||||||||||||||||||||||||||||
| 434 | if (m_doc
| 0 | ||||||||||||||||||||||||||||||||||||
| 435 | QTextCursor cursor = QTextCursor(m_doc); | - | ||||||||||||||||||||||||||||||||||||
| 436 | cursor.setPosition(startOffset); | - | ||||||||||||||||||||||||||||||||||||
| 437 | cursor.setPosition(endOffset, QTextCursor::KeepAnchor); | - | ||||||||||||||||||||||||||||||||||||
| 438 | return never executed: cursor.selectedText();return cursor.selectedText();never executed: return cursor.selectedText(); | 0 | ||||||||||||||||||||||||||||||||||||
| 439 | } | - | ||||||||||||||||||||||||||||||||||||
| 440 | return never executed: text(QAccessible::Value).mid(startOffset, endOffset - startOffset);return text(QAccessible::Value).mid(startOffset, endOffset - startOffset);never executed: return text(QAccessible::Value).mid(startOffset, endOffset - startOffset); | 0 | ||||||||||||||||||||||||||||||||||||
| 441 | } | - | ||||||||||||||||||||||||||||||||||||
| 442 | - | |||||||||||||||||||||||||||||||||||||
| 443 | QString QAccessibleQuickItem::textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType, | - | ||||||||||||||||||||||||||||||||||||
| 444 | int *startOffset, int *endOffset) const | - | ||||||||||||||||||||||||||||||||||||
| 445 | { | - | ||||||||||||||||||||||||||||||||||||
| 446 | ((startOffset) ? static_cast<void>(0) : qt_assert("startOffset", __FILE__, 499)); | - | ||||||||||||||||||||||||||||||||||||
| 447 | ((endOffset) ? static_cast<void>(0) : qt_assert("endOffset", __FILE__, 500)); | - | ||||||||||||||||||||||||||||||||||||
| 448 | - | |||||||||||||||||||||||||||||||||||||
| 449 | if (m_doc
| 0 | ||||||||||||||||||||||||||||||||||||
| 450 | QTextCursor cursor = QTextCursor(m_doc); | - | ||||||||||||||||||||||||||||||||||||
| 451 | cursor.setPosition(offset); | - | ||||||||||||||||||||||||||||||||||||
| 452 | QPair<int, int> boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType); | - | ||||||||||||||||||||||||||||||||||||
| 453 | cursor.setPosition(boundaries.first - 1); | - | ||||||||||||||||||||||||||||||||||||
| 454 | boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType); | - | ||||||||||||||||||||||||||||||||||||
| 455 | - | |||||||||||||||||||||||||||||||||||||
| 456 | *startOffset = boundaries.first; | - | ||||||||||||||||||||||||||||||||||||
| 457 | *endOffset = boundaries.second; | - | ||||||||||||||||||||||||||||||||||||
| 458 | - | |||||||||||||||||||||||||||||||||||||
| 459 | return never executed: text(boundaries.first, boundaries.second);return text(boundaries.first, boundaries.second);never executed: return text(boundaries.first, boundaries.second); | 0 | ||||||||||||||||||||||||||||||||||||
| 460 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 461 | return never executed: QAccessibleTextInterface::textBeforeOffset(offset, boundaryType, startOffset, endOffset);return QAccessibleTextInterface::textBeforeOffset(offset, boundaryType, startOffset, endOffset);never executed: return QAccessibleTextInterface::textBeforeOffset(offset, boundaryType, startOffset, endOffset); | 0 | ||||||||||||||||||||||||||||||||||||
| 462 | } | - | ||||||||||||||||||||||||||||||||||||
| 463 | } | - | ||||||||||||||||||||||||||||||||||||
| 464 | - | |||||||||||||||||||||||||||||||||||||
| 465 | QString QAccessibleQuickItem::textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType, | - | ||||||||||||||||||||||||||||||||||||
| 466 | int *startOffset, int *endOffset) const | - | ||||||||||||||||||||||||||||||||||||
| 467 | { | - | ||||||||||||||||||||||||||||||||||||
| 468 | ((startOffset) ? static_cast<void>(0) : qt_assert("startOffset", __FILE__, 521)); | - | ||||||||||||||||||||||||||||||||||||
| 469 | ((endOffset) ? static_cast<void>(0) : qt_assert("endOffset", __FILE__, 522)); | - | ||||||||||||||||||||||||||||||||||||
| 470 | - | |||||||||||||||||||||||||||||||||||||
| 471 | if (m_doc
| 0 | ||||||||||||||||||||||||||||||||||||
| 472 | QTextCursor cursor = QTextCursor(m_doc); | - | ||||||||||||||||||||||||||||||||||||
| 473 | cursor.setPosition(offset); | - | ||||||||||||||||||||||||||||||||||||
| 474 | QPair<int, int> boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType); | - | ||||||||||||||||||||||||||||||||||||
| 475 | cursor.setPosition(boundaries.second); | - | ||||||||||||||||||||||||||||||||||||
| 476 | boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType); | - | ||||||||||||||||||||||||||||||||||||
| 477 | - | |||||||||||||||||||||||||||||||||||||
| 478 | *startOffset = boundaries.first; | - | ||||||||||||||||||||||||||||||||||||
| 479 | *endOffset = boundaries.second; | - | ||||||||||||||||||||||||||||||||||||
| 480 | - | |||||||||||||||||||||||||||||||||||||
| 481 | return never executed: text(boundaries.first, boundaries.second);return text(boundaries.first, boundaries.second);never executed: return text(boundaries.first, boundaries.second); | 0 | ||||||||||||||||||||||||||||||||||||
| 482 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 483 | return never executed: QAccessibleTextInterface::textAfterOffset(offset, boundaryType, startOffset, endOffset);return QAccessibleTextInterface::textAfterOffset(offset, boundaryType, startOffset, endOffset);never executed: return QAccessibleTextInterface::textAfterOffset(offset, boundaryType, startOffset, endOffset); | 0 | ||||||||||||||||||||||||||||||||||||
| 484 | } | - | ||||||||||||||||||||||||||||||||||||
| 485 | } | - | ||||||||||||||||||||||||||||||||||||
| 486 | - | |||||||||||||||||||||||||||||||||||||
| 487 | QString QAccessibleQuickItem::textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType, | - | ||||||||||||||||||||||||||||||||||||
| 488 | int *startOffset, int *endOffset) const | - | ||||||||||||||||||||||||||||||||||||
| 489 | { | - | ||||||||||||||||||||||||||||||||||||
| 490 | ((startOffset) ? static_cast<void>(0) : qt_assert("startOffset", __FILE__, 543)); | - | ||||||||||||||||||||||||||||||||||||
| 491 | ((endOffset) ? static_cast<void>(0) : qt_assert("endOffset", __FILE__, 544)); | - | ||||||||||||||||||||||||||||||||||||
| 492 | - | |||||||||||||||||||||||||||||||||||||
| 493 | if (m_doc
| 0 | ||||||||||||||||||||||||||||||||||||
| 494 | QTextCursor cursor = QTextCursor(m_doc); | - | ||||||||||||||||||||||||||||||||||||
| 495 | cursor.setPosition(offset); | - | ||||||||||||||||||||||||||||||||||||
| 496 | QPair<int, int> boundaries = QAccessible::qAccessibleTextBoundaryHelper(cursor, boundaryType); | - | ||||||||||||||||||||||||||||||||||||
| 497 | - | |||||||||||||||||||||||||||||||||||||
| 498 | *startOffset = boundaries.first; | - | ||||||||||||||||||||||||||||||||||||
| 499 | *endOffset = boundaries.second; | - | ||||||||||||||||||||||||||||||||||||
| 500 | return never executed: text(boundaries.first, boundaries.second);return text(boundaries.first, boundaries.second);never executed: return text(boundaries.first, boundaries.second); | 0 | ||||||||||||||||||||||||||||||||||||
| 501 | } else { | - | ||||||||||||||||||||||||||||||||||||
| 502 | return never executed: QAccessibleTextInterface::textAtOffset(offset, boundaryType, startOffset, endOffset);return QAccessibleTextInterface::textAtOffset(offset, boundaryType, startOffset, endOffset);never executed: return QAccessibleTextInterface::textAtOffset(offset, boundaryType, startOffset, endOffset); | 0 | ||||||||||||||||||||||||||||||||||||
| 503 | } | - | ||||||||||||||||||||||||||||||||||||
| 504 | } | - | ||||||||||||||||||||||||||||||||||||
| 505 | - | |||||||||||||||||||||||||||||||||||||
| 506 | void QAccessibleQuickItem::selection(int selectionIndex, int *startOffset, int *endOffset) const | - | ||||||||||||||||||||||||||||||||||||
| 507 | { | - | ||||||||||||||||||||||||||||||||||||
| 508 | if (selectionIndex == 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 509 | *startOffset = item()->property("selectionStart").toInt(); | - | ||||||||||||||||||||||||||||||||||||
| 510 | *endOffset = item()->property("selectionEnd").toInt(); | - | ||||||||||||||||||||||||||||||||||||
| 511 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 512 | *startOffset = 0; | - | ||||||||||||||||||||||||||||||||||||
| 513 | *endOffset = 0; | - | ||||||||||||||||||||||||||||||||||||
| 514 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 515 | } | - | ||||||||||||||||||||||||||||||||||||
| 516 | - | |||||||||||||||||||||||||||||||||||||
| 517 | int QAccessibleQuickItem::selectionCount() const | - | ||||||||||||||||||||||||||||||||||||
| 518 | { | - | ||||||||||||||||||||||||||||||||||||
| 519 | if (item()->property("selectionStart").toInt() != item()->property("selectionEnd").toInt()
| 0 | ||||||||||||||||||||||||||||||||||||
| 520 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||||||||||||||||||||
| 521 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 522 | } | - | ||||||||||||||||||||||||||||||||||||
| 523 | - | |||||||||||||||||||||||||||||||||||||
| 524 | void QAccessibleQuickItem::addSelection(int , int ) | - | ||||||||||||||||||||||||||||||||||||
| 525 | { | - | ||||||||||||||||||||||||||||||||||||
| 526 | - | |||||||||||||||||||||||||||||||||||||
| 527 | } | - | ||||||||||||||||||||||||||||||||||||
| 528 | void QAccessibleQuickItem::removeSelection(int ) | - | ||||||||||||||||||||||||||||||||||||
| 529 | { | - | ||||||||||||||||||||||||||||||||||||
| 530 | - | |||||||||||||||||||||||||||||||||||||
| 531 | } | - | ||||||||||||||||||||||||||||||||||||
| 532 | void QAccessibleQuickItem::setSelection(int , int , int ) | - | ||||||||||||||||||||||||||||||||||||
| 533 | { | - | ||||||||||||||||||||||||||||||||||||
| 534 | - | |||||||||||||||||||||||||||||||||||||
| 535 | } | - | ||||||||||||||||||||||||||||||||||||
| 536 | - | |||||||||||||||||||||||||||||||||||||
| 537 | - | |||||||||||||||||||||||||||||||||||||
| 538 | - | |||||||||||||||||||||||||||||||||||||
| 539 | - | |||||||||||||||||||||||||||||||||||||
| 540 | - | |||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |