itemviews.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/accessible/itemviews.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6QAbstractItemView *QAccessibleTable::view() const-
7{-
8 return
never executed: return qobject_cast<QAbstractItemView*>(object());
qobject_cast<QAbstractItemView*>(object());
never executed: return qobject_cast<QAbstractItemView*>(object());
0
9}-
10-
11int QAccessibleTable::logicalIndex(const QModelIndex &index) const-
12{-
13 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
|| !index.isValid()
!index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
14 return
never executed: return -1;
-1;
never executed: return -1;
0
15 int vHeader = verticalHeader()
verticalHeader()Description
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0;
0
16 int hHeader = horizontalHeader()
horizontalHeader()Description
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0;
0
17 return
never executed: return (index.row() + hHeader)*(index.model()->columnCount() + vHeader) + (index.column() + vHeader);
(index.row() + hHeader)*(index.model()->columnCount() + vHeader) + (index.column() + vHeader);
never executed: return (index.row() + hHeader)*(index.model()->columnCount() + vHeader) + (index.column() + vHeader);
0
18}-
19-
20QAccessibleTable::QAccessibleTable(QWidget *w)-
21 : QAccessibleObject(w)-
22{-
23 ((!(view())) ? qt_assert("view()",__FILE__,82) : qt_noop());-
24-
25 if (qobject_cast<const QTableView*>(view())
qobject_cast<c...View*>(view())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
26 m_role = QAccessible::Table;-
27 }
never executed: end of block
else if (qobject_cast<const QTreeView*>(view())
qobject_cast<c...View*>(view())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
28 m_role = QAccessible::Tree;-
29 }
never executed: end of block
else if (qobject_cast<const QListView*>(view())
qobject_cast<c...View*>(view())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
30 m_role = QAccessible::List;-
31 }
never executed: end of block
else {
0
32-
33 m_role = QAccessible::Table;-
34 }
never executed: end of block
0
35}-
36-
37bool QAccessibleTable::isValid() const-
38{-
39 return
never executed: return (view() && !qobject_cast<QWidget*>(view())->d_func()->data.in_destructor);
(view() && !qobject_cast<QWidget*>(view())->d_func()->data.in_destructor);
never executed: return (view() && !qobject_cast<QWidget*>(view())->d_func()->data.in_destructor);
0
40}-
41-
42QAccessibleTable::~QAccessibleTable()-
43{-
44 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(childToId)>::type> _container_((childToId)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QAccessible::Id id = *_container_.i; _container_.control; _container_.control = 0)-
45 QAccessible::deleteAccessibleInterface(id);
never executed: QAccessible::deleteAccessibleInterface(id);
0
46}
never executed: end of block
0
47-
48QHeaderView *QAccessibleTable::horizontalHeader() const-
49{-
50 QHeaderView *header = 0;-
51 if (false) {
dead code: { }
-
52-
53 }
dead code: { }
else if (const
const QTableVi...View*>(view())Description
TRUEnever evaluated
FALSEnever evaluated
QTableView *tv = qobject_cast<const QTableView*>(view())
const QTableVi...View*>(view())Description
TRUEnever evaluated
FALSEnever evaluated
) {
-
54 header = tv->horizontalHeader();-
55-
56-
57 }
never executed: end of block
else if (const
const QTreeVie...View*>(view())Description
TRUEnever evaluated
FALSEnever evaluated
QTreeView *tv = qobject_cast<const QTreeView*>(view())
const QTreeVie...View*>(view())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
58 header = tv->header();-
59-
60 }
never executed: end of block
0
61 return
never executed: return header;
header;
never executed: return header;
0
62}-
63-
64QHeaderView *QAccessibleTable::verticalHeader() const-
65{-
66 QHeaderView *header = 0;-
67 if (false) {
dead code: { }
-
68-
69 }
dead code: { }
else if (const
const QTableVi...View*>(view())Description
TRUEnever evaluated
FALSEnever evaluated
QTableView *tv = qobject_cast<const QTableView*>(view())
const QTableVi...View*>(view())Description
TRUEnever evaluated
FALSEnever evaluated
) {
-
70 header = tv->verticalHeader();-
71-
72 }
never executed: end of block
0
73 return
never executed: return header;
header;
never executed: return header;
0
74}-
75-
76QAccessibleInterface *QAccessibleTable::cellAt(int row, int column) const-
77{-
78 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
79 return
never executed: return 0;
0;
never executed: return 0;
0
80 ((!(role() != QAccessible::Tree)) ? qt_assert("role() != QAccessible::Tree",__FILE__,139) : qt_noop());-
81 QModelIndex index = view()->model()->index(row, column, view()->rootIndex());-
82 if (__builtin_expect(!!(!index.isValid()), false)
__builtin_expe...lid()), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
83 QMessageLogger(__FILE__, 142, __PRETTY_FUNCTION__).warning() << "QAccessibleTable::cellAt: invalid index: " << index << " for " << view();-
84 return
never executed: return 0;
0;
never executed: return 0;
0
85 }-
86 return
never executed: return child(logicalIndex(index));
child(logicalIndex(index));
never executed: return child(logicalIndex(index));
0
87}-
88-
89QAccessibleInterface *QAccessibleTable::caption() const-
90{-
91 return
never executed: return 0;
0;
never executed: return 0;
0
92}-
93-
94QString QAccessibleTable::columnDescription(int column) const-
95{-
96 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
97 return
never executed: return QString();
QString();
never executed: return QString();
0
98 return
never executed: return view()->model()->headerData(column, Qt::Horizontal).toString();
view()->model()->headerData(column, Qt::Horizontal).toString();
never executed: return view()->model()->headerData(column, Qt::Horizontal).toString();
0
99}-
100-
101int QAccessibleTable::columnCount() const-
102{-
103 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
104 return
never executed: return 0;
0;
never executed: return 0;
0
105 return
never executed: return view()->model()->columnCount();
view()->model()->columnCount();
never executed: return view()->model()->columnCount();
0
106}-
107-
108int QAccessibleTable::rowCount() const-
109{-
110 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
111 return
never executed: return 0;
0;
never executed: return 0;
0
112 return
never executed: return view()->model()->rowCount();
view()->model()->rowCount();
never executed: return view()->model()->rowCount();
0
113}-
114-
115int QAccessibleTable::selectedCellCount() const-
116{-
117 if (!view()->selectionModel()
!view()->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
118 return
never executed: return 0;
0;
never executed: return 0;
0
119 return
never executed: return view()->selectionModel()->selectedIndexes().count();
view()->selectionModel()->selectedIndexes().count();
never executed: return view()->selectionModel()->selectedIndexes().count();
0
120}-
121-
122int QAccessibleTable::selectedColumnCount() const-
123{-
124 if (!view()->selectionModel()
!view()->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
125 return
never executed: return 0;
0;
never executed: return 0;
0
126 return
never executed: return view()->selectionModel()->selectedColumns().count();
view()->selectionModel()->selectedColumns().count();
never executed: return view()->selectionModel()->selectedColumns().count();
0
127}-
128-
129int QAccessibleTable::selectedRowCount() const-
130{-
131 if (!view()->selectionModel()
!view()->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
132 return
never executed: return 0;
0;
never executed: return 0;
0
133 return
never executed: return view()->selectionModel()->selectedRows().count();
view()->selectionModel()->selectedRows().count();
never executed: return view()->selectionModel()->selectedRows().count();
0
134}-
135-
136QString QAccessibleTable::rowDescription(int row) const-
137{-
138 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
139 return
never executed: return QString();
QString();
never executed: return QString();
0
140 return
never executed: return view()->model()->headerData(row, Qt::Vertical).toString();
view()->model()->headerData(row, Qt::Vertical).toString();
never executed: return view()->model()->headerData(row, Qt::Vertical).toString();
0
141}-
142-
143QList<QAccessibleInterface *> QAccessibleTable::selectedCells() const-
144{-
145 QList<QAccessibleInterface*> cells;-
146 if (!view()->selectionModel()
!view()->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
147 return
never executed: return cells;
cells;
never executed: return cells;
0
148 const QModelIndexList selectedIndexes = view()->selectionModel()->selectedIndexes();-
149 cells.reserve(selectedIndexes.size());-
150 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(selectedIndexes)>::type> _container_((selectedIndexes)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QModelIndex &index = *_container_.i; _container_.control; _container_.control = 0)-
151 cells.append(child(logicalIndex(index)));
never executed: cells.append(child(logicalIndex(index)));
0
152 return
never executed: return cells;
cells;
never executed: return cells;
0
153}-
154-
155QList<int> QAccessibleTable::selectedColumns() const-
156{-
157 if (!view()->selectionModel()
!view()->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
158 return
never executed: return QList<int>();
QList<int>();
never executed: return QList<int>();
0
159 QList<int> columns;-
160 const QModelIndexList selectedColumns = view()->selectionModel()->selectedColumns();-
161 columns.reserve(selectedColumns.size());-
162 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(selectedColumns)>::type> _container_((selectedColumns)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QModelIndex &index = *_container_.i; _container_.control; _container_.control = 0)-
163 columns.append(index.column());
never executed: columns.append(index.column());
0
164-
165 return
never executed: return columns;
columns;
never executed: return columns;
0
166}-
167-
168QList<int> QAccessibleTable::selectedRows() const-
169{-
170 if (!view()->selectionModel()
!view()->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
171 return
never executed: return QList<int>();
QList<int>();
never executed: return QList<int>();
0
172 QList<int> rows;-
173 const QModelIndexList selectedRows = view()->selectionModel()->selectedRows();-
174 rows.reserve(selectedRows.size());-
175 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(selectedRows)>::type> _container_((selectedRows)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const QModelIndex &index = *_container_.i; _container_.control; _container_.control = 0)-
176 rows.append(index.row());
never executed: rows.append(index.row());
0
177-
178 return
never executed: return rows;
rows;
never executed: return rows;
0
179}-
180-
181QAccessibleInterface *QAccessibleTable::summary() const-
182{-
183 return
never executed: return 0;
0;
never executed: return 0;
0
184}-
185-
186bool QAccessibleTable::isColumnSelected(int column) const-
187{-
188 if (!view()->selectionModel()
!view()->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
189 return
never executed: return false;
false;
never executed: return false;
0
190 return
never executed: return view()->selectionModel()->isColumnSelected(column, QModelIndex());
view()->selectionModel()->isColumnSelected(column, QModelIndex());
never executed: return view()->selectionModel()->isColumnSelected(column, QModelIndex());
0
191}-
192-
193bool QAccessibleTable::isRowSelected(int row) const-
194{-
195 if (!view()->selectionModel()
!view()->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
196 return
never executed: return false;
false;
never executed: return false;
0
197 return
never executed: return view()->selectionModel()->isRowSelected(row, QModelIndex());
view()->selectionModel()->isRowSelected(row, QModelIndex());
never executed: return view()->selectionModel()->isRowSelected(row, QModelIndex());
0
198}-
199-
200bool QAccessibleTable::selectRow(int row)-
201{-
202 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
|| !view()->selectionModel()
!view()->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
203 return
never executed: return false;
false;
never executed: return false;
0
204 QModelIndex index = view()->model()->index(row, 0, view()->rootIndex());-
205-
206 if (!index.isValid()
!index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
|| view()->selectionBehavior() == QAbstractItemView::SelectColumns
view()->select...:SelectColumnsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
207 return
never executed: return false;
false;
never executed: return false;
0
208-
209 switch (view()->selectionMode()) {-
210 case
never executed: case QAbstractItemView::NoSelection:
QAbstractItemView::NoSelection:
never executed: case QAbstractItemView::NoSelection:
0
211 return
never executed: return false;
false;
never executed: return false;
0
212 case
never executed: case QAbstractItemView::SingleSelection:
QAbstractItemView::SingleSelection:
never executed: case QAbstractItemView::SingleSelection:
0
213 if (view()->selectionBehavior() != QAbstractItemView::SelectRows
view()->select...ew::SelectRowsDescription
TRUEnever evaluated
FALSEnever evaluated
&& columnCount() > 1
columnCount() > 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
214 return
never executed: return false;
false;
never executed: return false;
0
215 view()->clearSelection();-
216 break;
never executed: break;
0
217 case
never executed: case QAbstractItemView::ContiguousSelection:
QAbstractItemView::ContiguousSelection:
never executed: case QAbstractItemView::ContiguousSelection:
0
218 if ((!row
!rowDescription
TRUEnever evaluated
FALSEnever evaluated
|| !view()->selectionModel()->isRowSelected(row - 1, view()->rootIndex())
!view()->selec...->rootIndex())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
219 && !view()->selectionModel()->isRowSelected(row + 1, view()->rootIndex())
!view()->selec...->rootIndex())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
220 view()->clearSelection();
never executed: view()->clearSelection();
0
221 break;
never executed: break;
0
222 default
never executed: default:
:
never executed: default:
0
223 break;
never executed: break;
0
224 }-
225-
226 view()->selectionModel()->select(index, QItemSelectionModel::Select | QItemSelectionModel::Rows);-
227 return
never executed: return true;
true;
never executed: return true;
0
228}-
229-
230bool QAccessibleTable::selectColumn(int column)-
231{-
232 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
|| !view()->selectionModel()
!view()->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
233 return
never executed: return false;
false;
never executed: return false;
0
234 QModelIndex index = view()->model()->index(0, column, view()->rootIndex());-
235-
236 if (!index.isValid()
!index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
|| view()->selectionBehavior() == QAbstractItemView::SelectRows
view()->select...ew::SelectRowsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
237 return
never executed: return false;
false;
never executed: return false;
0
238-
239 switch (view()->selectionMode()) {-
240 case
never executed: case QAbstractItemView::NoSelection:
QAbstractItemView::NoSelection:
never executed: case QAbstractItemView::NoSelection:
0
241 return
never executed: return false;
false;
never executed: return false;
0
242 case
never executed: case QAbstractItemView::SingleSelection:
QAbstractItemView::SingleSelection:
never executed: case QAbstractItemView::SingleSelection:
0
243 if (view()->selectionBehavior() != QAbstractItemView::SelectColumns
view()->select...:SelectColumnsDescription
TRUEnever evaluated
FALSEnever evaluated
&& rowCount() > 1
rowCount() > 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
244 return
never executed: return false;
false;
never executed: return false;
0
245 case
never executed: case QAbstractItemView::ContiguousSelection:
QAbstractItemView::ContiguousSelection:
never executed: case QAbstractItemView::ContiguousSelection:
code before this statement never executed: case QAbstractItemView::ContiguousSelection:
0
246 if ((!column
!columnDescription
TRUEnever evaluated
FALSEnever evaluated
|| !view()->selectionModel()->isColumnSelected(column - 1, view()->rootIndex())
!view()->selec...->rootIndex())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
247 && !view()->selectionModel()->isColumnSelected(column + 1, view()->rootIndex())
!view()->selec...->rootIndex())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
248 view()->clearSelection();
never executed: view()->clearSelection();
0
249 break;
never executed: break;
0
250 default
never executed: default:
:
never executed: default:
0
251 break;
never executed: break;
0
252 }-
253-
254 view()->selectionModel()->select(index, QItemSelectionModel::Select | QItemSelectionModel::Columns);-
255 return
never executed: return true;
true;
never executed: return true;
0
256}-
257-
258bool QAccessibleTable::unselectRow(int row)-
259{-
260 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
|| !view()->selectionModel()
!view()->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
261 return
never executed: return false;
false;
never executed: return false;
0
262-
263 QModelIndex index = view()->model()->index(row, 0, view()->rootIndex());-
264 if (!index.isValid()
!index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
265 return
never executed: return false;
false;
never executed: return false;
0
266-
267 QItemSelection selection(index, index);-
268-
269 switch (view()->selectionMode()) {-
270 case
never executed: case QAbstractItemView::SingleSelection:
QAbstractItemView::SingleSelection:
never executed: case QAbstractItemView::SingleSelection:
0
271-
272-
273 if (selectedRowCount() == 1
selectedRowCount() == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
274 return
never executed: return false;
false;
never executed: return false;
0
275 break;
never executed: break;
0
276 case
never executed: case QAbstractItemView::ContiguousSelection:
QAbstractItemView::ContiguousSelection:
never executed: case QAbstractItemView::ContiguousSelection:
0
277 if (selectedRowCount() == 1
selectedRowCount() == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
278 return
never executed: return false;
false;
never executed: return false;
0
279-
280 if ((!row
!rowDescription
TRUEnever evaluated
FALSEnever evaluated
|| view()->selectionModel()->isRowSelected(row - 1, view()->rootIndex())
view()->select...->rootIndex())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
281 && view()->selectionModel()->isRowSelected(row + 1, view()->rootIndex())
view()->select...->rootIndex())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
282-
283-
284 selection = QItemSelection(index, view()->model()->index(rowCount() - 1, 0, view()->rootIndex()));-
285 }
never executed: end of block
0
286 default
never executed: default:
:
never executed: default:
code before this statement never executed: default:
0
287 break;
never executed: break;
0
288 }-
289-
290 view()->selectionModel()->select(selection, QItemSelectionModel::Deselect | QItemSelectionModel::Rows);-
291 return
never executed: return true;
true;
never executed: return true;
0
292}-
293-
294bool QAccessibleTable::unselectColumn(int column)-
295{-
296 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
|| !view()->selectionModel()
!view()->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
297 return
never executed: return false;
false;
never executed: return false;
0
298-
299 QModelIndex index = view()->model()->index(0, column, view()->rootIndex());-
300 if (!index.isValid()
!index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
301 return
never executed: return false;
false;
never executed: return false;
0
302-
303 QItemSelection selection(index, index);-
304-
305 switch (view()->selectionMode()) {-
306 case
never executed: case QAbstractItemView::SingleSelection:
QAbstractItemView::SingleSelection:
never executed: case QAbstractItemView::SingleSelection:
0
307-
308-
309 if (selectedColumnCount() == 1
selectedColumnCount() == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
310 return
never executed: return false;
false;
never executed: return false;
0
311 break;
never executed: break;
0
312 case
never executed: case QAbstractItemView::ContiguousSelection:
QAbstractItemView::ContiguousSelection:
never executed: case QAbstractItemView::ContiguousSelection:
0
313 if (selectedColumnCount() == 1
selectedColumnCount() == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
314 return
never executed: return false;
false;
never executed: return false;
0
315-
316 if ((!column
!columnDescription
TRUEnever evaluated
FALSEnever evaluated
|| view()->selectionModel()->isColumnSelected(column - 1, view()->rootIndex())
view()->select...->rootIndex())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
317 && view()->selectionModel()->isColumnSelected(column + 1, view()->rootIndex())
view()->select...->rootIndex())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
318-
319-
320 selection = QItemSelection(index, view()->model()->index(0, columnCount() - 1, view()->rootIndex()));-
321 }
never executed: end of block
0
322 default
never executed: default:
:
never executed: default:
code before this statement never executed: default:
0
323 break;
never executed: break;
0
324 }-
325-
326 view()->selectionModel()->select(selection, QItemSelectionModel::Deselect | QItemSelectionModel::Columns);-
327 return
never executed: return true;
true;
never executed: return true;
0
328}-
329-
330QAccessible::Role QAccessibleTable::role() const-
331{-
332 return
never executed: return m_role;
m_role;
never executed: return m_role;
0
333}-
334-
335QAccessible::State QAccessibleTable::state() const-
336{-
337 return
never executed: return QAccessible::State();
QAccessible::State();
never executed: return QAccessible::State();
0
338}-
339-
340QAccessibleInterface *QAccessibleTable::childAt(int x, int y) const-
341{-
342 QPoint viewportOffset = view()->viewport()->mapTo(view(), QPoint(0,0));-
343 QPoint indexPosition = view()->mapFromGlobal(QPoint(x, y) - viewportOffset);-
344-
345-
346 QModelIndex index = view()->indexAt(indexPosition);-
347 if (index.isValid()
index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
348 return
never executed: return child(logicalIndex(index));
child(logicalIndex(index));
never executed: return child(logicalIndex(index));
0
349 }-
350 return
never executed: return 0;
0;
never executed: return 0;
0
351}-
352-
353int QAccessibleTable::childCount() const-
354{-
355 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
356 return
never executed: return 0;
0;
never executed: return 0;
0
357 int vHeader = verticalHeader()
verticalHeader()Description
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0;
0
358 int hHeader = horizontalHeader()
horizontalHeader()Description
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0;
0
359 return
never executed: return (view()->model()->rowCount()+hHeader) * (view()->model()->columnCount()+vHeader);
(view()->model()->rowCount()+hHeader) * (view()->model()->columnCount()+vHeader);
never executed: return (view()->model()->rowCount()+hHeader) * (view()->model()->columnCount()+vHeader);
0
360}-
361-
362int QAccessibleTable::indexOfChild(const QAccessibleInterface *iface) const-
363{-
364 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
365 return
never executed: return -1;
-1;
never executed: return -1;
0
366 QAccessibleInterface *parent = iface->parent();-
367 if (parent->object() != view()
parent->object() != view()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
368 return
never executed: return -1;
-1;
never executed: return -1;
0
369-
370 ((!(iface->role() != QAccessible::TreeItem)) ? qt_assert("iface->role() != QAccessible::TreeItem",__FILE__,429) : qt_noop());-
371 if (iface->role() == QAccessible::Cell
iface->role() ...cessible::CellDescription
TRUEnever evaluated
FALSEnever evaluated
|| iface->role() == QAccessible::ListItem
iface->role() ...ible::ListItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
372 const QAccessibleTableCell* cell = static_cast<const QAccessibleTableCell*>(iface);-
373 return
never executed: return logicalIndex(cell->m_index);
logicalIndex(cell->m_index);
never executed: return logicalIndex(cell->m_index);
0
374 } else if (iface->role() == QAccessible::ColumnHeader
iface->role() ...::ColumnHeaderDescription
TRUEnever evaluated
FALSEnever evaluated
){
0
375 const QAccessibleTableHeaderCell* cell = static_cast<const QAccessibleTableHeaderCell*>(iface);-
376 return
never executed: return cell->index + (verticalHeader() ? 1 : 0);
cell->index + (verticalHeader() ? 1 : 0);
never executed: return cell->index + (verticalHeader() ? 1 : 0);
0
377 } else if (iface->role() == QAccessible::RowHeader
iface->role() ...ble::RowHeaderDescription
TRUEnever evaluated
FALSEnever evaluated
){
0
378 const QAccessibleTableHeaderCell* cell = static_cast<const QAccessibleTableHeaderCell*>(iface);-
379 return
never executed: return (cell->index + 1) * (view()->model()->columnCount() + 1);
(cell->index + 1) * (view()->model()->columnCount() + 1);
never executed: return (cell->index + 1) * (view()->model()->columnCount() + 1);
0
380 } else if (iface->role() == QAccessible::Pane
iface->role() ...cessible::PaneDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
381 return
never executed: return 0;
0;
never executed: return 0;
0
382 } else {-
383 QMessageLogger(__FILE__, 442, __PRETTY_FUNCTION__).warning() << "WARNING QAccessibleTable::indexOfChild Fix my children..."-
384 << iface->role() << iface->text(QAccessible::Name);-
385 }
never executed: end of block
0
386-
387 return
never executed: return -1;
-1;
never executed: return -1;
0
388}-
389-
390QString QAccessibleTable::text(QAccessible::Text t) const-
391{-
392 if (t == QAccessible::Description
t == QAccessible::DescriptionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
393 return
never executed: return view()->accessibleDescription();
view()->accessibleDescription();
never executed: return view()->accessibleDescription();
0
394 return
never executed: return view()->accessibleName();
view()->accessibleName();
never executed: return view()->accessibleName();
0
395}-
396-
397QRect QAccessibleTable::rect() const-
398{-
399 if (!view()->isVisible()
!view()->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
400 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
401 QPoint pos = view()->mapToGlobal(QPoint(0, 0));-
402 return
never executed: return QRect(pos.x(), pos.y(), view()->width(), view()->height());
QRect(pos.x(), pos.y(), view()->width(), view()->height());
never executed: return QRect(pos.x(), pos.y(), view()->width(), view()->height());
0
403}-
404-
405QAccessibleInterface *QAccessibleTable::parent() const-
406{-
407 if (view()
view()Description
TRUEnever evaluated
FALSEnever evaluated
&& view()->parent()
view()->parent()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
408 if (qstrcmp("QComboBoxPrivateContainer", view()->parent()->metaObject()->className()) == 0
qstrcmp("QComb...ssName()) == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
409 return
never executed: return QAccessible::queryAccessibleInterface(view()->parent()->parent());
QAccessible::queryAccessibleInterface(view()->parent()->parent());
never executed: return QAccessible::queryAccessibleInterface(view()->parent()->parent());
0
410 }-
411 return
never executed: return QAccessible::queryAccessibleInterface(view()->parent());
QAccessible::queryAccessibleInterface(view()->parent());
never executed: return QAccessible::queryAccessibleInterface(view()->parent());
0
412 }-
413 return
never executed: return 0;
0;
never executed: return 0;
0
414}-
415-
416QAccessibleInterface *QAccessibleTable::child(int logicalIndex) const-
417{-
418 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
419 return
never executed: return 0;
0;
never executed: return 0;
0
420-
421 if (childToId.contains(logicalIndex)
childToId.cont...(logicalIndex)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
422 QAccessible::Id id = childToId.value(logicalIndex);-
423 return
never executed: return QAccessible::accessibleInterface(id);
QAccessible::accessibleInterface(id);
never executed: return QAccessible::accessibleInterface(id);
0
424 }-
425-
426 int vHeader = verticalHeader()
verticalHeader()Description
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0;
0
427 int hHeader = horizontalHeader()
horizontalHeader()Description
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0;
0
428-
429 int columns = view()->model()->columnCount() + vHeader;-
430-
431 int row = logicalIndex / columns;-
432 int column = logicalIndex % columns;-
433-
434 QAccessibleInterface *iface = 0;-
435-
436 if (vHeader
vHeaderDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
437 if (column == 0
column == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
438 if (hHeader
hHeaderDescription
TRUEnever evaluated
FALSEnever evaluated
&& row == 0
row == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
439 iface = new QAccessibleTableCornerButton(view());-
440 }
never executed: end of block
else {
0
441 iface = new QAccessibleTableHeaderCell(view(), row - hHeader, Qt::Vertical);-
442 }
never executed: end of block
0
443 }-
444 --column;-
445 }
never executed: end of block
0
446 if (!iface
!ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
&& hHeader
hHeaderDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
447 if (row == 0
row == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
448 iface = new QAccessibleTableHeaderCell(view(), column, Qt::Horizontal);-
449 }
never executed: end of block
0
450 --row;-
451 }
never executed: end of block
0
452-
453 if (!iface
!ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
454 QModelIndex index = view()->model()->index(row, column, view()->rootIndex());-
455 if (__builtin_expect(!!(!index.isValid()), false)
__builtin_expe...lid()), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
456 QMessageLogger(__FILE__, 515, __PRETTY_FUNCTION__).warning() << "QAccessibleTable::child: Invalid index at: " << row << column;-
457 return
never executed: return 0;
0;
never executed: return 0;
0
458 }-
459 iface = new QAccessibleTableCell(view(), index, cellRole());-
460 }
never executed: end of block
0
461-
462 QAccessible::registerAccessibleInterface(iface);-
463 childToId.insert(logicalIndex, QAccessible::uniqueId(iface));-
464 return
never executed: return iface;
iface;
never executed: return iface;
0
465}-
466-
467void *QAccessibleTable::interface_cast(QAccessible::InterfaceType t)-
468{-
469 if (t == QAccessible::TableInterface
t == QAccessib...TableInterfaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
470 return
never executed: return static_cast<QAccessibleTableInterface*>(this);
static_cast<QAccessibleTableInterface*>(this);
never executed: return static_cast<QAccessibleTableInterface*>(this);
0
471 return
never executed: return 0;
0;
never executed: return 0;
0
472}-
473-
474void QAccessibleTable::modelChange(QAccessibleTableModelChangeEvent *event)-
475{-
476-
477 if (childToId.isEmpty()
childToId.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
478 return;
never executed: return;
0
479-
480 switch (event->modelChangeType()) {-
481 case
never executed: case QAccessibleTableModelChangeEvent::ModelReset:
QAccessibleTableModelChangeEvent::ModelReset:
never executed: case QAccessibleTableModelChangeEvent::ModelReset:
0
482 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(childToId)>::type> _container_((childToId)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QAccessible::Id id = *_container_.i; _container_.control; _container_.control = 0)-
483 QAccessible::deleteAccessibleInterface(id);
never executed: QAccessible::deleteAccessibleInterface(id);
0
484 childToId.clear();-
485 break;
never executed: break;
0
486-
487-
488 case
never executed: case QAccessibleTableModelChangeEvent::RowsInserted:
QAccessibleTableModelChangeEvent::RowsInserted:
never executed: case QAccessibleTableModelChangeEvent::RowsInserted:
0
489 case
never executed: case QAccessibleTableModelChangeEvent::ColumnsInserted:
QAccessibleTableModelChangeEvent::ColumnsInserted:
never executed: case QAccessibleTableModelChangeEvent::ColumnsInserted:
{
0
490 int newRows = event->lastRow() - event->firstRow() + 1;-
491 int newColumns = event->lastColumn() - event->firstColumn() + 1;-
492-
493 ChildCache newCache;-
494 ChildCache::ConstIterator iter = childToId.constBegin();-
495-
496 while (iter != childToId.constEnd()
iter != childToId.constEnd()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
497 QAccessible::Id id = iter.value();-
498 QAccessibleInterface *iface = QAccessible::accessibleInterface(id);-
499 ((!(iface)) ? qt_assert("iface",__FILE__,558) : qt_noop());-
500 if (event->modelChangeType() == QAccessibleTableModelChangeEvent::RowsInserted
event->modelCh...::RowsInsertedDescription
TRUEnever evaluated
FALSEnever evaluated
0
501 && iface->role() == QAccessible::RowHeader
iface->role() ...ble::RowHeaderDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
502 QAccessibleTableHeaderCell *cell = static_cast<QAccessibleTableHeaderCell*>(iface);-
503 if (cell->index >= event->firstRow()
cell->index >=...nt->firstRow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
504 cell->index += newRows;-
505 }
never executed: end of block
0
506 }
never executed: end of block
else if (event->modelChangeType() == QAccessibleTableModelChangeEvent::ColumnsInserted
event->modelCh...olumnsInsertedDescription
TRUEnever evaluated
FALSEnever evaluated
0
507 && iface->role() == QAccessible::ColumnHeader
iface->role() ...::ColumnHeaderDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
508 QAccessibleTableHeaderCell *cell = static_cast<QAccessibleTableHeaderCell*>(iface);-
509 if (cell->index >= event->firstColumn()
cell->index >=...>firstColumn()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
510 cell->index += newColumns;-
511 }
never executed: end of block
0
512 }
never executed: end of block
0
513 if (indexOfChild(iface) >= 0
indexOfChild(iface) >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
514 newCache.insert(indexOfChild(iface), id);-
515 }
never executed: end of block
else {
0
516-
517-
518-
519 QAccessible::deleteAccessibleInterface(id);-
520 }
never executed: end of block
0
521 ++iter;-
522 }
never executed: end of block
0
523 childToId = newCache;-
524 break;
never executed: break;
0
525 }-
526-
527 case
never executed: case QAccessibleTableModelChangeEvent::ColumnsRemoved:
QAccessibleTableModelChangeEvent::ColumnsRemoved:
never executed: case QAccessibleTableModelChangeEvent::ColumnsRemoved:
0
528 case
never executed: case QAccessibleTableModelChangeEvent::RowsRemoved:
QAccessibleTableModelChangeEvent::RowsRemoved:
never executed: case QAccessibleTableModelChangeEvent::RowsRemoved:
{
0
529 int deletedColumns = event->lastColumn() - event->firstColumn() + 1;-
530 int deletedRows = event->lastRow() - event->firstRow() + 1;-
531 ChildCache newCache;-
532 ChildCache::ConstIterator iter = childToId.constBegin();-
533 while (iter != childToId.constEnd()
iter != childToId.constEnd()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
534 QAccessible::Id id = iter.value();-
535 QAccessibleInterface *iface = QAccessible::accessibleInterface(id);-
536 ((!(iface)) ? qt_assert("iface",__FILE__,595) : qt_noop());-
537 if (iface->role() == QAccessible::Cell
iface->role() ...cessible::CellDescription
TRUEnever evaluated
FALSEnever evaluated
|| iface->role() == QAccessible::ListItem
iface->role() ...ible::ListItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
538 ((!(iface->tableCellInterface())) ? qt_assert("iface->tableCellInterface()",__FILE__,597) : qt_noop());-
539 QAccessibleTableCell *cell = static_cast<QAccessibleTableCell*>(iface->tableCellInterface());-
540-
541 if (cell->m_index.isValid()
cell->m_index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
542 newCache.insert(indexOfChild(cell), id);
never executed: newCache.insert(indexOfChild(cell), id);
0
543 else-
544 QAccessible::deleteAccessibleInterface(id);
never executed: QAccessible::deleteAccessibleInterface(id);
0
545 } else if (event->modelChangeType() == QAccessibleTableModelChangeEvent::RowsRemoved
event->modelCh...t::RowsRemovedDescription
TRUEnever evaluated
FALSEnever evaluated
0
546 && iface->role() == QAccessible::RowHeader
iface->role() ...ble::RowHeaderDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
547 QAccessibleTableHeaderCell *cell = static_cast<QAccessibleTableHeaderCell*>(iface);-
548 if (cell->index < event->firstRow()
cell->index < ...nt->firstRow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
549 newCache.insert(indexOfChild(cell), id);-
550 }
never executed: end of block
else if (cell->index > event->lastRow()
cell->index > event->lastRow()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
551 cell->index -= deletedRows;-
552 newCache.insert(indexOfChild(cell), id);-
553 }
never executed: end of block
else {
0
554 QAccessible::deleteAccessibleInterface(id);-
555 }
never executed: end of block
0
556 } else if (event->modelChangeType() == QAccessibleTableModelChangeEvent::ColumnsRemoved
event->modelCh...ColumnsRemovedDescription
TRUEnever evaluated
FALSEnever evaluated
0
557 && iface->role() == QAccessible::ColumnHeader
iface->role() ...::ColumnHeaderDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
558 QAccessibleTableHeaderCell *cell = static_cast<QAccessibleTableHeaderCell*>(iface);-
559 if (cell->index < event->firstColumn()
cell->index < ...>firstColumn()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
560 newCache.insert(indexOfChild(cell), id);-
561 }
never executed: end of block
else if (cell->index > event->lastColumn()
cell->index > ...->lastColumn()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
562 cell->index -= deletedColumns;-
563 newCache.insert(indexOfChild(cell), id);-
564 }
never executed: end of block
else {
0
565 QAccessible::deleteAccessibleInterface(id);-
566 }
never executed: end of block
0
567 }-
568 ++iter;-
569 }
never executed: end of block
0
570 childToId = newCache;-
571 break;
never executed: break;
0
572 }-
573-
574 case
never executed: case QAccessibleTableModelChangeEvent::DataChanged:
QAccessibleTableModelChangeEvent::DataChanged:
never executed: case QAccessibleTableModelChangeEvent::DataChanged:
0
575-
576 break;
never executed: break;
0
577 }-
578}
never executed: end of block
0
579-
580-
581-
582QModelIndex QAccessibleTree::indexFromLogical(int row, int column) const-
583{-
584 if (!isValid()
!isValid()Description
TRUEnever evaluated
FALSEnever evaluated
|| !view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
585 return
never executed: return QModelIndex();
QModelIndex();
never executed: return QModelIndex();
0
586-
587 const QTreeView *treeView = qobject_cast<const QTreeView*>(view());-
588 if (__builtin_expect(!!(row < 0 || column < 0 || treeView->d_func()->viewItems.count() <= row), false)
__builtin_expe...= row), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
589 QMessageLogger(__FILE__, 648, __PRETTY_FUNCTION__).warning() << "QAccessibleTree::indexFromLogical: invalid index: " << row << column << " for " << treeView;-
590 return
never executed: return QModelIndex();
QModelIndex();
never executed: return QModelIndex();
0
591 }-
592 QModelIndex modelIndex = treeView->d_func()->viewItems.at(row).index;-
593-
594 if (modelIndex.isValid()
modelIndex.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
&& column > 0
column > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
595 modelIndex = view()->model()->index(modelIndex.row(), column, modelIndex.parent());-
596 }
never executed: end of block
0
597 return
never executed: return modelIndex;
modelIndex;
never executed: return modelIndex;
0
598}-
599-
600QAccessibleInterface *QAccessibleTree::childAt(int x, int y) const-
601{-
602 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
603 return
never executed: return 0;
0;
never executed: return 0;
0
604 QPoint viewportOffset = view()->viewport()->mapTo(view(), QPoint(0,0));-
605 QPoint indexPosition = view()->mapFromGlobal(QPoint(x, y) - viewportOffset);-
606-
607 QModelIndex index = view()->indexAt(indexPosition);-
608 if (!index.isValid()
!index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
609 return
never executed: return 0;
0;
never executed: return 0;
0
610-
611 const QTreeView *treeView = qobject_cast<const QTreeView*>(view());-
612 int row = treeView->d_func()->viewIndex(index) + (horizontalHeader()
horizontalHeader()Description
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0);
0
613 int column = index.column();-
614-
615 int i = row * view()->model()->columnCount() + column;-
616 return
never executed: return child(i);
child(i);
never executed: return child(i);
0
617}-
618-
619int QAccessibleTree::childCount() const-
620{-
621 const QTreeView *treeView = qobject_cast<const QTreeView*>(view());-
622 ((!(treeView)) ? qt_assert("treeView",__FILE__,681) : qt_noop());-
623 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
624 return
never executed: return 0;
0;
never executed: return 0;
0
625-
626 int hHeader = horizontalHeader()
horizontalHeader()Description
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0;
0
627 return
never executed: return (treeView->d_func()->viewItems.count() + hHeader)* view()->model()->columnCount();
(treeView->d_func()->viewItems.count() + hHeader)* view()->model()->columnCount();
never executed: return (treeView->d_func()->viewItems.count() + hHeader)* view()->model()->columnCount();
0
628}-
629-
630-
631QAccessibleInterface *QAccessibleTree::child(int logicalIndex) const-
632{-
633 if (logicalIndex < 0
logicalIndex < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| !view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
|| !view()->model()->columnCount()
!view()->model...>columnCount()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
634 return
never executed: return 0;
0;
never executed: return 0;
0
635-
636 QAccessibleInterface *iface = 0;-
637 int index = logicalIndex;-
638-
639 if (horizontalHeader()
horizontalHeader()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
640 if (index < view()->model()->columnCount()
index < view()...>columnCount()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
641 iface = new QAccessibleTableHeaderCell(view(), index, Qt::Horizontal);-
642 }
never executed: end of block
else {
0
643 index -= view()->model()->columnCount();-
644 }
never executed: end of block
0
645 }-
646-
647 if (!iface
!ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
648 int row = index / view()->model()->columnCount();-
649 int column = index % view()->model()->columnCount();-
650 QModelIndex modelIndex = indexFromLogical(row, column);-
651 if (!modelIndex.isValid()
!modelIndex.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
652 return
never executed: return 0;
0;
never executed: return 0;
0
653 iface = new QAccessibleTableCell(view(), modelIndex, cellRole());-
654 }
never executed: end of block
0
655 QAccessible::registerAccessibleInterface(iface);-
656-
657 return
never executed: return iface;
iface;
never executed: return iface;
0
658}-
659-
660int QAccessibleTree::rowCount() const-
661{-
662 const QTreeView *treeView = qobject_cast<const QTreeView*>(view());-
663 ((!(treeView)) ? qt_assert("treeView",__FILE__,722) : qt_noop());-
664 return
never executed: return treeView->d_func()->viewItems.count();
treeView->d_func()->viewItems.count();
never executed: return treeView->d_func()->viewItems.count();
0
665}-
666-
667int QAccessibleTree::indexOfChild(const QAccessibleInterface *iface) const-
668{-
669 if (!view()->model()
!view()->model()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
670 return
never executed: return -1;
-1;
never executed: return -1;
0
671 QAccessibleInterface *parent = iface->parent();-
672 if (parent->object() != view()
parent->object() != view()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
673 return
never executed: return -1;
-1;
never executed: return -1;
0
674-
675 if (iface->role() == QAccessible::TreeItem
iface->role() ...ible::TreeItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
676 const QAccessibleTableCell* cell = static_cast<const QAccessibleTableCell*>(iface);-
677 const QTreeView *treeView = qobject_cast<const QTreeView*>(view());-
678 ((!(treeView)) ? qt_assert("treeView",__FILE__,737) : qt_noop());-
679 int row = treeView->d_func()->viewIndex(cell->m_index) + (horizontalHeader()
horizontalHeader()Description
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0);
0
680 int column = cell->m_index.column();-
681-
682 int index = row * view()->model()->columnCount() + column;-
683 return
never executed: return index;
index;
never executed: return index;
0
684 } else if (iface->role() == QAccessible::ColumnHeader
iface->role() ...::ColumnHeaderDescription
TRUEnever evaluated
FALSEnever evaluated
){
0
685 const QAccessibleTableHeaderCell* cell = static_cast<const QAccessibleTableHeaderCell*>(iface);-
686 return
never executed: return cell->index;
cell->index;
never executed: return cell->index;
0
687 } else {-
688 QMessageLogger(__FILE__, 747, __PRETTY_FUNCTION__).warning() << "WARNING QAccessibleTable::indexOfChild invalid child"-
689 << iface->role() << iface->text(QAccessible::Name);-
690 }
never executed: end of block
0
691-
692 return
never executed: return -1;
-1;
never executed: return -1;
0
693}-
694-
695QAccessibleInterface *QAccessibleTree::cellAt(int row, int column) const-
696{-
697 QModelIndex index = indexFromLogical(row, column);-
698 if (__builtin_expect(!!(!index.isValid()), false)
__builtin_expe...lid()), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
699 QMessageLogger(__FILE__, 758, __PRETTY_FUNCTION__).warning() << "Requested invalid tree cell: " << row << column;-
700 return
never executed: return 0;
0;
never executed: return 0;
0
701 }-
702 const QTreeView *treeView = qobject_cast<const QTreeView*>(view());-
703 ((!(treeView)) ? qt_assert("treeView",__FILE__,762) : qt_noop());-
704 int logicalIndex = treeView->d_func()->accessibleTable2Index(index);-
705-
706 return
never executed: return child(logicalIndex);
child(logicalIndex);
never executed: return child(logicalIndex);
0
707}-
708-
709QString QAccessibleTree::rowDescription(int) const-
710{-
711 return
never executed: return QString();
QString();
never executed: return QString();
0
712}-
713-
714bool QAccessibleTree::isRowSelected(int row) const-
715{-
716 if (!view()->selectionModel()
!view()->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
717 return
never executed: return false;
false;
never executed: return false;
0
718 QModelIndex index = indexFromLogical(row);-
719 return
never executed: return view()->selectionModel()->isRowSelected(index.row(), index.parent());
view()->selectionModel()->isRowSelected(index.row(), index.parent());
never executed: return view()->selectionModel()->isRowSelected(index.row(), index.parent());
0
720}-
721-
722bool QAccessibleTree::selectRow(int row)-
723{-
724 if (!view()->selectionModel()
!view()->selectionModel()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
725 return
never executed: return false;
false;
never executed: return false;
0
726 QModelIndex index = indexFromLogical(row);-
727-
728 if (!index.isValid()
!index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
|| view()->selectionBehavior() == QAbstractItemView::SelectColumns
view()->select...:SelectColumnsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
729 return
never executed: return false;
false;
never executed: return false;
0
730-
731 switch (view()->selectionMode()) {-
732 case
never executed: case QAbstractItemView::NoSelection:
QAbstractItemView::NoSelection:
never executed: case QAbstractItemView::NoSelection:
0
733 return
never executed: return false;
false;
never executed: return false;
0
734 case
never executed: case QAbstractItemView::SingleSelection:
QAbstractItemView::SingleSelection:
never executed: case QAbstractItemView::SingleSelection:
0
735 if ((
(view()->selec...w::SelectRows)Description
TRUEnever evaluated
FALSEnever evaluated
view()->selectionBehavior() != QAbstractItemView::SelectRows)
(view()->selec...w::SelectRows)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(columnCount() > 1)Description
TRUEnever evaluated
FALSEnever evaluated
columnCount() > 1)
(columnCount() > 1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
736 return
never executed: return false;
false;
never executed: return false;
0
737 view()->clearSelection();-
738 break;
never executed: break;
0
739 case
never executed: case QAbstractItemView::ContiguousSelection:
QAbstractItemView::ContiguousSelection:
never executed: case QAbstractItemView::ContiguousSelection:
0
740 if ((!row
!rowDescription
TRUEnever evaluated
FALSEnever evaluated
|| !view()->selectionModel()->isRowSelected(row - 1, view()->rootIndex())
!view()->selec...->rootIndex())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
741 && !view()->selectionModel()->isRowSelected(row + 1, view()->rootIndex())
!view()->selec...->rootIndex())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
742 view()->clearSelection();
never executed: view()->clearSelection();
0
743 break;
never executed: break;
0
744 default
never executed: default:
:
never executed: default:
0
745 break;
never executed: break;
0
746 }-
747-
748 view()->selectionModel()->select(index, QItemSelectionModel::Select | QItemSelectionModel::Rows);-
749 return
never executed: return true;
true;
never executed: return true;
0
750}-
751-
752-
753-
754QAccessibleTableCell::QAccessibleTableCell(QAbstractItemView *view_, const QModelIndex &index_, QAccessible::Role role_)-
755 : view(view_), m_index(index_), m_role(role_)-
756{-
757 if (__builtin_expect(!!(!index_.isValid()), false)
__builtin_expe...lid()), false)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
758 QMessageLogger(__FILE__, 817, __PRETTY_FUNCTION__).warning() << "QAccessibleTableCell::QAccessibleTableCell with invalid index: " << index_;
never executed: QMessageLogger(__FILE__, 817, __PRETTY_FUNCTION__).warning() << "QAccessibleTableCell::QAccessibleTableCell with invalid index: " << index_;
0
759}
never executed: end of block
0
760-
761void *QAccessibleTableCell::interface_cast(QAccessible::InterfaceType t)-
762{-
763 if (t == QAccessible::TableCellInterface
t == QAccessib...eCellInterfaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
764 return
never executed: return static_cast<QAccessibleTableCellInterface*>(this);
static_cast<QAccessibleTableCellInterface*>(this);
never executed: return static_cast<QAccessibleTableCellInterface*>(this);
0
765 if (t == QAccessible::ActionInterface
t == QAccessib...ctionInterfaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
766 return
never executed: return static_cast<QAccessibleActionInterface*>(this);
static_cast<QAccessibleActionInterface*>(this);
never executed: return static_cast<QAccessibleActionInterface*>(this);
0
767 return
never executed: return 0;
0;
never executed: return 0;
0
768}-
769-
770int QAccessibleTableCell::columnExtent() const { return
never executed: return 1;
1;
never executed: return 1;
}
0
771int QAccessibleTableCell::rowExtent() const { return
never executed: return 1;
1;
never executed: return 1;
}
0
772-
773QList<QAccessibleInterface*> QAccessibleTableCell::rowHeaderCells() const-
774{-
775 QList<QAccessibleInterface*> headerCell;-
776 if (verticalHeader()
verticalHeader()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
777-
778 headerCell.append(new QAccessibleTableHeaderCell(view, m_index.row(), Qt::Vertical));-
779 }
never executed: end of block
0
780 return
never executed: return headerCell;
headerCell;
never executed: return headerCell;
0
781}-
782-
783QList<QAccessibleInterface*> QAccessibleTableCell::columnHeaderCells() const-
784{-
785 QList<QAccessibleInterface*> headerCell;-
786 if (horizontalHeader()
horizontalHeader()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
787-
788 headerCell.append(new QAccessibleTableHeaderCell(view, m_index.column(), Qt::Horizontal));-
789 }
never executed: end of block
0
790 return
never executed: return headerCell;
headerCell;
never executed: return headerCell;
0
791}-
792-
793QHeaderView *QAccessibleTableCell::horizontalHeader() const-
794{-
795 QHeaderView *header = 0;-
796-
797 if (false) {
dead code: { }
-
798-
799 }
dead code: { }
else if (const
const QTableVi...leView*>(view)Description
TRUEnever evaluated
FALSEnever evaluated
QTableView *tv = qobject_cast<const QTableView*>(view)
const QTableVi...leView*>(view)Description
TRUEnever evaluated
FALSEnever evaluated
) {
-
800 header = tv->horizontalHeader();-
801-
802-
803 }
never executed: end of block
else if (const
const QTreeVie...eeView*>(view)Description
TRUEnever evaluated
FALSEnever evaluated
QTreeView *tv = qobject_cast<const QTreeView*>(view)
const QTreeVie...eeView*>(view)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
804 header = tv->header();-
805-
806 }
never executed: end of block
0
807-
808 return
never executed: return header;
header;
never executed: return header;
0
809}-
810-
811QHeaderView *QAccessibleTableCell::verticalHeader() const-
812{-
813 QHeaderView *header = 0;-
814-
815 if (const
const QTableVi...leView*>(view)Description
TRUEnever evaluated
FALSEnever evaluated
QTableView *tv = qobject_cast<const QTableView*>(view)
const QTableVi...leView*>(view)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
816 header = tv->verticalHeader();
never executed: header = tv->verticalHeader();
0
817-
818 return
never executed: return header;
header;
never executed: return header;
0
819}-
820-
821int QAccessibleTableCell::columnIndex() const-
822{-
823 return
never executed: return m_index.column();
m_index.column();
never executed: return m_index.column();
0
824}-
825-
826int QAccessibleTableCell::rowIndex() const-
827{-
828 if (role() == QAccessible::TreeItem
role() == QAcc...ible::TreeItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
829 const QTreeView *treeView = qobject_cast<const QTreeView*>(view);-
830 ((!(treeView)) ? qt_assert("treeView",__FILE__,889) : qt_noop());-
831 int row = treeView->d_func()->viewIndex(m_index);-
832 return
never executed: return row;
row;
never executed: return row;
0
833 }-
834 return
never executed: return m_index.row();
m_index.row();
never executed: return m_index.row();
0
835}-
836-
837bool QAccessibleTableCell::isSelected() const-
838{-
839 return
never executed: return view->selectionModel()->isSelected(m_index);
view->selectionModel()->isSelected(m_index);
never executed: return view->selectionModel()->isSelected(m_index);
0
840}-
841-
842QStringList QAccessibleTableCell::actionNames() const-
843{-
844 QStringList names;-
845 names << toggleAction();-
846 return
never executed: return names;
names;
never executed: return names;
0
847}-
848-
849void QAccessibleTableCell::doAction(const QString& actionName)-
850{-
851 if (actionName == toggleAction()
actionName == toggleAction()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
852 if (isSelected()
isSelected()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
853 unselectCell();
never executed: unselectCell();
0
854 else-
855 selectCell();
never executed: selectCell();
0
856 }-
857}
never executed: end of block
0
858-
859QStringList QAccessibleTableCell::keyBindingsForAction(const QString &) const-
860{-
861 return
never executed: return QStringList();
QStringList();
never executed: return QStringList();
0
862}-
863-
864-
865void QAccessibleTableCell::selectCell()-
866{-
867 QAbstractItemView::SelectionMode selectionMode = view->selectionMode();-
868 if (!m_index.isValid()
!m_index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(selectionMode...::NoSelection)Description
TRUEnever evaluated
FALSEnever evaluated
selectionMode == QAbstractItemView::NoSelection)
(selectionMode...::NoSelection)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
869 return;
never executed: return;
0
870 ((!(table())) ? qt_assert("table()",__FILE__,929) : qt_noop());-
871 QAccessibleTableInterface *cellTable = table()->tableInterface();-
872-
873 switch (view->selectionBehavior()) {-
874 case
never executed: case QAbstractItemView::SelectItems:
QAbstractItemView::SelectItems:
never executed: case QAbstractItemView::SelectItems:
0
875 break;
never executed: break;
0
876 case
never executed: case QAbstractItemView::SelectColumns:
QAbstractItemView::SelectColumns:
never executed: case QAbstractItemView::SelectColumns:
0
877 if (cellTable
cellTableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
878 cellTable->selectColumn(m_index.column());
never executed: cellTable->selectColumn(m_index.column());
0
879 return;
never executed: return;
0
880 case
never executed: case QAbstractItemView::SelectRows:
QAbstractItemView::SelectRows:
never executed: case QAbstractItemView::SelectRows:
0
881 if (cellTable
cellTableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
882 cellTable->selectRow(m_index.row());
never executed: cellTable->selectRow(m_index.row());
0
883 return;
never executed: return;
0
884 }-
885-
886 if (selectionMode == QAbstractItemView::SingleSelection
selectionMode ...ingleSelectionDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
887 view->clearSelection();-
888 }
never executed: end of block
0
889-
890 view->selectionModel()->select(m_index, QItemSelectionModel::Select);-
891}
never executed: end of block
0
892-
893void QAccessibleTableCell::unselectCell()-
894{-
895-
896 QAbstractItemView::SelectionMode selectionMode = view->selectionMode();-
897 if (!m_index.isValid()
!m_index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(selectionMode...::NoSelection)Description
TRUEnever evaluated
FALSEnever evaluated
selectionMode & QAbstractItemView::NoSelection)
(selectionMode...::NoSelection)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
898 return;
never executed: return;
0
899-
900 QAccessibleTableInterface *cellTable = table()->tableInterface();-
901-
902 switch (view->selectionBehavior()) {-
903 case
never executed: case QAbstractItemView::SelectItems:
QAbstractItemView::SelectItems:
never executed: case QAbstractItemView::SelectItems:
0
904 break;
never executed: break;
0
905 case
never executed: case QAbstractItemView::SelectColumns:
QAbstractItemView::SelectColumns:
never executed: case QAbstractItemView::SelectColumns:
0
906 if (cellTable
cellTableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
907 cellTable->unselectColumn(m_index.column());
never executed: cellTable->unselectColumn(m_index.column());
0
908 return;
never executed: return;
0
909 case
never executed: case QAbstractItemView::SelectRows:
QAbstractItemView::SelectRows:
never executed: case QAbstractItemView::SelectRows:
0
910 if (cellTable
cellTableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
911 cellTable->unselectRow(m_index.row());
never executed: cellTable->unselectRow(m_index.row());
0
912 return;
never executed: return;
0
913 }-
914-
915-
916-
917 if ((
(selectionMode...ultiSelection)Description
TRUEnever evaluated
FALSEnever evaluated
selectionMode != QAbstractItemView::MultiSelection)
(selectionMode...ultiSelection)Description
TRUEnever evaluated
FALSEnever evaluated
0
918 && (
(selectionMode...ndedSelection)Description
TRUEnever evaluated
FALSEnever evaluated
selectionMode != QAbstractItemView::ExtendedSelection)
(selectionMode...ndedSelection)Description
TRUEnever evaluated
FALSEnever evaluated
0
919 && (
(view->selecti....count() <= 1)Description
TRUEnever evaluated
FALSEnever evaluated
view->selectionModel()->selectedIndexes().count() <= 1)
(view->selecti....count() <= 1)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
920 return;
never executed: return;
0
921-
922 view->selectionModel()->select(m_index, QItemSelectionModel::Deselect);-
923}
never executed: end of block
0
924-
925QAccessibleInterface *QAccessibleTableCell::table() const-
926{-
927 return
never executed: return QAccessible::queryAccessibleInterface(view);
QAccessible::queryAccessibleInterface(view);
never executed: return QAccessible::queryAccessibleInterface(view);
0
928}-
929-
930QAccessible::Role QAccessibleTableCell::role() const-
931{-
932 return
never executed: return m_role;
m_role;
never executed: return m_role;
0
933}-
934-
935QAccessible::State QAccessibleTableCell::state() const-
936{-
937 QAccessible::State st;-
938 if (!view
!viewDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
939 return
never executed: return st;
st;
never executed: return st;
0
940-
941 QRect globalRect = view->rect();-
942 globalRect.translate(view->mapToGlobal(QPoint(0,0)));-
943 if (!globalRect.intersects(rect())
!globalRect.intersects(rect())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
944 st.invisible = true;
never executed: st.invisible = true;
0
945-
946 if (view->selectionModel()->isSelected(m_index)
view->selectio...ected(m_index)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
947 st.selected = true;
never executed: st.selected = true;
0
948 if (view->selectionModel()->currentIndex() == m_index
view->selectio...x() == m_indexDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
949 st.focused = true;
never executed: st.focused = true;
0
950 if (m_index.model()->data(m_index, Qt::CheckStateRole).toInt() == Qt::Checked
m_index.model(...== Qt::CheckedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
951 st.checked = true;
never executed: st.checked = true;
0
952-
953 Qt::ItemFlags flags = m_index.flags();-
954 if (flags & Qt::ItemIsSelectable
flags & Qt::ItemIsSelectableDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
955 st.selectable = true;-
956 st.focusable = true;-
957 if (view->selectionMode() == QAbstractItemView::MultiSelection
view->selectio...MultiSelectionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
958 st.multiSelectable = true;
never executed: st.multiSelectable = true;
0
959 if (view->selectionMode() == QAbstractItemView::ExtendedSelection
view->selectio...endedSelectionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
960 st.extSelectable = true;
never executed: st.extSelectable = true;
0
961 }
never executed: end of block
0
962 if (m_role == QAccessible::TreeItem
m_role == QAcc...ible::TreeItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
963 const QTreeView *treeView = qobject_cast<const QTreeView*>(view);-
964 if (treeView->model()->hasChildren(m_index)
treeView->mode...ldren(m_index)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
965 st.expandable = true;
never executed: st.expandable = true;
0
966 if (treeView->isExpanded(m_index)
treeView->isExpanded(m_index)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
967 st.expanded = true;
never executed: st.expanded = true;
0
968 }
never executed: end of block
0
969 return
never executed: return st;
st;
never executed: return st;
0
970}-
971-
972-
973QRect QAccessibleTableCell::rect() const-
974{-
975 QRect r;-
976 r = view->visualRect(m_index);-
977-
978 if (!r.isNull()
!r.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
979 r.translate(view->viewport()->mapTo(view, QPoint(0,0)));-
980 r.translate(view->mapToGlobal(QPoint(0, 0)));-
981 }
never executed: end of block
0
982 return
never executed: return r;
r;
never executed: return r;
0
983}-
984-
985QString QAccessibleTableCell::text(QAccessible::Text t) const-
986{-
987 QAbstractItemModel *model = view->model();-
988 QString value;-
989 switch (t) {-
990 case
never executed: case QAccessible::Name:
QAccessible::Name:
never executed: case QAccessible::Name:
0
991 value = model->data(m_index, Qt::AccessibleTextRole).toString();-
992 if (value.isEmpty()
value.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
993 value = model->data(m_index, Qt::DisplayRole).toString();
never executed: value = model->data(m_index, Qt::DisplayRole).toString();
0
994 break;
never executed: break;
0
995 case
never executed: case QAccessible::Description:
QAccessible::Description:
never executed: case QAccessible::Description:
0
996 value = model->data(m_index, Qt::AccessibleDescriptionRole).toString();-
997 break;
never executed: break;
0
998 default
never executed: default:
:
never executed: default:
0
999 break;
never executed: break;
0
1000 }-
1001 return
never executed: return value;
value;
never executed: return value;
0
1002}-
1003-
1004void QAccessibleTableCell::setText(QAccessible::Text , const QString &text)-
1005{-
1006 if (!(m_index.flags() & Qt::ItemIsEditable)
!(m_index.flag...temIsEditable)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1007 return;
never executed: return;
0
1008 view->model()->setData(m_index, text);-
1009}
never executed: end of block
0
1010-
1011bool QAccessibleTableCell::isValid() const-
1012{-
1013 return
never executed: return view && view->model() && m_index.isValid();
view && view->model() && m_index.isValid();
never executed: return view && view->model() && m_index.isValid();
0
1014}-
1015-
1016QAccessibleInterface *QAccessibleTableCell::parent() const-
1017{-
1018 return
never executed: return QAccessible::queryAccessibleInterface(view);
QAccessible::queryAccessibleInterface(view);
never executed: return QAccessible::queryAccessibleInterface(view);
0
1019}-
1020-
1021QAccessibleInterface *QAccessibleTableCell::child(int) const-
1022{-
1023 return
never executed: return 0;
0;
never executed: return 0;
0
1024}-
1025-
1026QAccessibleTableHeaderCell::QAccessibleTableHeaderCell(QAbstractItemView *view_, int index_, Qt::Orientation orientation_)-
1027 : view(view_), index(index_), orientation(orientation_)-
1028{-
1029 ((!(index_ >= 0)) ? qt_assert("index_ >= 0",__FILE__,1088) : qt_noop());-
1030}
never executed: end of block
0
1031-
1032QAccessible::Role QAccessibleTableHeaderCell::role() const-
1033{-
1034 if (orientation == Qt::Horizontal
orientation == Qt::HorizontalDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1035 return
never executed: return QAccessible::ColumnHeader;
QAccessible::ColumnHeader;
never executed: return QAccessible::ColumnHeader;
0
1036 return
never executed: return QAccessible::RowHeader;
QAccessible::RowHeader;
never executed: return QAccessible::RowHeader;
0
1037}-
1038-
1039QAccessible::State QAccessibleTableHeaderCell::state() const-
1040{-
1041 QAccessible::State s;-
1042 if (QHeaderView *h = headerView()
QHeaderView *h = headerView()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1043 s.invisible = !h->testAttribute(Qt::WA_WState_Visible);-
1044 s.disabled = !h->isEnabled();-
1045 }
never executed: end of block
0
1046 return
never executed: return s;
s;
never executed: return s;
0
1047}-
1048-
1049QRect QAccessibleTableHeaderCell::rect() const-
1050{-
1051 QHeaderView *header = 0;-
1052 if (false) {
dead code: { }
-
1053-
1054 }
dead code: { }
else if (const
const QTableVi...leView*>(view)Description
TRUEnever evaluated
FALSEnever evaluated
QTableView *tv = qobject_cast<const QTableView*>(view)
const QTableVi...leView*>(view)Description
TRUEnever evaluated
FALSEnever evaluated
) {
-
1055 if (orientation == Qt::Horizontal
orientation == Qt::HorizontalDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1056 header = tv->horizontalHeader();-
1057 }
never executed: end of block
else {
0
1058 header = tv->verticalHeader();-
1059 }
never executed: end of block
0
1060-
1061-
1062 } else if (const
const QTreeVie...eeView*>(view)Description
TRUEnever evaluated
FALSEnever evaluated
QTreeView *tv = qobject_cast<const QTreeView*>(view)
const QTreeVie...eeView*>(view)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1063 header = tv->header();-
1064-
1065 }
never executed: end of block
0
1066 if (!header
!headerDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1067 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
1068 QPoint zero = header->mapToGlobal(QPoint(0, 0));-
1069 int sectionSize = header->sectionSize(index);-
1070 int sectionPos = header->sectionPosition(index);-
1071 return
never executed: return orientation == Qt::Horizontal ? QRect(zero.x() + sectionPos, zero.y(), sectionSize, header->height()) : QRect(zero.x(), zero.y() + sectionPos, header->width(), sectionSize);
orientation == Qt::Horizontal
never executed: return orientation == Qt::Horizontal ? QRect(zero.x() + sectionPos, zero.y(), sectionSize, header->height()) : QRect(zero.x(), zero.y() + sectionPos, header->width(), sectionSize);
0
1072 ? QRect(zero.x() + sectionPos, zero.y(), sectionSize, header->height())
never executed: return orientation == Qt::Horizontal ? QRect(zero.x() + sectionPos, zero.y(), sectionSize, header->height()) : QRect(zero.x(), zero.y() + sectionPos, header->width(), sectionSize);
0
1073 : QRect(zero.x(), zero.y() + sectionPos, header->width(), sectionSize);
never executed: return orientation == Qt::Horizontal ? QRect(zero.x() + sectionPos, zero.y(), sectionSize, header->height()) : QRect(zero.x(), zero.y() + sectionPos, header->width(), sectionSize);
0
1074}-
1075-
1076QString QAccessibleTableHeaderCell::text(QAccessible::Text t) const-
1077{-
1078 QAbstractItemModel *model = view->model();-
1079 QString value;-
1080 switch (t) {-
1081 case
never executed: case QAccessible::Name:
QAccessible::Name:
never executed: case QAccessible::Name:
0
1082 value = model->headerData(index, orientation, Qt::AccessibleTextRole).toString();-
1083 if (value.isEmpty()
value.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1084 value = model->headerData(index, orientation, Qt::DisplayRole).toString();
never executed: value = model->headerData(index, orientation, Qt::DisplayRole).toString();
0
1085 break;
never executed: break;
0
1086 case
never executed: case QAccessible::Description:
QAccessible::Description:
never executed: case QAccessible::Description:
0
1087 value = model->headerData(index, orientation, Qt::AccessibleDescriptionRole).toString();-
1088 break;
never executed: break;
0
1089 default
never executed: default:
:
never executed: default:
0
1090 break;
never executed: break;
0
1091 }-
1092 return
never executed: return value;
value;
never executed: return value;
0
1093}-
1094-
1095void QAccessibleTableHeaderCell::setText(QAccessible::Text, const QString &)-
1096{-
1097 return;
never executed: return;
0
1098}-
1099-
1100bool QAccessibleTableHeaderCell::isValid() const-
1101{-
1102 return
never executed: return view && view->model() && (index >= 0) && ((orientation == Qt::Horizontal) ? (index < view->model()->columnCount()) : (index < view->model()->rowCount()));
view && view->model() && (index >= 0)
never executed: return view && view->model() && (index >= 0) && ((orientation == Qt::Horizontal) ? (index < view->model()->columnCount()) : (index < view->model()->rowCount()));
0
1103 && ((orientation == Qt::Horizontal) ? (index < view->model()->columnCount()) : (index < view->model()->rowCount()));
never executed: return view && view->model() && (index >= 0) && ((orientation == Qt::Horizontal) ? (index < view->model()->columnCount()) : (index < view->model()->rowCount()));
0
1104}-
1105-
1106QAccessibleInterface *QAccessibleTableHeaderCell::parent() const-
1107{-
1108 return
never executed: return QAccessible::queryAccessibleInterface(view);
QAccessible::queryAccessibleInterface(view);
never executed: return QAccessible::queryAccessibleInterface(view);
0
1109}-
1110-
1111QAccessibleInterface *QAccessibleTableHeaderCell::child(int) const-
1112{-
1113 return
never executed: return 0;
0;
never executed: return 0;
0
1114}-
1115-
1116QHeaderView *QAccessibleTableHeaderCell::headerView() const-
1117{-
1118 QHeaderView *header = 0;-
1119 if (false) {
dead code: { }
-
1120-
1121 }
dead code: { }
else if (const
const QTableVi...leView*>(view)Description
TRUEnever evaluated
FALSEnever evaluated
QTableView *tv = qobject_cast<const QTableView*>(view)
const QTableVi...leView*>(view)Description
TRUEnever evaluated
FALSEnever evaluated
) {
-
1122 if (orientation == Qt::Horizontal
orientation == Qt::HorizontalDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1123 header = tv->horizontalHeader();-
1124 }
never executed: end of block
else {
0
1125 header = tv->verticalHeader();-
1126 }
never executed: end of block
0
1127-
1128-
1129 } else if (const
const QTreeVie...eeView*>(view)Description
TRUEnever evaluated
FALSEnever evaluated
QTreeView *tv = qobject_cast<const QTreeView*>(view)
const QTreeVie...eeView*>(view)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1130 header = tv->header();-
1131-
1132 }
never executed: end of block
0
1133 return
never executed: return header;
header;
never executed: return header;
0
1134}-
1135-
1136-
1137-
1138-
Switch to Source codePreprocessed file

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