| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/accessible/complexwidgets.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | - | |||||||||||||
| 7 | QString qt_accStripAmp(const QString &text); | - | ||||||||||||
| 8 | QString qt_accHotKey(const QString &text); | - | ||||||||||||
| 9 | class QAccessibleTabButton: public QAccessibleInterface, public QAccessibleActionInterface | - | ||||||||||||
| 10 | { | - | ||||||||||||
| 11 | public: | - | ||||||||||||
| 12 | QAccessibleTabButton(QTabBar *parent, int index) | - | ||||||||||||
| 13 | : m_parent(parent), m_index(index) | - | ||||||||||||
| 14 | {} never executed: end of block | 0 | ||||||||||||
| 15 | - | |||||||||||||
| 16 | void *interface_cast(QAccessible::InterfaceType t) override { | - | ||||||||||||
| 17 | if (t == QAccessible::ActionInterface
| 0 | ||||||||||||
| 18 | return never executed: static_cast<QAccessibleActionInterface*>(this);return static_cast<QAccessibleActionInterface*>(this);never executed: return static_cast<QAccessibleActionInterface*>(this); | 0 | ||||||||||||
| 19 | } | - | ||||||||||||
| 20 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 21 | } | - | ||||||||||||
| 22 | - | |||||||||||||
| 23 | QObject *object() const override { return never executed: 0;return 0;never executed: }return 0; | 0 | ||||||||||||
| 24 | QAccessible::Role role() const override { return never executed: QAccessible::PageTab;return QAccessible::PageTab;never executed: }return QAccessible::PageTab; | 0 | ||||||||||||
| 25 | QAccessible::State state() const override { | - | ||||||||||||
| 26 | if (!isValid()
| 0 | ||||||||||||
| 27 | QAccessible::State s; | - | ||||||||||||
| 28 | s.invalid = true; | - | ||||||||||||
| 29 | return never executed: s;return s;never executed: return s; | 0 | ||||||||||||
| 30 | } | - | ||||||||||||
| 31 | return never executed: parent()->state();return parent()->state();never executed: return parent()->state(); | 0 | ||||||||||||
| 32 | } | - | ||||||||||||
| 33 | QRect rect() const override { | - | ||||||||||||
| 34 | if (!isValid()
| 0 | ||||||||||||
| 35 | return never executed: QRect();return QRect();never executed: return QRect(); | 0 | ||||||||||||
| 36 | - | |||||||||||||
| 37 | QPoint tp = m_parent->mapToGlobal(QPoint(0,0)); | - | ||||||||||||
| 38 | QRect rec = m_parent->tabRect(m_index); | - | ||||||||||||
| 39 | rec = QRect(tp.x() + rec.x(), tp.y() + rec.y(), rec.width(), rec.height()); | - | ||||||||||||
| 40 | return never executed: rec;return rec;never executed: return rec; | 0 | ||||||||||||
| 41 | } | - | ||||||||||||
| 42 | - | |||||||||||||
| 43 | bool isValid() const override { return never executed: m_parent.data() && m_parent->count() > m_index;return m_parent.data() && m_parent->count() > m_index;never executed: }return m_parent.data() && m_parent->count() > m_index; | 0 | ||||||||||||
| 44 | - | |||||||||||||
| 45 | QAccessibleInterface *childAt(int, int) const override { return never executed: 0;return 0;never executed: }return 0; | 0 | ||||||||||||
| 46 | int childCount() const override { return never executed: 0;return 0;never executed: }return 0; | 0 | ||||||||||||
| 47 | int indexOfChild(const QAccessibleInterface *) const override { return never executed: -1;return -1;never executed: }return -1; | 0 | ||||||||||||
| 48 | - | |||||||||||||
| 49 | QString text(QAccessible::Text t) const override | - | ||||||||||||
| 50 | { | - | ||||||||||||
| 51 | if (!isValid()
| 0 | ||||||||||||
| 52 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||
| 53 | switch (t) { | - | ||||||||||||
| 54 | case never executed: QAccessible::Name:case QAccessible::Name:never executed: case QAccessible::Name: | 0 | ||||||||||||
| 55 | return never executed: qt_accStripAmp(m_parent->tabText(m_index));return qt_accStripAmp(m_parent->tabText(m_index));never executed: return qt_accStripAmp(m_parent->tabText(m_index)); | 0 | ||||||||||||
| 56 | case never executed: QAccessible::Accelerator:case QAccessible::Accelerator:never executed: case QAccessible::Accelerator: | 0 | ||||||||||||
| 57 | return never executed: qt_accHotKey(m_parent->tabText(m_index));return qt_accHotKey(m_parent->tabText(m_index));never executed: return qt_accHotKey(m_parent->tabText(m_index)); | 0 | ||||||||||||
| 58 | case never executed: QAccessible::Description:case QAccessible::Description:never executed: case QAccessible::Description: | 0 | ||||||||||||
| 59 | return never executed: m_parent->tabToolTip(m_index);return m_parent->tabToolTip(m_index);never executed: return m_parent->tabToolTip(m_index); | 0 | ||||||||||||
| 60 | case never executed: QAccessible::Help:case QAccessible::Help:never executed: case QAccessible::Help: | 0 | ||||||||||||
| 61 | return never executed: m_parent->tabWhatsThis(m_index);return m_parent->tabWhatsThis(m_index);never executed: return m_parent->tabWhatsThis(m_index); | 0 | ||||||||||||
| 62 | default never executed: :default:never executed: default: | 0 | ||||||||||||
| 63 | break; never executed: break; | 0 | ||||||||||||
| 64 | } | - | ||||||||||||
| 65 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||
| 66 | } | - | ||||||||||||
| 67 | - | |||||||||||||
| 68 | void setText(QAccessible::Text, const QString &) override {} | - | ||||||||||||
| 69 | - | |||||||||||||
| 70 | QAccessibleInterface *parent() const override { | - | ||||||||||||
| 71 | return never executed: QAccessible::queryAccessibleInterface(m_parent.data());return QAccessible::queryAccessibleInterface(m_parent.data());never executed: return QAccessible::queryAccessibleInterface(m_parent.data()); | 0 | ||||||||||||
| 72 | } | - | ||||||||||||
| 73 | QAccessibleInterface *child(int) const override { return never executed: 0;return 0;never executed: }return 0; | 0 | ||||||||||||
| 74 | - | |||||||||||||
| 75 | - | |||||||||||||
| 76 | QStringList actionNames() const override | - | ||||||||||||
| 77 | { | - | ||||||||||||
| 78 | return never executed: QStringList(pressAction());return QStringList(pressAction());never executed: return QStringList(pressAction()); | 0 | ||||||||||||
| 79 | } | - | ||||||||||||
| 80 | - | |||||||||||||
| 81 | void doAction(const QString &actionName) override | - | ||||||||||||
| 82 | { | - | ||||||||||||
| 83 | if (isValid()
| 0 | ||||||||||||
| 84 | m_parent->setCurrentIndex(m_index); never executed: m_parent->setCurrentIndex(m_index); | 0 | ||||||||||||
| 85 | } never executed: end of block | 0 | ||||||||||||
| 86 | - | |||||||||||||
| 87 | QStringList keyBindingsForAction(const QString &) const override | - | ||||||||||||
| 88 | { | - | ||||||||||||
| 89 | return never executed: QStringList();return QStringList();never executed: return QStringList(); | 0 | ||||||||||||
| 90 | } | - | ||||||||||||
| 91 | - | |||||||||||||
| 92 | int index() const { return never executed: m_index;return m_index;never executed: }return m_index; | 0 | ||||||||||||
| 93 | - | |||||||||||||
| 94 | private: | - | ||||||||||||
| 95 | QPointer<QTabBar> m_parent; | - | ||||||||||||
| 96 | int m_index; | - | ||||||||||||
| 97 | - | |||||||||||||
| 98 | }; | - | ||||||||||||
| 99 | - | |||||||||||||
| 100 | - | |||||||||||||
| 101 | - | |||||||||||||
| 102 | - | |||||||||||||
| 103 | QAccessibleTabBar::QAccessibleTabBar(QWidget *w) | - | ||||||||||||
| 104 | : QAccessibleWidget(w, QAccessible::PageTabList) | - | ||||||||||||
| 105 | { | - | ||||||||||||
| 106 | ((!(tabBar())) ? qt_assert("tabBar()",__FILE__,176) : qt_noop()); | - | ||||||||||||
| 107 | } never executed: end of block | 0 | ||||||||||||
| 108 | - | |||||||||||||
| 109 | QAccessibleTabBar::~QAccessibleTabBar() | - | ||||||||||||
| 110 | { | - | ||||||||||||
| 111 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(m_childInterfaces)>::type> _container_((m_childInterfaces)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QAccessible::Id id = *_container_.i; _container_.control; _container_.control = 0) | - | ||||||||||||
| 112 | QAccessible::deleteAccessibleInterface(id); never executed: QAccessible::deleteAccessibleInterface(id); | 0 | ||||||||||||
| 113 | } never executed: end of block | 0 | ||||||||||||
| 114 | - | |||||||||||||
| 115 | - | |||||||||||||
| 116 | QTabBar *QAccessibleTabBar::tabBar() const | - | ||||||||||||
| 117 | { | - | ||||||||||||
| 118 | return never executed: qobject_cast<QTabBar*>(object());return qobject_cast<QTabBar*>(object());never executed: return qobject_cast<QTabBar*>(object()); | 0 | ||||||||||||
| 119 | } | - | ||||||||||||
| 120 | - | |||||||||||||
| 121 | QAccessibleInterface* QAccessibleTabBar::child(int index) const | - | ||||||||||||
| 122 | { | - | ||||||||||||
| 123 | if (QAccessible::Id id = m_childInterfaces.value(index)
| 0 | ||||||||||||
| 124 | return never executed: QAccessible::accessibleInterface(id);return QAccessible::accessibleInterface(id);never executed: return QAccessible::accessibleInterface(id); | 0 | ||||||||||||
| 125 | - | |||||||||||||
| 126 | - | |||||||||||||
| 127 | if (index < tabBar()->count()
| 0 | ||||||||||||
| 128 | QAccessibleTabButton *button = new QAccessibleTabButton(tabBar(), index); | - | ||||||||||||
| 129 | QAccessible::registerAccessibleInterface(button); | - | ||||||||||||
| 130 | m_childInterfaces.insert(index, QAccessible::uniqueId(button)); | - | ||||||||||||
| 131 | return never executed: button;return button;never executed: return button; | 0 | ||||||||||||
| 132 | } else if (index >= tabBar()->count()
| 0 | ||||||||||||
| 133 | - | |||||||||||||
| 134 | if (index - tabBar()->count() == 0
| 0 | ||||||||||||
| 135 | return never executed: QAccessible::queryAccessibleInterface(tabBar()->d_func()->leftB);return QAccessible::queryAccessibleInterface(tabBar()->d_func()->leftB);never executed: return QAccessible::queryAccessibleInterface(tabBar()->d_func()->leftB); | 0 | ||||||||||||
| 136 | } | - | ||||||||||||
| 137 | - | |||||||||||||
| 138 | if (index - tabBar()->count() == 1
| 0 | ||||||||||||
| 139 | return never executed: QAccessible::queryAccessibleInterface(tabBar()->d_func()->rightB);return QAccessible::queryAccessibleInterface(tabBar()->d_func()->rightB);never executed: return QAccessible::queryAccessibleInterface(tabBar()->d_func()->rightB); | 0 | ||||||||||||
| 140 | } | - | ||||||||||||
| 141 | } never executed: end of block | 0 | ||||||||||||
| 142 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 143 | } | - | ||||||||||||
| 144 | - | |||||||||||||
| 145 | int QAccessibleTabBar::indexOfChild(const QAccessibleInterface *child) const | - | ||||||||||||
| 146 | { | - | ||||||||||||
| 147 | if (child->object()
| 0 | ||||||||||||
| 148 | return never executed: tabBar()->count();return tabBar()->count();never executed: return tabBar()->count(); | 0 | ||||||||||||
| 149 | if (child->object()
| 0 | ||||||||||||
| 150 | return never executed: tabBar()->count() + 1;return tabBar()->count() + 1;never executed: return tabBar()->count() + 1; | 0 | ||||||||||||
| 151 | if (child->role() == QAccessible::PageTab
| 0 | ||||||||||||
| 152 | QAccessibleInterface *parent = child->parent(); | - | ||||||||||||
| 153 | if (parent == this
| 0 | ||||||||||||
| 154 | const QAccessibleTabButton *tabButton = static_cast<const QAccessibleTabButton *>(child); | - | ||||||||||||
| 155 | return never executed: tabButton->index();return tabButton->index();never executed: return tabButton->index(); | 0 | ||||||||||||
| 156 | } | - | ||||||||||||
| 157 | } never executed: end of block | 0 | ||||||||||||
| 158 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||
| 159 | } | - | ||||||||||||
| 160 | - | |||||||||||||
| 161 | int QAccessibleTabBar::childCount() const | - | ||||||||||||
| 162 | { | - | ||||||||||||
| 163 | - | |||||||||||||
| 164 | return never executed: tabBar()->count() + 2;return tabBar()->count() + 2;never executed: return tabBar()->count() + 2; | 0 | ||||||||||||
| 165 | } | - | ||||||||||||
| 166 | - | |||||||||||||
| 167 | QString QAccessibleTabBar::text(QAccessible::Text t) const | - | ||||||||||||
| 168 | { | - | ||||||||||||
| 169 | if (t == QAccessible::Name
| 0 | ||||||||||||
| 170 | return never executed: qt_accStripAmp(tabBar()->tabText(tabBar()->currentIndex()));return qt_accStripAmp(tabBar()->tabText(tabBar()->currentIndex()));never executed: return qt_accStripAmp(tabBar()->tabText(tabBar()->currentIndex())); | 0 | ||||||||||||
| 171 | } else if (t == QAccessible::Accelerator
| 0 | ||||||||||||
| 172 | return never executed: qt_accHotKey(tabBar()->tabText(tabBar()->currentIndex()));return qt_accHotKey(tabBar()->tabText(tabBar()->currentIndex()));never executed: return qt_accHotKey(tabBar()->tabText(tabBar()->currentIndex())); | 0 | ||||||||||||
| 173 | } | - | ||||||||||||
| 174 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||
| 175 | } | - | ||||||||||||
| 176 | QAccessibleComboBox::QAccessibleComboBox(QWidget *w) | - | ||||||||||||
| 177 | : QAccessibleWidget(w, QAccessible::ComboBox) | - | ||||||||||||
| 178 | { | - | ||||||||||||
| 179 | ((!(comboBox())) ? qt_assert("comboBox()",__FILE__,264) : qt_noop()); | - | ||||||||||||
| 180 | } never executed: end of block | 0 | ||||||||||||
| 181 | - | |||||||||||||
| 182 | - | |||||||||||||
| 183 | - | |||||||||||||
| 184 | - | |||||||||||||
| 185 | QComboBox *QAccessibleComboBox::comboBox() const | - | ||||||||||||
| 186 | { | - | ||||||||||||
| 187 | return never executed: qobject_cast<QComboBox*>(object());return qobject_cast<QComboBox*>(object());never executed: return qobject_cast<QComboBox*>(object()); | 0 | ||||||||||||
| 188 | } | - | ||||||||||||
| 189 | - | |||||||||||||
| 190 | QAccessibleInterface *QAccessibleComboBox::child(int index) const | - | ||||||||||||
| 191 | { | - | ||||||||||||
| 192 | if (index == 0
| 0 | ||||||||||||
| 193 | QAbstractItemView *view = comboBox()->view(); | - | ||||||||||||
| 194 | - | |||||||||||||
| 195 | return never executed: QAccessible::queryAccessibleInterface(view);return QAccessible::queryAccessibleInterface(view);never executed: return QAccessible::queryAccessibleInterface(view); | 0 | ||||||||||||
| 196 | } else if (index == 1
| 0 | ||||||||||||
| 197 | return never executed: QAccessible::queryAccessibleInterface(comboBox()->lineEdit());return QAccessible::queryAccessibleInterface(comboBox()->lineEdit());never executed: return QAccessible::queryAccessibleInterface(comboBox()->lineEdit()); | 0 | ||||||||||||
| 198 | } | - | ||||||||||||
| 199 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 200 | } | - | ||||||||||||
| 201 | - | |||||||||||||
| 202 | int QAccessibleComboBox::childCount() const | - | ||||||||||||
| 203 | { | - | ||||||||||||
| 204 | - | |||||||||||||
| 205 | return never executed: comboBox()->isEditable() ? 2 : 1;return comboBox()->isEditable() ? 2 : 1;never executed: return comboBox()->isEditable() ? 2 : 1; | 0 | ||||||||||||
| 206 | } | - | ||||||||||||
| 207 | - | |||||||||||||
| 208 | QAccessibleInterface *QAccessibleComboBox::childAt(int x, int y) const | - | ||||||||||||
| 209 | { | - | ||||||||||||
| 210 | if (comboBox()->isEditable()
| 0 | ||||||||||||
| 211 | return never executed: child(1);return child(1);never executed: return child(1); | 0 | ||||||||||||
| 212 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 213 | } | - | ||||||||||||
| 214 | - | |||||||||||||
| 215 | int QAccessibleComboBox::indexOfChild(const QAccessibleInterface *child) const | - | ||||||||||||
| 216 | { | - | ||||||||||||
| 217 | if (comboBox()->view() == child->object()
| 0 | ||||||||||||
| 218 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 219 | if (comboBox()->isEditable()
| 0 | ||||||||||||
| 220 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||
| 221 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||
| 222 | } | - | ||||||||||||
| 223 | - | |||||||||||||
| 224 | - | |||||||||||||
| 225 | QString QAccessibleComboBox::text(QAccessible::Text t) const | - | ||||||||||||
| 226 | { | - | ||||||||||||
| 227 | QString str; | - | ||||||||||||
| 228 | - | |||||||||||||
| 229 | switch (t) { | - | ||||||||||||
| 230 | case never executed: QAccessible::Name:case QAccessible::Name:never executed: case QAccessible::Name: | 0 | ||||||||||||
| 231 | - | |||||||||||||
| 232 | - | |||||||||||||
| 233 | - | |||||||||||||
| 234 | - | |||||||||||||
| 235 | case never executed: QAccessible::Value:case QAccessible::Value:never executed: case QAccessible::Value: | 0 | ||||||||||||
| 236 | if (comboBox()->isEditable()
| 0 | ||||||||||||
| 237 | str = comboBox()->lineEdit()->text(); never executed: str = comboBox()->lineEdit()->text(); | 0 | ||||||||||||
| 238 | else | - | ||||||||||||
| 239 | str = comboBox()->currentText(); never executed: str = comboBox()->currentText(); | 0 | ||||||||||||
| 240 | break; never executed: break; | 0 | ||||||||||||
| 241 | - | |||||||||||||
| 242 | case never executed: QAccessible::Accelerator:case QAccessible::Accelerator:never executed: case QAccessible::Accelerator: | 0 | ||||||||||||
| 243 | str = QKeySequence(Qt::Key_Down).toString(QKeySequence::NativeText); | - | ||||||||||||
| 244 | break; never executed: break; | 0 | ||||||||||||
| 245 | - | |||||||||||||
| 246 | default never executed: :default:never executed: default: | 0 | ||||||||||||
| 247 | break; never executed: break; | 0 | ||||||||||||
| 248 | } | - | ||||||||||||
| 249 | if (str.isEmpty()
| 0 | ||||||||||||
| 250 | str = QAccessibleWidget::text(t); never executed: str = QAccessibleWidget::text(t); | 0 | ||||||||||||
| 251 | return never executed: str;return str;never executed: return str; | 0 | ||||||||||||
| 252 | } | - | ||||||||||||
| 253 | - | |||||||||||||
| 254 | QStringList QAccessibleComboBox::actionNames() const | - | ||||||||||||
| 255 | { | - | ||||||||||||
| 256 | return never executed: QStringList() << showMenuAction() << pressAction();return QStringList() << showMenuAction() << pressAction();never executed: return QStringList() << showMenuAction() << pressAction(); | 0 | ||||||||||||
| 257 | } | - | ||||||||||||
| 258 | - | |||||||||||||
| 259 | QString QAccessibleComboBox::localizedActionDescription(const QString &actionName) const | - | ||||||||||||
| 260 | { | - | ||||||||||||
| 261 | if (actionName == showMenuAction()
| 0 | ||||||||||||
| 262 | return never executed: QComboBox::tr("Open the combo box selection popup");return QComboBox::tr("Open the combo box selection popup");never executed: return QComboBox::tr("Open the combo box selection popup"); | 0 | ||||||||||||
| 263 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||
| 264 | } | - | ||||||||||||
| 265 | - | |||||||||||||
| 266 | void QAccessibleComboBox::doAction(const QString &actionName) | - | ||||||||||||
| 267 | { | - | ||||||||||||
| 268 | if (actionName == showMenuAction()
| 0 | ||||||||||||
| 269 | if (comboBox()->view()->isVisible()
| 0 | ||||||||||||
| 270 | comboBox()->hidePopup(); | - | ||||||||||||
| 271 | } never executed: else {end of block | 0 | ||||||||||||
| 272 | comboBox()->showPopup(); | - | ||||||||||||
| 273 | } never executed: end of block | 0 | ||||||||||||
| 274 | } | - | ||||||||||||
| 275 | } never executed: end of block | 0 | ||||||||||||
| 276 | - | |||||||||||||
| 277 | QStringList QAccessibleComboBox::keyBindingsForAction(const QString & ) const | - | ||||||||||||
| 278 | { | - | ||||||||||||
| 279 | return never executed: QStringList();return QStringList();never executed: return QStringList(); | 0 | ||||||||||||
| 280 | } | - | ||||||||||||
| 281 | - | |||||||||||||
| 282 | - | |||||||||||||
| 283 | - | |||||||||||||
| 284 | - | |||||||||||||
| 285 | - | |||||||||||||
| 286 | QAccessibleAbstractScrollArea::QAccessibleAbstractScrollArea(QWidget *widget) | - | ||||||||||||
| 287 | : QAccessibleWidget(widget, QAccessible::Client) | - | ||||||||||||
| 288 | { | - | ||||||||||||
| 289 | ((!(qobject_cast<QAbstractScrollArea *>(widget))) ? qt_assert("qobject_cast<QAbstractScrollArea *>(widget)",__FILE__,374) : qt_noop()); | - | ||||||||||||
| 290 | } never executed: end of block | 0 | ||||||||||||
| 291 | - | |||||||||||||
| 292 | QAccessibleInterface *QAccessibleAbstractScrollArea::child(int index) const | - | ||||||||||||
| 293 | { | - | ||||||||||||
| 294 | return never executed: QAccessible::queryAccessibleInterface(accessibleChildren().at(index));return QAccessible::queryAccessibleInterface(accessibleChildren().at(index));never executed: return QAccessible::queryAccessibleInterface(accessibleChildren().at(index)); | 0 | ||||||||||||
| 295 | } | - | ||||||||||||
| 296 | - | |||||||||||||
| 297 | int QAccessibleAbstractScrollArea::childCount() const | - | ||||||||||||
| 298 | { | - | ||||||||||||
| 299 | return never executed: accessibleChildren().count();return accessibleChildren().count();never executed: return accessibleChildren().count(); | 0 | ||||||||||||
| 300 | } | - | ||||||||||||
| 301 | - | |||||||||||||
| 302 | int QAccessibleAbstractScrollArea::indexOfChild(const QAccessibleInterface *child) const | - | ||||||||||||
| 303 | { | - | ||||||||||||
| 304 | if (!child
| 0 | ||||||||||||
| 305 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||
| 306 | return never executed: accessibleChildren().indexOf(qobject_cast<QWidget *>(child->object()));return accessibleChildren().indexOf(qobject_cast<QWidget *>(child->object()));never executed: return accessibleChildren().indexOf(qobject_cast<QWidget *>(child->object())); | 0 | ||||||||||||
| 307 | } | - | ||||||||||||
| 308 | - | |||||||||||||
| 309 | bool QAccessibleAbstractScrollArea::isValid() const | - | ||||||||||||
| 310 | { | - | ||||||||||||
| 311 | return never executed: (QAccessibleWidget::isValid() && abstractScrollArea() && abstractScrollArea()->viewport());return (QAccessibleWidget::isValid() && abstractScrollArea() && abstractScrollArea()->viewport());never executed: return (QAccessibleWidget::isValid() && abstractScrollArea() && abstractScrollArea()->viewport()); | 0 | ||||||||||||
| 312 | } | - | ||||||||||||
| 313 | - | |||||||||||||
| 314 | QAccessibleInterface *QAccessibleAbstractScrollArea::childAt(int x, int y) const | - | ||||||||||||
| 315 | { | - | ||||||||||||
| 316 | if (!abstractScrollArea()->isVisible()
| 0 | ||||||||||||
| 317 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 318 | - | |||||||||||||
| 319 | for (int i = 0; i < childCount()
| 0 | ||||||||||||
| 320 | QPoint wpos = accessibleChildren().at(i)->mapToGlobal(QPoint(0, 0)); | - | ||||||||||||
| 321 | QRect rect = QRect(wpos, accessibleChildren().at(i)->size()); | - | ||||||||||||
| 322 | if (rect.contains(x, y)
| 0 | ||||||||||||
| 323 | return never executed: child(i);return child(i);never executed: return child(i); | 0 | ||||||||||||
| 324 | } never executed: end of block | 0 | ||||||||||||
| 325 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 326 | } | - | ||||||||||||
| 327 | - | |||||||||||||
| 328 | QAbstractScrollArea *QAccessibleAbstractScrollArea::abstractScrollArea() const | - | ||||||||||||
| 329 | { | - | ||||||||||||
| 330 | return never executed: static_cast<QAbstractScrollArea *>(object());return static_cast<QAbstractScrollArea *>(object());never executed: return static_cast<QAbstractScrollArea *>(object()); | 0 | ||||||||||||
| 331 | } | - | ||||||||||||
| 332 | - | |||||||||||||
| 333 | QWidgetList QAccessibleAbstractScrollArea::accessibleChildren() const | - | ||||||||||||
| 334 | { | - | ||||||||||||
| 335 | QWidgetList children; | - | ||||||||||||
| 336 | - | |||||||||||||
| 337 | - | |||||||||||||
| 338 | QWidget * viewport = abstractScrollArea()->viewport(); | - | ||||||||||||
| 339 | if (viewport
| 0 | ||||||||||||
| 340 | children.append(viewport); never executed: children.append(viewport); | 0 | ||||||||||||
| 341 | - | |||||||||||||
| 342 | - | |||||||||||||
| 343 | QScrollBar *horizontalScrollBar = abstractScrollArea()->horizontalScrollBar(); | - | ||||||||||||
| 344 | if (horizontalScrollBar
| 0 | ||||||||||||
| 345 | children.append(horizontalScrollBar->parentWidget()); | - | ||||||||||||
| 346 | } never executed: end of block | 0 | ||||||||||||
| 347 | - | |||||||||||||
| 348 | - | |||||||||||||
| 349 | QScrollBar *verticalScrollBar = abstractScrollArea()->verticalScrollBar(); | - | ||||||||||||
| 350 | if (verticalScrollBar
| 0 | ||||||||||||
| 351 | children.append(verticalScrollBar->parentWidget()); | - | ||||||||||||
| 352 | } never executed: end of block | 0 | ||||||||||||
| 353 | - | |||||||||||||
| 354 | - | |||||||||||||
| 355 | QWidget *cornerWidget = abstractScrollArea()->cornerWidget(); | - | ||||||||||||
| 356 | if (cornerWidget
| 0 | ||||||||||||
| 357 | children.append(cornerWidget); never executed: children.append(cornerWidget); | 0 | ||||||||||||
| 358 | - | |||||||||||||
| 359 | return never executed: children;return children;never executed: return children; | 0 | ||||||||||||
| 360 | } | - | ||||||||||||
| 361 | - | |||||||||||||
| 362 | QAccessibleAbstractScrollArea::AbstractScrollAreaElement | - | ||||||||||||
| 363 | QAccessibleAbstractScrollArea::elementType(QWidget *widget) const | - | ||||||||||||
| 364 | { | - | ||||||||||||
| 365 | if (!widget
| 0 | ||||||||||||
| 366 | return never executed: Undefined;return Undefined;never executed: return Undefined; | 0 | ||||||||||||
| 367 | - | |||||||||||||
| 368 | if (widget == abstractScrollArea()
| 0 | ||||||||||||
| 369 | return never executed: Self;return Self;never executed: return Self; | 0 | ||||||||||||
| 370 | if (widget == abstractScrollArea()->viewport()
| 0 | ||||||||||||
| 371 | return never executed: Viewport;return Viewport;never executed: return Viewport; | 0 | ||||||||||||
| 372 | if (widget->objectName() == QLatin1String("qt_scrollarea_hcontainer")
| 0 | ||||||||||||
| 373 | return never executed: HorizontalContainer;return HorizontalContainer;never executed: return HorizontalContainer; | 0 | ||||||||||||
| 374 | if (widget->objectName() == QLatin1String("qt_scrollarea_vcontainer")
| 0 | ||||||||||||
| 375 | return never executed: VerticalContainer;return VerticalContainer;never executed: return VerticalContainer; | 0 | ||||||||||||
| 376 | if (widget == abstractScrollArea()->cornerWidget()
| 0 | ||||||||||||
| 377 | return never executed: CornerWidget;return CornerWidget;never executed: return CornerWidget; | 0 | ||||||||||||
| 378 | - | |||||||||||||
| 379 | return never executed: Undefined;return Undefined;never executed: return Undefined; | 0 | ||||||||||||
| 380 | } | - | ||||||||||||
| 381 | - | |||||||||||||
| 382 | bool QAccessibleAbstractScrollArea::isLeftToRight() const | - | ||||||||||||
| 383 | { | - | ||||||||||||
| 384 | return never executed: abstractScrollArea()->isLeftToRight();return abstractScrollArea()->isLeftToRight();never executed: return abstractScrollArea()->isLeftToRight(); | 0 | ||||||||||||
| 385 | } | - | ||||||||||||
| 386 | - | |||||||||||||
| 387 | - | |||||||||||||
| 388 | QAccessibleScrollArea::QAccessibleScrollArea(QWidget *widget) | - | ||||||||||||
| 389 | : QAccessibleAbstractScrollArea(widget) | - | ||||||||||||
| 390 | { | - | ||||||||||||
| 391 | ((!(qobject_cast<QScrollArea *>(widget))) ? qt_assert("qobject_cast<QScrollArea *>(widget)",__FILE__,476) : qt_noop()); | - | ||||||||||||
| 392 | } never executed: end of block | 0 | ||||||||||||
| 393 | - | |||||||||||||
| 394 | - | |||||||||||||
| 395 | - | |||||||||||||
| Switch to Source code | Preprocessed file |