qtableview.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/itemviews/qtableview.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11void QSpanCollection::addSpan(QSpanCollection::Span *span)-
12{-
13 spans.append(span);-
14 Index::iterator it_y = index.lowerBound(-span->top());-
15 if (it_y == index.end()
it_y == index.end()Description
TRUEnever evaluated
FALSEnever evaluated
|| it_y.key() != -span->top()
it_y.key() != -span->top()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
16-
17 SubIndex sub_index;-
18 if (it_y != index.end()
it_y != index.end()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
19-
20-
21 const SubIndex previousList = it_y.value();-
22 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(previousList)>::type> _container_((previousList)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (Span *s = *_container_.i; _container_.control; _container_.control = 0) {-
23-
24 if(s->bottom() >= span->top()
s->bottom() >= span->top()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
25 sub_index.insert(-s->left(), s);
never executed: sub_index.insert(-s->left(), s);
0
26 }
never executed: end of block
0
27 }
never executed: end of block
0
28 it_y = index.insert(-span->top(), sub_index);-
29-
30 }
never executed: end of block
0
31-
32-
33 while(-
-it_y.key() <= span->bottom()Description
TRUEnever evaluated
FALSEnever evaluated
it_y.key() <= span->bottom()
-it_y.key() <= span->bottom()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
34 (*it_y).insert(-span->left(), span);-
35 if(it_y == index.begin()
it_y == index.begin()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
36 break;
never executed: break;
0
37 --it_y;-
38 }
never executed: end of block
0
39}
never executed: end of block
0
40void QSpanCollection::updateSpan(QSpanCollection::Span *span, int old_height)-
41{-
42 if (old_height < span->height()
old_height < span->height()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
43-
44 Index::iterator it_y = index.lowerBound(-(span->top() + old_height - 1));-
45 ((!(it_y != index.end())) ? qt_assert("it_y != index.end()",__FILE__,108) : qt_noop());-
46 while (-
-it_y.key() <= span->bottom()Description
TRUEnever evaluated
FALSEnever evaluated
it_y.key() <= span->bottom()
-it_y.key() <= span->bottom()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
47 (*it_y).insert(-span->left(), span);-
48 if(it_y == index.begin()
it_y == index.begin()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
49 break;
never executed: break;
0
50 --it_y;-
51 }
never executed: end of block
0
52 }
never executed: end of block
else if (old_height > span->height()
old_height > span->height()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
53-
54 Index::iterator it_y = index.lowerBound(-qMax(span->bottom(), span->top()));-
55 ((!(it_y != index.end())) ? qt_assert("it_y != index.end()",__FILE__,118) : qt_noop());-
56 while (-
-it_y.key() <=... old_height -1Description
TRUEnever evaluated
FALSEnever evaluated
it_y.key() <= span->top() + old_height -1
-it_y.key() <=... old_height -1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
57 if (-
-it_y.key() > span->bottom()Description
TRUEnever evaluated
FALSEnever evaluated
it_y.key() > span->bottom()
-it_y.key() > span->bottom()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
58 int removed = (*it_y).remove(-span->left());-
59 ((!(removed == 1)) ? qt_assert("removed == 1",__FILE__,122) : qt_noop()); (void)removed;;-
60 if (it_y->isEmpty()
it_y->isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
61 it_y = index.erase(it_y);-
62 }
never executed: end of block
0
63 }
never executed: end of block
0
64 if(it_y == index.begin()
it_y == index.begin()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
65 break;
never executed: break;
0
66 --it_y;-
67 }
never executed: end of block
0
68 }
never executed: end of block
0
69-
70 if (span->width() == 0
span->width() == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& span->height() == 0
span->height() == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
71 spans.removeOne(span);-
72 delete span;-
73 }
never executed: end of block
0
74}
never executed: end of block
0
75-
76-
77-
78-
79QSpanCollection::Span *QSpanCollection::spanAt(int x, int y) const-
80{-
81 Index::const_iterator it_y = index.lowerBound(-y);-
82 if (it_y == index.end()
it_y == index.end()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
83 return
never executed: return 0;
0;
never executed: return 0;
0
84 SubIndex::const_iterator it_x = (*it_y).lowerBound(-x);-
85 if (it_x == (*it_y).end()
it_x == (*it_y).end()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
86 return
never executed: return 0;
0;
never executed: return 0;
0
87 Span *span = *it_x;-
88 if (span->right() >= x
span->right() >= xDescription
TRUEnever evaluated
FALSEnever evaluated
&& span->bottom() >= y
span->bottom() >= yDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
89 return
never executed: return span;
span;
never executed: return span;
0
90 return
never executed: return 0;
0;
never executed: return 0;
0
91}-
92-
93-
94-
95-
96-
97void QSpanCollection::clear()-
98{-
99 qDeleteAll(spans);-
100 index.clear();-
101 spans.clear();-
102}
never executed: end of block
0
103-
104-
105-
106-
107QList<QSpanCollection::Span *> QSpanCollection::spansInRect(int x, int y, int w, int h) const-
108{-
109 QSet<Span *> list;-
110 Index::const_iterator it_y = index.lowerBound(-y);-
111 if(it_y == index.end()
it_y == index.end()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
112 --
never executed: --it_y;
it_y;
never executed: --it_y;
0
113 while(-
-it_y.key() <= y + hDescription
TRUEnever evaluated
FALSEnever evaluated
it_y.key() <= y + h
-it_y.key() <= y + hDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
114 SubIndex::const_iterator it_x = (*it_y).lowerBound(-x);-
115 if (it_x == (*it_y).end()
it_x == (*it_y).end()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
116 --
never executed: --it_x;
it_x;
never executed: --it_x;
0
117 while(-
-it_x.key() <= x + wDescription
TRUEnever evaluated
FALSEnever evaluated
it_x.key() <= x + w
-it_x.key() <= x + wDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
118 Span *s = *it_x;-
119 if (s->bottom() >= y
s->bottom() >= yDescription
TRUEnever evaluated
FALSEnever evaluated
&& s->right() >= x
s->right() >= xDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
120 list << s;
never executed: list << s;
0
121 if (it_x == (*it_y).begin()
it_x == (*it_y).begin()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
122 break;
never executed: break;
0
123 --it_x;-
124 }
never executed: end of block
0
125 if(it_y == index.begin()
it_y == index.begin()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
126 break;
never executed: break;
0
127 --it_y;-
128 }
never executed: end of block
0
129 return
never executed: return list.toList();
list.toList();
never executed: return list.toList();
0
130}-
131void QSpanCollection::updateInsertedRows(int start, int end)-
132{-
133-
134-
135-
136 if (spans.isEmpty()
spans.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
137 return;
never executed: return;
0
138-
139 int delta = end - start + 1;-
140-
141-
142-
143 for (SpanList::iterator it = spans.begin(); it != spans.end()
it != spans.end()Description
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
144 Span *span = *it;-
145-
146-
147-
148 if (span->m_bottom < start
span->m_bottom < startDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
149 continue;
never executed: continue;
0
150 if (span->m_top >= start
span->m_top >= startDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
151 span->m_top += delta;
never executed: span->m_top += delta;
0
152 span->m_bottom += delta;-
153 }
never executed: end of block
0
154-
155-
156-
157-
158-
159-
160-
161 for (Index::iterator it_y = index.begin(); it_y != index.end()
it_y != index.end()Description
TRUEnever evaluated
FALSEnever evaluated
; ) {
0
162 int y = -it_y.key();-
163 if (y < start
y < startDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
164 ++it_y;-
165 continue;
never executed: continue;
0
166 }-
167-
168 index.insert(-y - delta, it_y.value());-
169 it_y = index.erase(it_y);-
170 }
never executed: end of block
0
171-
172-
173-
174}
never executed: end of block
0
175-
176-
177-
178-
179void QSpanCollection::updateInsertedColumns(int start, int end)-
180{-
181-
182-
183-
184 if (spans.isEmpty()
spans.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
185 return;
never executed: return;
0
186-
187 int delta = end - start + 1;-
188-
189-
190-
191 for (SpanList::iterator it = spans.begin(); it != spans.end()
it != spans.end()Description
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
192 Span *span = *it;-
193-
194-
195-
196 if (span->m_right < start
span->m_right < startDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
197 continue;
never executed: continue;
0
198 if (span->m_left >= start
span->m_left >= startDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
199 span->m_left += delta;
never executed: span->m_left += delta;
0
200 span->m_right += delta;-
201 }
never executed: end of block
0
202-
203-
204-
205-
206-
207-
208-
209 for (Index::iterator it_y = index.begin(); it_y != index.end()
it_y != index.end()Description
TRUEnever evaluated
FALSEnever evaluated
; ++it_y) {
0
210 SubIndex &subindex = it_y.value();-
211 for (SubIndex::iterator it = subindex.begin(); it != subindex.end()
it != subindex.end()Description
TRUEnever evaluated
FALSEnever evaluated
; ) {
0
212 int x = -it.key();-
213 if (x < start
x < startDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
214 ++it;-
215 continue;
never executed: continue;
0
216 }-
217 subindex.insert(-x - delta, it.value());-
218 it = subindex.erase(it);-
219 }
never executed: end of block
0
220 }
never executed: end of block
0
221-
222-
223-
224}
never executed: end of block
0
225-
226-
227-
228-
229-
230-
231bool QSpanCollection::cleanSpanSubIndex(QSpanCollection::SubIndex &subindex, int y, bool update)-
232{-
233 if (subindex.isEmpty()
subindex.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
234 return
never executed: return true;
true;
never executed: return true;
0
235-
236 bool should_be_deleted = true;-
237 SubIndex::iterator it = subindex.end();-
238 do {-
239 --it;-
240 int x = -it.key();-
241 Span *span = it.value();-
242 if (span->will_be_deleted
span->will_be_deletedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
243 it = subindex.erase(it);-
244 continue;
never executed: continue;
0
245 }-
246 if (update
updateDescription
TRUEnever evaluated
FALSEnever evaluated
&& span->m_left != x
span->m_left != xDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
247 subindex.insert(-span->m_left, span);-
248 it = subindex.erase(it);-
249 }
never executed: end of block
0
250 if (should_be_deleted
should_be_deletedDescription
TRUEnever evaluated
FALSEnever evaluated
&& span->m_top == y
span->m_top == yDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
251 should_be_deleted = false;
never executed: should_be_deleted = false;
0
252 }
never executed: end of block
while (it != subindex.begin()
it != subindex.begin()Description
TRUEnever evaluated
FALSEnever evaluated
);
0
253-
254 return
never executed: return should_be_deleted;
should_be_deleted;
never executed: return should_be_deleted;
0
255}-
256-
257-
258-
259-
260void QSpanCollection::updateRemovedRows(int start, int end)-
261{-
262-
263-
264-
265 if (spans.isEmpty()
spans.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
266 return;
never executed: return;
0
267-
268 SpanList spansToBeDeleted;-
269 int delta = end - start + 1;-
270-
271-
272-
273 for (SpanList::iterator it = spans.begin(); it != spans.end()
it != spans.end()Description
TRUEnever evaluated
FALSEnever evaluated
; ) {
0
274 Span *span = *it;-
275-
276-
277-
278 if (span->m_bottom < start
span->m_bottom < startDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
279 ++it;-
280 continue;
never executed: continue;
0
281 }-
282 if (span->m_top < start
span->m_top < startDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
283 if (span->m_bottom <= end
span->m_bottom <= endDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
284 span->m_bottom = start - 1;
never executed: span->m_bottom = start - 1;
0
285 else-
286 span->m_bottom -= delta;
never executed: span->m_bottom -= delta;
0
287 } else {-
288 if (span->m_bottom > end
span->m_bottom > endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
289 if (span->m_top <= end
span->m_top <= endDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
290 span->m_top = start;
never executed: span->m_top = start;
0
291 else-
292 span->m_top -= delta;
never executed: span->m_top -= delta;
0
293 span->m_bottom -= delta;-
294 }
never executed: end of block
else {
0
295 span->will_be_deleted = true;-
296 }
never executed: end of block
0
297 }-
298 if (span->m_top == span->m_bottom
span->m_top == span->m_bottomDescription
TRUEnever evaluated
FALSEnever evaluated
&& span->m_left == span->m_right
span->m_left == span->m_rightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
299 span->will_be_deleted = true;
never executed: span->will_be_deleted = true;
0
300 if (span->will_be_deleted
span->will_be_deletedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
301 spansToBeDeleted.append(span);-
302 it = spans.erase(it);-
303 }
never executed: end of block
else {
0
304 ++it;-
305 }
never executed: end of block
0
306 }-
307-
308-
309-
310-
311-
312-
313 if (spans.isEmpty()
spans.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
314 qDeleteAll(spansToBeDeleted);-
315 index.clear();-
316 return;
never executed: return;
0
317 }-
318-
319 Index::iterator it_y = index.end();-
320 do {-
321 --it_y;-
322 int y = -it_y.key();-
323 SubIndex &subindex = it_y.value();-
324 if (y < start
y < startDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
325 if (cleanSpanSubIndex(subindex, y)
cleanSpanSubIndex(subindex, y)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
326 it_y = index.erase(it_y);
never executed: it_y = index.erase(it_y);
0
327 }
never executed: end of block
else if (y >= start
y >= startDescription
TRUEnever evaluated
FALSEnever evaluated
&& y <= end
y <= endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
328 bool span_at_start = false;-
329 SubIndex spansToBeMoved;-
330 for (SubIndex::iterator it = subindex.begin(); it != subindex.end()
it != subindex.end()Description
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
331 Span *span = it.value();-
332 if (span->will_be_deleted
span->will_be_deletedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
333 continue;
never executed: continue;
0
334 if (!span_at_start
!span_at_startDescription
TRUEnever evaluated
FALSEnever evaluated
&& span->m_top == start
span->m_top == startDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
335 span_at_start = true;
never executed: span_at_start = true;
0
336 spansToBeMoved.insert(it.key(), span);-
337 }
never executed: end of block
0
338-
339 if (y == start
y == startDescription
TRUEnever evaluated
FALSEnever evaluated
&& span_at_start
span_at_startDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
340 subindex.clear();
never executed: subindex.clear();
0
341 else-
342 it_y = index.erase(it_y);
never executed: it_y = index.erase(it_y);
0
343-
344 if (span_at_start
span_at_startDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
345 Index::iterator it_start;-
346 if (y == start
y == startDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
347 it_start = it_y;
never executed: it_start = it_y;
0
348 else {-
349 it_start = index.find(-start);-
350 if (it_start == index.end()
it_start == index.end()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
351 it_start = index.insert(-start, SubIndex());
never executed: it_start = index.insert(-start, SubIndex());
0
352 }
never executed: end of block
0
353 SubIndex &start_subindex = it_start.value();-
354 for (SubIndex::iterator it = spansToBeMoved.begin(); it != spansToBeMoved.end()
it != spansToBeMoved.end()Description
TRUEnever evaluated
FALSEnever evaluated
; ++it)
0
355 start_subindex.insert(it.key(), it.value());
never executed: start_subindex.insert(it.key(), it.value());
0
356 }
never executed: end of block
0
357 }
never executed: end of block
else {
0
358 if (y == end + 1
y == end + 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
359 Index::iterator it_top = index.find(-y + delta);-
360 if (it_top == index.end()
it_top == index.end()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
361 it_top = index.insert(-y + delta, SubIndex());
never executed: it_top = index.insert(-y + delta, SubIndex());
0
362 for (SubIndex::iterator it = subindex.begin(); it != subindex.end()
it != subindex.end()Description
TRUEnever evaluated
FALSEnever evaluated
; ) {
0
363 Span *span = it.value();-
364 if (!span->will_be_deleted
!span->will_be_deletedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
365 it_top.value().insert(it.key(), span);
never executed: it_top.value().insert(it.key(), span);
0
366 ++it;-
367 }
never executed: end of block
0
368 }
never executed: end of block
else {
0
369 index.insert(-y + delta, subindex);-
370 }
never executed: end of block
0
371 it_y = index.erase(it_y);-
372 }
never executed: end of block
0
373 } while (it_y != index.begin()
it_y != index.begin()Description
TRUEnever evaluated
FALSEnever evaluated
);
0
374-
375-
376-
377-
378-
379-
380-
381 qDeleteAll(spansToBeDeleted);-
382}
never executed: end of block
0
383-
384-
385-
386-
387void QSpanCollection::updateRemovedColumns(int start, int end)-
388{-
389-
390-
391-
392 if (spans.isEmpty()
spans.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
393 return;
never executed: return;
0
394-
395 SpanList toBeDeleted;-
396 int delta = end - start + 1;-
397-
398-
399-
400 for (SpanList::iterator it = spans.begin(); it != spans.end()
it != spans.end()Description
TRUEnever evaluated
FALSEnever evaluated
; ) {
0
401 Span *span = *it;-
402-
403-
404-
405 if (span->m_right < start
span->m_right < startDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
406 ++it;-
407 continue;
never executed: continue;
0
408 }-
409 if (span->m_left < start
span->m_left < startDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
410 if (span->m_right <= end
span->m_right <= endDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
411 span->m_right = start - 1;
never executed: span->m_right = start - 1;
0
412 else-
413 span->m_right -= delta;
never executed: span->m_right -= delta;
0
414 } else {-
415 if (span->m_right > end
span->m_right > endDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
416 if (span->m_left <= end
span->m_left <= endDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
417 span->m_left = start;
never executed: span->m_left = start;
0
418 else-
419 span->m_left -= delta;
never executed: span->m_left -= delta;
0
420 span->m_right -= delta;-
421 }
never executed: end of block
else {
0
422 span->will_be_deleted = true;-
423 }
never executed: end of block
0
424 }-
425 if (span->m_top == span->m_bottom
span->m_top == span->m_bottomDescription
TRUEnever evaluated
FALSEnever evaluated
&& span->m_left == span->m_right
span->m_left == span->m_rightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
426 span->will_be_deleted = true;
never executed: span->will_be_deleted = true;
0
427 if (span->will_be_deleted
span->will_be_deletedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
428 toBeDeleted.append(span);-
429 it = spans.erase(it);-
430 }
never executed: end of block
else {
0
431 ++it;-
432 }
never executed: end of block
0
433 }-
434-
435-
436-
437-
438-
439-
440 if (spans.isEmpty()
spans.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
441 qDeleteAll(toBeDeleted);-
442 index.clear();-
443 return;
never executed: return;
0
444 }-
445-
446 for (Index::iterator it_y = index.begin(); it_y != index.end()
it_y != index.end()Description
TRUEnever evaluated
FALSEnever evaluated
; ) {
0
447 int y = -it_y.key();-
448 if (cleanSpanSubIndex(it_y.value(), y, true)
cleanSpanSubIn...ue(), y, true)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
449 it_y = index.erase(it_y);
never executed: it_y = index.erase(it_y);
0
450 else-
451 ++
never executed: ++it_y;
it_y;
never executed: ++it_y;
0
452 }-
453-
454-
455-
456-
457-
458-
459-
460 qDeleteAll(toBeDeleted);-
461}
never executed: end of block
0
462-
463-
464-
465-
466-
467-
468bool QSpanCollection::checkConsistency() const-
469{-
470 for (Index::const_iterator it_y = index.begin(); it_y != index.end()
it_y != index.end()Description
TRUEnever evaluated
FALSEnever evaluated
; ++it_y) {
0
471 int y = -it_y.key();-
472 const SubIndex &subIndex = it_y.value();-
473 for (SubIndex::const_iterator it = subIndex.begin(); it != subIndex.end()
it != subIndex.end()Description
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
474 int x = -it.key();-
475 Span *span = it.value();-
476 if (!spans.contains(span)
!spans.contains(span)Description
TRUEnever evaluated
FALSEnever evaluated
|| span->left() != x
span->left() != xDescription
TRUEnever evaluated
FALSEnever evaluated
0
477 || y < span->top()
y < span->top()Description
TRUEnever evaluated
FALSEnever evaluated
|| y > span->bottom()
y > span->bottom()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
478 return
never executed: return false;
false;
never executed: return false;
0
479 }
never executed: end of block
0
480 }
never executed: end of block
0
481-
482 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(spans)>::type> _container_((spans)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (const Span *span = *_container_.i; _container_.control; _container_.control = 0) {-
483 if (span->width() < 1
span->width() < 1Description
TRUEnever evaluated
FALSEnever evaluated
|| span->height() < 1
span->height() < 1Description
TRUEnever evaluated
FALSEnever evaluated
0
484 || (span->width() == 1
span->width() == 1Description
TRUEnever evaluated
FALSEnever evaluated
&& span->height() == 1
span->height() == 1Description
TRUEnever evaluated
FALSEnever evaluated
))
0
485 return
never executed: return false;
false;
never executed: return false;
0
486 for (int y = span->top(); y <= span->bottom()
y <= span->bottom()Description
TRUEnever evaluated
FALSEnever evaluated
; ++y) {
0
487 Index::const_iterator it_y = index.find(-y);-
488 if (it_y == index.end()
it_y == index.end()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
489 if (y == span->top()
y == span->top()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
490 return
never executed: return false;
false;
never executed: return false;
0
491 else-
492 continue;
never executed: continue;
0
493 }-
494 const SubIndex &subIndex = it_y.value();-
495 SubIndex::const_iterator it = subIndex.find(-span->left());-
496 if (it == subIndex.end()
it == subIndex.end()Description
TRUEnever evaluated
FALSEnever evaluated
|| it.value() != span
it.value() != spanDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
497 return
never executed: return false;
false;
never executed: return false;
0
498 }
never executed: end of block
0
499 }
never executed: end of block
0
500 return
never executed: return true;
true;
never executed: return true;
0
501}-
502-
503-
504class QTableCornerButton : public QAbstractButton-
505{-
506 public: template <typename ThisObject> inline void qt_check_for_QOBJECT_macro(const ThisObject &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; }-
507#pragma GCC diagnostic push-
508 static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);-
509#pragma GCC diagnostic pop-
510 struct QPrivateSignal {};-
511public:-
512 QTableCornerButton(QWidget *parent) : QAbstractButton(parent) {}
never executed: end of block
0
513 void paintEvent(QPaintEvent*) override {-
514 QStyleOptionHeader opt;-
515 opt.init(this);-
516 QStyle::State state = QStyle::State_None;-
517 if (isEnabled()
isEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
518 state |= QStyle::State_Enabled;
never executed: state |= QStyle::State_Enabled;
0
519 if (isActiveWindow()
isActiveWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
520 state |= QStyle::State_Active;
never executed: state |= QStyle::State_Active;
0
521 if (isDown()
isDown()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
522 state |= QStyle::State_Sunken;
never executed: state |= QStyle::State_Sunken;
0
523 opt.state = state;-
524 opt.rect = rect();-
525 opt.position = QStyleOptionHeader::OnlyOneSection;-
526 QPainter painter(this);-
527 style()->drawControl(QStyle::CE_Header, &opt, &painter, this);-
528 }
never executed: end of block
0
529};-
530-
531void QTableViewPrivate::init()-
532{-
533 QTableView * const q = q_func();-
534-
535 q->setEditTriggers(editTriggers|QAbstractItemView::AnyKeyPressed);-
536-
537 QHeaderView *vertical = new QHeaderView(Qt::Vertical, q);-
538 vertical->setSectionsClickable(true);-
539 vertical->setHighlightSections(true);-
540 q->setVerticalHeader(vertical);-
541-
542 QHeaderView *horizontal = new QHeaderView(Qt::Horizontal, q);-
543 horizontal->setSectionsClickable(true);-
544 horizontal->setHighlightSections(true);-
545 q->setHorizontalHeader(horizontal);-
546-
547 tabKeyNavigation = true;-
548-
549 cornerWidget = new QTableCornerButton(q);-
550 cornerWidget->setFocusPolicy(Qt::NoFocus);-
551 QObject::connect(cornerWidget, qFlagLocation("2""clicked()" "\0" __FILE__ ":" "624"), q, qFlagLocation("1""selectAll()" "\0" __FILE__ ":" "624"));-
552}
never executed: end of block
0
553-
554-
555-
556-
557-
558void QTableViewPrivate::trimHiddenSelections(QItemSelectionRange *range) const-
559{-
560 ((!(range && range->isValid())) ? qt_assert("range && range->isValid()",__FILE__,633) : qt_noop());-
561-
562 int top = range->top();-
563 int left = range->left();-
564 int bottom = range->bottom();-
565 int right = range->right();-
566-
567 while (bottom >= top
bottom >= topDescription
TRUEnever evaluated
FALSEnever evaluated
&& verticalHeader->isSectionHidden(bottom)
verticalHeader...Hidden(bottom)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
568 --
never executed: --bottom;
bottom;
never executed: --bottom;
0
569 while (right >= left
right >= leftDescription
TRUEnever evaluated
FALSEnever evaluated
&& horizontalHeader->isSectionHidden(right)
horizontalHead...nHidden(right)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
570 --
never executed: --right;
right;
never executed: --right;
0
571-
572 if (top > bottom
top > bottomDescription
TRUEnever evaluated
FALSEnever evaluated
|| left > right
left > rightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
573 *range = QItemSelectionRange();-
574 return;
never executed: return;
0
575 }-
576-
577 while (verticalHeader->isSectionHidden(top)
verticalHeader...ionHidden(top)Description
TRUEnever evaluated
FALSEnever evaluated
&& top <= bottom
top <= bottomDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
578 ++
never executed: ++top;
top;
never executed: ++top;
0
579 while (horizontalHeader->isSectionHidden(left)
horizontalHead...onHidden(left)Description
TRUEnever evaluated
FALSEnever evaluated
&& left <= right
left <= rightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
580 ++
never executed: ++left;
left;
never executed: ++left;
0
581-
582 if (top > bottom
top > bottomDescription
TRUEnever evaluated
FALSEnever evaluated
|| left > right
left > rightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
583 *range = QItemSelectionRange();-
584 return;
never executed: return;
0
585 }-
586-
587 QModelIndex bottomRight = model->index(bottom, right, range->parent());-
588 QModelIndex topLeft = model->index(top, left, range->parent());-
589 *range = QItemSelectionRange(topLeft, bottomRight);-
590}
never executed: end of block
0
591-
592-
593-
594-
595-
596void QTableViewPrivate::setSpan(int row, int column, int rowSpan, int columnSpan)-
597{-
598 if (__builtin_expect(!!(row < 0 || column < 0 || rowSpan <= 0 || columnSpan <= 0), false)
__builtin_expe... <= 0), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
599 QMessageLogger(__FILE__, 672, __PRETTY_FUNCTION__).warning("QTableView::setSpan: invalid span given: (%d, %d, %d, %d)",-
600 row, column, rowSpan, columnSpan);-
601 return;
never executed: return;
0
602 }-
603 QSpanCollection::Span *sp = spans.spanAt(column, row);-
604 if (sp
spDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
605 if (sp->top() != row
sp->top() != rowDescription
TRUEnever evaluated
FALSEnever evaluated
|| sp->left() != column
sp->left() != columnDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
606 QMessageLogger(__FILE__, 679, __PRETTY_FUNCTION__).warning("QTableView::setSpan: span cannot overlap");-
607 return;
never executed: return;
0
608 }-
609 if (rowSpan == 1
rowSpan == 1Description
TRUEnever evaluated
FALSEnever evaluated
&& columnSpan == 1
columnSpan == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
610 rowSpan = columnSpan = 0;-
611 }
never executed: end of block
0
612 const int old_height = sp->height();-
613 sp->m_bottom = row + rowSpan - 1;-
614 sp->m_right = column + columnSpan - 1;-
615 spans.updateSpan(sp, old_height);-
616 return;
never executed: return;
0
617 } else if (__builtin_expect(!!(rowSpan == 1 && columnSpan == 1), false)
__builtin_expe... == 1), false)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
618 QMessageLogger(__FILE__, 691, __PRETTY_FUNCTION__).warning("QTableView::setSpan: single cell span won't be added");-
619 return;
never executed: return;
0
620 }-
621 sp = new QSpanCollection::Span(row, column, rowSpan, columnSpan);-
622 spans.addSpan(sp);-
623}
never executed: end of block
0
624-
625-
626-
627-
628-
629QSpanCollection::Span QTableViewPrivate::span(int row, int column) const-
630{-
631 QSpanCollection::Span *sp = spans.spanAt(column, row);-
632 if (sp
spDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
633 return
never executed: return *sp;
*sp;
never executed: return *sp;
0
634-
635 return
never executed: return QSpanCollection::Span(row, column, 1, 1);
QSpanCollection::Span(row, column, 1, 1);
never executed: return QSpanCollection::Span(row, column, 1, 1);
0
636}-
637-
638-
639-
640-
641-
642int QTableViewPrivate::sectionSpanEndLogical(const QHeaderView *header, int logical, int span) const-
643{-
644 int visual = header->visualIndex(logical);-
645 for (int i = 1; i < span
i < spanDescription
TRUEnever evaluated
FALSEnever evaluated
; ) {
0
646 if (++
++visual >= header->count()Description
TRUEnever evaluated
FALSEnever evaluated
visual >= header->count()
++visual >= header->count()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
647 break;
never executed: break;
0
648 logical = header->logicalIndex(visual);-
649 ++i;-
650 }
never executed: end of block
0
651 return
never executed: return logical;
logical;
never executed: return logical;
0
652}-
653-
654-
655-
656-
657-
658-
659int QTableViewPrivate::sectionSpanSize(const QHeaderView *header, int logical, int span) const-
660{-
661 int endLogical = sectionSpanEndLogical(header, logical, span);-
662 return
never executed: return header->sectionPosition(endLogical) - header->sectionPosition(logical) + header->sectionSize(endLogical);
header->sectionPosition(endLogical)
never executed: return header->sectionPosition(endLogical) - header->sectionPosition(logical) + header->sectionSize(endLogical);
0
663 - header->sectionPosition(logical)
never executed: return header->sectionPosition(endLogical) - header->sectionPosition(logical) + header->sectionSize(endLogical);
0
664 + header->sectionSize(endLogical);
never executed: return header->sectionPosition(endLogical) - header->sectionPosition(logical) + header->sectionSize(endLogical);
0
665}-
666-
667-
668-
669-
670-
671-
672-
673bool QTableViewPrivate::spanContainsSection(const QHeaderView *header, int logical, int spanLogical, int span) const-
674{-
675 if (logical == spanLogical
logical == spanLogicalDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
676 return
never executed: return true;
true;
never executed: return true;
0
677 int visual = header->visualIndex(spanLogical);-
678 for (int i = 1; i < span
i < spanDescription
TRUEnever evaluated
FALSEnever evaluated
; ) {
0
679 if (++
++visual >= header->count()Description
TRUEnever evaluated
FALSEnever evaluated
visual >= header->count()
++visual >= header->count()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
680 break;
never executed: break;
0
681 spanLogical = header->logicalIndex(visual);-
682 if (logical == spanLogical
logical == spanLogicalDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
683 return
never executed: return true;
true;
never executed: return true;
0
684 ++i;-
685 }
never executed: end of block
0
686 return
never executed: return false;
false;
never executed: return false;
0
687}-
688-
689-
690-
691-
692-
693QRect QTableViewPrivate::visualSpanRect(const QSpanCollection::Span &span) const-
694{-
695 const QTableView * const q = q_func();-
696-
697 int row = span.top();-
698 int rowp = verticalHeader->sectionViewportPosition(row);-
699 int rowh = rowSpanHeight(row, span.height());-
700-
701 int column = span.left();-
702 int colw = columnSpanWidth(column, span.width());-
703 if (q->isRightToLeft()
q->isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
704 column = span.right();
never executed: column = span.right();
0
705 int colp = horizontalHeader->sectionViewportPosition(column);-
706-
707 const int i = showGrid
showGridDescription
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0;
0
708 if (q->isRightToLeft()
q->isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
709 return
never executed: return QRect(colp + i, rowp, colw - i, rowh - i);
QRect(colp + i, rowp, colw - i, rowh - i);
never executed: return QRect(colp + i, rowp, colw - i, rowh - i);
0
710 return
never executed: return QRect(colp, rowp, colw - i, rowh - i);
QRect(colp, rowp, colw - i, rowh - i);
never executed: return QRect(colp, rowp, colw - i, rowh - i);
0
711}-
712-
713-
714-
715-
716-
717-
718-
719void QTableViewPrivate::drawAndClipSpans(const QRegion &area, QPainter *painter,-
720 const QStyleOptionViewItem &option, QBitArray *drawn,-
721 int firstVisualRow, int lastVisualRow, int firstVisualColumn, int lastVisualColumn)-
722{-
723 bool alternateBase = false;-
724 QRegion region = viewport->rect();-
725-
726 QList<QSpanCollection::Span *> visibleSpans;-
727 bool sectionMoved = verticalHeader->sectionsMoved()
verticalHeader...ectionsMoved()Description
TRUEnever evaluated
FALSEnever evaluated
|| horizontalHeader->sectionsMoved()
horizontalHead...ectionsMoved()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
728-
729 if (!sectionMoved
!sectionMovedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
730 visibleSpans = spans.spansInRect(logicalColumn(firstVisualColumn), logicalRow(firstVisualRow),-
731 lastVisualColumn - firstVisualColumn + 1, lastVisualRow - firstVisualRow + 1);-
732 }
never executed: end of block
else {
0
733 QSet<QSpanCollection::Span *> set;-
734 for(int x = firstVisualColumn; x <= lastVisualColumn
x <= lastVisualColumnDescription
TRUEnever evaluated
FALSEnever evaluated
; x++)
0
735 for(int y = firstVisualRow; y <= lastVisualRow
y <= lastVisualRowDescription
TRUEnever evaluated
FALSEnever evaluated
; y++)
0
736 set.
never executed: set.insert(spans.spanAt(x,y));
insert(spans.spanAt(x,y));
never executed: set.insert(spans.spanAt(x,y));
0
737 set.remove(0);-
738 visibleSpans = set.toList();-
739 }
never executed: end of block
0
740-
741 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(visibleSpans)>::type> _container_((visibleSpans)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QSpanCollection::Span *span = *_container_.i; _container_.control; _container_.control = 0) {-
742 int row = span->top();-
743 int col = span->left();-
744 QModelIndex index = model->index(row, col, root);-
745 if (!index.isValid()
!index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
746 continue;
never executed: continue;
0
747 QRect rect = visualSpanRect(*span);-
748 rect.translate(scrollDelayOffset);-
749 if (!area.intersects(rect)
!area.intersects(rect)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
750 continue;
never executed: continue;
0
751 QStyleOptionViewItem opt = option;-
752 opt.rect = rect;-
753 alternateBase = alternatingColors
alternatingColorsDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(span->top() & 1)Description
TRUEnever evaluated
FALSEnever evaluated
span->top() & 1)
(span->top() & 1)Description
TRUEnever evaluated
FALSEnever evaluated
;
0
754 opt.features.setFlag(QStyleOptionViewItem::Alternate, alternateBase);-
755 drawCell(painter, opt, index);-
756 region -= rect;-
757 for (int r = span->top(); r <= span->bottom()
r <= span->bottom()Description
TRUEnever evaluated
FALSEnever evaluated
; ++r) {
0
758 const int vr = visualRow(r);-
759 if (vr < firstVisualRow
vr < firstVisualRowDescription
TRUEnever evaluated
FALSEnever evaluated
|| vr > lastVisualRow
vr > lastVisualRowDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
760 continue;
never executed: continue;
0
761 for (int c = span->left(); c <= span->right()
c <= span->right()Description
TRUEnever evaluated
FALSEnever evaluated
; ++c) {
0
762 const int vc = visualColumn(c);-
763 if (vc < firstVisualColumn
vc < firstVisualColumnDescription
TRUEnever evaluated
FALSEnever evaluated
|| vc > lastVisualColumn
vc > lastVisualColumnDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
764 continue;
never executed: continue;
0
765 drawn->setBit((vr - firstVisualRow) * (lastVisualColumn - firstVisualColumn + 1)-
766 + vc - firstVisualColumn);-
767 }
never executed: end of block
0
768 }
never executed: end of block
0
769-
770 }
never executed: end of block
0
771 painter->setClipRegion(region);-
772}
never executed: end of block
0
773-
774-
775-
776-
777-
778void QTableViewPrivate::_q_updateSpanInsertedRows(const QModelIndex &parent, int start, int end)-
779{-
780 (void)parent;-
781 spans.updateInsertedRows(start, end);-
782}
never executed: end of block
0
783-
784-
785-
786-
787-
788void QTableViewPrivate::_q_updateSpanInsertedColumns(const QModelIndex &parent, int start, int end)-
789{-
790 (void)parent;-
791 spans.updateInsertedColumns(start, end);-
792}
never executed: end of block
0
793-
794-
795-
796-
797-
798void QTableViewPrivate::_q_updateSpanRemovedRows(const QModelIndex &parent, int start, int end)-
799{-
800 (void)parent;-
801 spans.updateRemovedRows(start, end);-
802}
never executed: end of block
0
803-
804-
805-
806-
807-
808void QTableViewPrivate::_q_updateSpanRemovedColumns(const QModelIndex &parent, int start, int end)-
809{-
810 (void)parent;-
811 spans.updateRemovedColumns(start, end);-
812}
never executed: end of block
0
813-
814-
815-
816-
817-
818void QTableViewPrivate::drawCell(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index)-
819{-
820 QTableView * const q = q_func();-
821 QStyleOptionViewItem opt = option;-
822-
823 if (selectionModel
selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
&& selectionModel->isSelected(index)
selectionModel...elected(index)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
824 opt.state |= QStyle::State_Selected;
never executed: opt.state |= QStyle::State_Selected;
0
825 if (index == hover
index == hoverDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
826 opt.state |= QStyle::State_MouseOver;
never executed: opt.state |= QStyle::State_MouseOver;
0
827 if (option.state & QStyle::State_Enabled
option.state &...:State_EnabledDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
828 QPalette::ColorGroup cg;-
829 if ((
(model->flags(...sEnabled) == 0Description
TRUEnever evaluated
FALSEnever evaluated
model->flags(index) & Qt::ItemIsEnabled) == 0
(model->flags(...sEnabled) == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
830 opt.state &= ~QStyle::State_Enabled;-
831 cg = QPalette::Disabled;-
832 }
never executed: end of block
else {
0
833 cg = QPalette::Normal;-
834 }
never executed: end of block
0
835 opt.palette.setCurrentColorGroup(cg);-
836 }
never executed: end of block
0
837-
838 if (index == q->currentIndex()
index == q->currentIndex()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
839 const bool focus = (q->hasFocus()
q->hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
|| viewport->hasFocus()
viewport->hasFocus()Description
TRUEnever evaluated
FALSEnever evaluated
) && q->currentIndex().isValid()
q->currentIndex().isValid()Description
TRUEnever evaluated
FALSEnever evaluated
;
0
840 if (focus
focusDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
841 opt.state |= QStyle::State_HasFocus;
never executed: opt.state |= QStyle::State_HasFocus;
0
842 }
never executed: end of block
0
843-
844 q->style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, q);-
845-
846 q->itemDelegate(index)->paint(painter, opt, index);-
847}
never executed: end of block
0
848-
849-
850-
851-
852-
853int QTableViewPrivate::widthHintForIndex(const QModelIndex &index, int hint, const QStyleOptionViewItem &option) const-
854{-
855 const QTableView * const q = q_func();-
856 QWidget *editor = editorForIndex(index).widget.data();-
857 if (editor
editorDescription
TRUEnever evaluated
FALSEnever evaluated
&& persistent.contains(editor)
persistent.contains(editor)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
858 hint = qMax(hint, editor->sizeHint().width());-
859 int min = editor->minimumSize().width();-
860 int max = editor->maximumSize().width();-
861 hint = qBound(min, hint, max);-
862 }
never executed: end of block
0
863 hint = qMax(hint, q->itemDelegate(index)->sizeHint(option, index).width());-
864 return
never executed: return hint;
hint;
never executed: return hint;
0
865}-
866-
867-
868-
869-
870-
871int QTableViewPrivate::heightHintForIndex(const QModelIndex &index, int hint, QStyleOptionViewItem &option) const-
872{-
873 const QTableView * const q = q_func();-
874 QWidget *editor = editorForIndex(index).widget.data();-
875 if (editor
editorDescription
TRUEnever evaluated
FALSEnever evaluated
&& persistent.contains(editor)
persistent.contains(editor)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
876 hint = qMax(hint, editor->sizeHint().height());-
877 int min = editor->minimumSize().height();-
878 int max = editor->maximumSize().height();-
879 hint = qBound(min, hint, max);-
880 }
never executed: end of block
0
881-
882 if (wrapItemText
wrapItemTextDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
883 option.rect.setY(q->rowViewportPosition(index.row()));-
884 int height = q->rowHeight(index.row());-
885-
886-
887-
888-
889-
890-
891 if (height == 0
height == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
892 height = 1;
never executed: height = 1;
0
893 option.rect.setHeight(height);-
894 option.rect.setX(q->columnViewportPosition(index.column()));-
895 option.rect.setWidth(q->columnWidth(index.column()));-
896 }
never executed: end of block
0
897 hint = qMax(hint, q->itemDelegate(index)->sizeHint(option, index).height());-
898 return
never executed: return hint;
hint;
never executed: return hint;
0
899}-
900QTableView::QTableView(QWidget *parent)-
901 : QAbstractItemView(*new QTableViewPrivate, parent)-
902{-
903 QTableViewPrivate * const d = d_func();-
904 d->init();-
905}
never executed: end of block
0
906-
907-
908-
909-
910QTableView::QTableView(QTableViewPrivate &dd, QWidget *parent)-
911 : QAbstractItemView(dd, parent)-
912{-
913 QTableViewPrivate * const d = d_func();-
914 d->init();-
915}
never executed: end of block
0
916-
917-
918-
919-
920QTableView::~QTableView()-
921{-
922}-
923-
924-
925-
926-
927QSize QTableView::viewportSizeHint() const-
928{-
929 const QTableViewPrivate * const d = d_func();-
930 QSize result( (d->verticalHeader->isHidden() ? 0 : d->verticalHeader->width()) + d->horizontalHeader->length(),-
931 (d->horizontalHeader->isHidden() ? 0 : d->horizontalHeader->height()) + d->verticalHeader->length());-
932 result += QSize(verticalScrollBar()->isVisible() ? verticalScrollBar()->width() : 0,-
933 horizontalScrollBar()->isVisible() ? horizontalScrollBar()->height() : 0);-
934 return
never executed: return result;
result;
never executed: return result;
0
935}-
936-
937-
938-
939-
940void QTableView::setModel(QAbstractItemModel *model)-
941{-
942 QTableViewPrivate * const d = d_func();-
943 if (model == d->model
model == d->modelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
944 return;
never executed: return;
0
945-
946 if (d->model
d->modelDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->model != QAbstractItemModelPrivate::staticEmptyModel()
d->model != QA...icEmptyModel()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
947 disconnect(d->model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1121"),-
948 this, qFlagLocation("1""_q_updateSpanInsertedRows(QModelIndex,int,int)" "\0" __FILE__ ":" "1122"));-
949 disconnect(d->model, qFlagLocation("2""columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1123"),-
950 this, qFlagLocation("1""_q_updateSpanInsertedColumns(QModelIndex,int,int)" "\0" __FILE__ ":" "1124"));-
951 disconnect(d->model, qFlagLocation("2""rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1125"),-
952 this, qFlagLocation("1""_q_updateSpanRemovedRows(QModelIndex,int,int)" "\0" __FILE__ ":" "1126"));-
953 disconnect(d->model, qFlagLocation("2""columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1127"),-
954 this, qFlagLocation("1""_q_updateSpanRemovedColumns(QModelIndex,int,int)" "\0" __FILE__ ":" "1128"));-
955 }
never executed: end of block
0
956 if (d->selectionModel
d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
957 disconnect(d->selectionModel, qFlagLocation("2""currentRowChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "1131"),-
958 d->model, qFlagLocation("1""submit()" "\0" __FILE__ ":" "1132"));-
959 }
never executed: end of block
0
960 if (model
modelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
961 connect(model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1135"),-
962 this, qFlagLocation("1""_q_updateSpanInsertedRows(QModelIndex,int,int)" "\0" __FILE__ ":" "1136"));-
963 connect(model, qFlagLocation("2""columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1137"),-
964 this, qFlagLocation("1""_q_updateSpanInsertedColumns(QModelIndex,int,int)" "\0" __FILE__ ":" "1138"));-
965 connect(model, qFlagLocation("2""rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1139"),-
966 this, qFlagLocation("1""_q_updateSpanRemovedRows(QModelIndex,int,int)" "\0" __FILE__ ":" "1140"));-
967 connect(model, qFlagLocation("2""columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1141"),-
968 this, qFlagLocation("1""_q_updateSpanRemovedColumns(QModelIndex,int,int)" "\0" __FILE__ ":" "1142"));-
969 }
never executed: end of block
0
970 d->verticalHeader->setModel(model);-
971 d->horizontalHeader->setModel(model);-
972 QAbstractItemView::setModel(model);-
973}
never executed: end of block
0
974-
975-
976-
977-
978void QTableView::setRootIndex(const QModelIndex &index)-
979{-
980 QTableViewPrivate * const d = d_func();-
981 if (index == d->root
index == d->rootDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
982 viewport()->update();-
983 return;
never executed: return;
0
984 }-
985 d->verticalHeader->setRootIndex(index);-
986 d->horizontalHeader->setRootIndex(index);-
987 QAbstractItemView::setRootIndex(index);-
988}
never executed: end of block
0
989-
990-
991-
992-
993void QTableView::doItemsLayout()-
994{-
995 QTableViewPrivate * const d = d_func();-
996 QAbstractItemView::doItemsLayout();-
997 d->verticalHeader->d_func()->setScrollOffset(verticalScrollBar(), verticalScrollMode());-
998 if (!d->verticalHeader->updatesEnabled()
!d->verticalHe...datesEnabled()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
999 d->verticalHeader->setUpdatesEnabled(true);
never executed: d->verticalHeader->setUpdatesEnabled(true);
0
1000}
never executed: end of block
0
1001-
1002-
1003-
1004-
1005void QTableView::setSelectionModel(QItemSelectionModel *selectionModel)-
1006{-
1007 QTableViewPrivate * const d = d_func();-
1008 ((!(selectionModel)) ? qt_assert("selectionModel",__FILE__,1182) : qt_noop());-
1009 if (d->selectionModel
d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1010-
1011 disconnect(d->selectionModel, qFlagLocation("2""currentRowChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "1185"),-
1012 d->model, qFlagLocation("1""submit()" "\0" __FILE__ ":" "1186"));-
1013 }
never executed: end of block
0
1014-
1015 d->verticalHeader->setSelectionModel(selectionModel);-
1016 d->horizontalHeader->setSelectionModel(selectionModel);-
1017 QAbstractItemView::setSelectionModel(selectionModel);-
1018-
1019 if (d->selectionModel
d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1020-
1021 connect(d->selectionModel, qFlagLocation("2""currentRowChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "1195"),-
1022 d->model, qFlagLocation("1""submit()" "\0" __FILE__ ":" "1196"));-
1023 }
never executed: end of block
0
1024}
never executed: end of block
0
1025-
1026-
1027-
1028-
1029-
1030-
1031QHeaderView *QTableView::horizontalHeader() const-
1032{-
1033 const QTableViewPrivate * const d = d_func();-
1034 return
never executed: return d->horizontalHeader;
d->horizontalHeader;
never executed: return d->horizontalHeader;
0
1035}-
1036-
1037-
1038-
1039-
1040-
1041-
1042QHeaderView *QTableView::verticalHeader() const-
1043{-
1044 const QTableViewPrivate * const d = d_func();-
1045 return
never executed: return d->verticalHeader;
d->verticalHeader;
never executed: return d->verticalHeader;
0
1046}-
1047-
1048-
1049-
1050-
1051-
1052-
1053void QTableView::setHorizontalHeader(QHeaderView *header)-
1054{-
1055 QTableViewPrivate * const d = d_func();-
1056-
1057 if (!header
!headerDescription
TRUEnever evaluated
FALSEnever evaluated
|| header == d->horizontalHeader
header == d->horizontalHeaderDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1058 return;
never executed: return;
0
1059 if (d->horizontalHeader
d->horizontalHeaderDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->horizontalHeader->parent() == this
d->horizontalH...rent() == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1060 delete d->horizontalHeader;
never executed: delete d->horizontalHeader;
0
1061 d->horizontalHeader = header;-
1062 d->horizontalHeader->setParent(this);-
1063 d->horizontalHeader->d_func()->setAllowUserMoveOfSection0(true);-
1064 if (!d->horizontalHeader->model()
!d->horizontalHeader->model()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1065 d->horizontalHeader->setModel(d->model);-
1066 if (d->selectionModel
d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1067 d->horizontalHeader->setSelectionModel(d->selectionModel);
never executed: d->horizontalHeader->setSelectionModel(d->selectionModel);
0
1068 }
never executed: end of block
0
1069-
1070 connect(d->horizontalHeader,qFlagLocation("2""sectionResized(int,int,int)" "\0" __FILE__ ":" "1244"),-
1071 this, qFlagLocation("1""columnResized(int,int,int)" "\0" __FILE__ ":" "1245"));-
1072 connect(d->horizontalHeader, qFlagLocation("2""sectionMoved(int,int,int)" "\0" __FILE__ ":" "1246"),-
1073 this, qFlagLocation("1""columnMoved(int,int,int)" "\0" __FILE__ ":" "1247"));-
1074 connect(d->horizontalHeader, qFlagLocation("2""sectionCountChanged(int,int)" "\0" __FILE__ ":" "1248"),-
1075 this, qFlagLocation("1""columnCountChanged(int,int)" "\0" __FILE__ ":" "1249"));-
1076 connect(d->horizontalHeader, qFlagLocation("2""sectionPressed(int)" "\0" __FILE__ ":" "1250"), this, qFlagLocation("1""selectColumn(int)" "\0" __FILE__ ":" "1250"));-
1077 connect(d->horizontalHeader, qFlagLocation("2""sectionEntered(int)" "\0" __FILE__ ":" "1251"), this, qFlagLocation("1""_q_selectColumn(int)" "\0" __FILE__ ":" "1251"));-
1078 connect(d->horizontalHeader, qFlagLocation("2""sectionHandleDoubleClicked(int)" "\0" __FILE__ ":" "1252"),-
1079 this, qFlagLocation("1""resizeColumnToContents(int)" "\0" __FILE__ ":" "1253"));-
1080 connect(d->horizontalHeader, qFlagLocation("2""geometriesChanged()" "\0" __FILE__ ":" "1254"), this, qFlagLocation("1""updateGeometries()" "\0" __FILE__ ":" "1254"));-
1081-
1082-
1083 setSortingEnabled(d->sortingEnabled);-
1084}
never executed: end of block
0
1085-
1086-
1087-
1088-
1089-
1090-
1091void QTableView::setVerticalHeader(QHeaderView *header)-
1092{-
1093 QTableViewPrivate * const d = d_func();-
1094-
1095 if (!header
!headerDescription
TRUEnever evaluated
FALSEnever evaluated
|| header == d->verticalHeader
header == d->verticalHeaderDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1096 return;
never executed: return;
0
1097 if (d->verticalHeader
d->verticalHeaderDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->verticalHeader->parent() == this
d->verticalHea...rent() == thisDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1098 delete d->verticalHeader;
never executed: delete d->verticalHeader;
0
1099 d->verticalHeader = header;-
1100 d->verticalHeader->setParent(this);-
1101 d->verticalHeader->d_func()->setAllowUserMoveOfSection0(true);-
1102 if (!d->verticalHeader->model()
!d->verticalHeader->model()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1103 d->verticalHeader->setModel(d->model);-
1104 if (d->selectionModel
d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1105 d->verticalHeader->setSelectionModel(d->selectionModel);
never executed: d->verticalHeader->setSelectionModel(d->selectionModel);
0
1106 }
never executed: end of block
0
1107-
1108 connect(d->verticalHeader, qFlagLocation("2""sectionResized(int,int,int)" "\0" __FILE__ ":" "1282"),-
1109 this, qFlagLocation("1""rowResized(int,int,int)" "\0" __FILE__ ":" "1283"));-
1110 connect(d->verticalHeader, qFlagLocation("2""sectionMoved(int,int,int)" "\0" __FILE__ ":" "1284"),-
1111 this, qFlagLocation("1""rowMoved(int,int,int)" "\0" __FILE__ ":" "1285"));-
1112 connect(d->verticalHeader, qFlagLocation("2""sectionCountChanged(int,int)" "\0" __FILE__ ":" "1286"),-
1113 this, qFlagLocation("1""rowCountChanged(int,int)" "\0" __FILE__ ":" "1287"));-
1114 connect(d->verticalHeader, qFlagLocation("2""sectionPressed(int)" "\0" __FILE__ ":" "1288"), this, qFlagLocation("1""selectRow(int)" "\0" __FILE__ ":" "1288"));-
1115 connect(d->verticalHeader, qFlagLocation("2""sectionEntered(int)" "\0" __FILE__ ":" "1289"), this, qFlagLocation("1""_q_selectRow(int)" "\0" __FILE__ ":" "1289"));-
1116 connect(d->verticalHeader, qFlagLocation("2""sectionHandleDoubleClicked(int)" "\0" __FILE__ ":" "1290"),-
1117 this, qFlagLocation("1""resizeRowToContents(int)" "\0" __FILE__ ":" "1291"));-
1118 connect(d->verticalHeader, qFlagLocation("2""geometriesChanged()" "\0" __FILE__ ":" "1292"), this, qFlagLocation("1""updateGeometries()" "\0" __FILE__ ":" "1292"));-
1119}
never executed: end of block
0
1120-
1121-
1122-
1123-
1124-
1125-
1126void QTableView::scrollContentsBy(int dx, int dy)-
1127{-
1128 QTableViewPrivate * const d = d_func();-
1129-
1130 d->delayedAutoScroll.stop();-
1131-
1132 dx = isRightToLeft()
isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
? -dx : dx;
0
1133 if (dx
dxDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1134 int oldOffset = d->horizontalHeader->offset();-
1135 d->horizontalHeader->d_func()->setScrollOffset(horizontalScrollBar(), horizontalScrollMode());-
1136 if (horizontalScrollMode() == QAbstractItemView::ScrollPerItem
horizontalScro...:ScrollPerItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1137 int newOffset = d->horizontalHeader->offset();-
1138 dx = isRightToLeft()
isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
? newOffset - oldOffset : oldOffset - newOffset;
0
1139 }
never executed: end of block
0
1140 }
never executed: end of block
0
1141 if (dy
dyDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1142 int oldOffset = d->verticalHeader->offset();-
1143 d->verticalHeader->d_func()->setScrollOffset(verticalScrollBar(), verticalScrollMode());-
1144 if (verticalScrollMode() == QAbstractItemView::ScrollPerItem
verticalScroll...:ScrollPerItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1145 int newOffset = d->verticalHeader->offset();-
1146 dy = oldOffset - newOffset;-
1147 }
never executed: end of block
0
1148 }
never executed: end of block
0
1149 d->scrollContentsBy(dx, dy);-
1150-
1151 if (d->showGrid
d->showGridDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1152-
1153-
1154-
1155 if (dy > 0
dy > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& d->horizontalHeader->isHidden()
d->horizontalH...er->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
&& d->verticalScrollMode == ScrollPerItem
d->verticalScr... ScrollPerItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1156 d->viewport->update(0, dy, d->viewport->width(), dy);-
1157 }
never executed: end of block
0
1158 if (dx > 0
dx > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& d->verticalHeader->isHidden()
d->verticalHeader->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
&& d->horizontalScrollMode == ScrollPerItem
d->horizontalS... ScrollPerItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1159 d->viewport->update(dx, 0, dx, d->viewport->height());-
1160 }
never executed: end of block
0
1161 }
never executed: end of block
0
1162}
never executed: end of block
0
1163-
1164-
1165-
1166-
1167QStyleOptionViewItem QTableView::viewOptions() const-
1168{-
1169 QStyleOptionViewItem option = QAbstractItemView::viewOptions();-
1170 option.showDecorationSelected = true;-
1171 return
never executed: return option;
option;
never executed: return option;
0
1172}-
1173-
1174-
1175-
1176-
1177void QTableView::paintEvent(QPaintEvent *event)-
1178{-
1179 QTableViewPrivate * const d = d_func();-
1180-
1181 QStyleOptionViewItem option = d->viewOptionsV1();-
1182 const QPoint offset = d->scrollDelayOffset;-
1183 const bool showGrid = d->showGrid;-
1184 const int gridSize = showGrid
showGridDescription
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0;
0
1185 const int gridHint = style()->styleHint(QStyle::SH_Table_GridLineColor, &option, this);-
1186 const QColor gridColor = static_cast<QRgb>(gridHint);-
1187 const QPen gridPen = QPen(gridColor, 0, d->gridStyle);-
1188 const QHeaderView *verticalHeader = d->verticalHeader;-
1189 const QHeaderView *horizontalHeader = d->horizontalHeader;-
1190 const bool alternate = d->alternatingColors;-
1191 const bool rightToLeft = isRightToLeft();-
1192-
1193 QPainter painter(d->viewport);-
1194-
1195-
1196 if (horizontalHeader->count() == 0
horizontalHeader->count() == 0Description
TRUEnever evaluated
FALSEnever evaluated
|| verticalHeader->count() == 0
verticalHeader->count() == 0Description
TRUEnever evaluated
FALSEnever evaluated
|| !d->itemDelegate
!d->itemDelegateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1197 return;
never executed: return;
0
1198-
1199 uint x = horizontalHeader->length() - horizontalHeader->offset() - (rightToLeft
rightToLeftDescription
TRUEnever evaluated
FALSEnever evaluated
? 0 : 1);
0
1200 uint y = verticalHeader->length() - verticalHeader->offset() - 1;-
1201-
1202-
1203-
1204 int firstVisualRow = qMax(verticalHeader->visualIndexAt(0),0);-
1205 int lastVisualRow = verticalHeader->visualIndexAt(verticalHeader->viewport()->height());-
1206 if (lastVisualRow == -1
lastVisualRow == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1207 lastVisualRow = d->model->rowCount(d->root) - 1;
never executed: lastVisualRow = d->model->rowCount(d->root) - 1;
0
1208-
1209 int firstVisualColumn = horizontalHeader->visualIndexAt(0);-
1210 int lastVisualColumn = horizontalHeader->visualIndexAt(horizontalHeader->viewport()->width());-
1211 if (rightToLeft
rightToLeftDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1212 qSwap(firstVisualColumn, lastVisualColumn);
never executed: qSwap(firstVisualColumn, lastVisualColumn);
0
1213 if (firstVisualColumn == -1
firstVisualColumn == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1214 firstVisualColumn = 0;
never executed: firstVisualColumn = 0;
0
1215 if (lastVisualColumn == -1
lastVisualColumn == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1216 lastVisualColumn = horizontalHeader->count() - 1;
never executed: lastVisualColumn = horizontalHeader->count() - 1;
0
1217-
1218 QBitArray drawn((lastVisualRow - firstVisualRow + 1) * (lastVisualColumn - firstVisualColumn + 1));-
1219-
1220 const QRegion region = event->region().translated(offset);-
1221-
1222 if (d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1223 d->drawAndClipSpans(region, &painter, option, &drawn,-
1224 firstVisualRow, lastVisualRow, firstVisualColumn, lastVisualColumn);-
1225 }
never executed: end of block
0
1226-
1227 const QVector<QRect> rects = region.rects();-
1228 for (auto dirtyArea : rects) {-
1229 dirtyArea.setBottom(qMin(dirtyArea.bottom(), int(y)));-
1230 if (rightToLeft
rightToLeftDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1231 dirtyArea.setLeft(qMax(dirtyArea.left(), d->viewport->width() - int(x)));-
1232 }
never executed: end of block
else {
0
1233 dirtyArea.setRight(qMin(dirtyArea.right(), int(x)));-
1234 }
never executed: end of block
0
1235-
1236-
1237 int left = horizontalHeader->visualIndexAt(dirtyArea.left());-
1238 int right = horizontalHeader->visualIndexAt(dirtyArea.right());-
1239 if (rightToLeft
rightToLeftDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1240 qSwap(left, right);
never executed: qSwap(left, right);
0
1241 if (left == -1
left == -1Description
TRUEnever evaluated
FALSEnever evaluated
) left = 0;
never executed: left = 0;
0
1242 if (right == -1
right == -1Description
TRUEnever evaluated
FALSEnever evaluated
) right = horizontalHeader->count() - 1;
never executed: right = horizontalHeader->count() - 1;
0
1243-
1244-
1245 int bottom = verticalHeader->visualIndexAt(dirtyArea.bottom());-
1246 if (bottom == -1
bottom == -1Description
TRUEnever evaluated
FALSEnever evaluated
) bottom = verticalHeader->count() - 1;
never executed: bottom = verticalHeader->count() - 1;
0
1247 int top = 0;-
1248 bool alternateBase = false;-
1249 if (alternate
alternateDescription
TRUEnever evaluated
FALSEnever evaluated
&& verticalHeader->sectionsHidden()
verticalHeader...ctionsHidden()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1250 uint verticalOffset = verticalHeader->offset();-
1251 int row = verticalHeader->logicalIndex(top);-
1252 for (int y = 0;-
1253 ((
((uint)(y += v...erticalOffset)Description
TRUEnever evaluated
FALSEnever evaluated
uint)(y += verticalHeader->sectionSize(top)) <= verticalOffset)
((uint)(y += v...erticalOffset)Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(top < bottom)Description
TRUEnever evaluated
FALSEnever evaluated
top < bottom)
(top < bottom)Description
TRUEnever evaluated
FALSEnever evaluated
;
0
1254 ++top) {-
1255 row = verticalHeader->logicalIndex(top);-
1256 if (alternate
alternateDescription
TRUEnever evaluated
FALSEnever evaluated
&& !verticalHeader->isSectionHidden(row)
!verticalHeade...ionHidden(row)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1257 alternateBase = !alternateBase;
never executed: alternateBase = !alternateBase;
0
1258 }
never executed: end of block
0
1259 }
never executed: end of block
else {
0
1260 top = verticalHeader->visualIndexAt(dirtyArea.top());-
1261 alternateBase = (
(top & 1)Description
TRUEnever evaluated
FALSEnever evaluated
top & 1)
(top & 1)Description
TRUEnever evaluated
FALSEnever evaluated
&& alternate
alternateDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
1262 }
never executed: end of block
0
1263 if (top == -1
top == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| top > bottom
top > bottomDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1264 continue;
never executed: continue;
0
1265-
1266-
1267 for (int visualRowIndex = top; visualRowIndex <= bottom
visualRowIndex <= bottomDescription
TRUEnever evaluated
FALSEnever evaluated
; ++visualRowIndex) {
0
1268 int row = verticalHeader->logicalIndex(visualRowIndex);-
1269 if (verticalHeader->isSectionHidden(row)
verticalHeader...ionHidden(row)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1270 continue;
never executed: continue;
0
1271 int rowY = rowViewportPosition(row);-
1272 rowY += offset.y();-
1273 int rowh = rowHeight(row) - gridSize;-
1274-
1275-
1276 for (int visualColumnIndex = left; visualColumnIndex <= right
visualColumnIndex <= rightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++visualColumnIndex) {
0
1277 int currentBit = (visualRowIndex - firstVisualRow) * (lastVisualColumn - firstVisualColumn + 1)-
1278 + visualColumnIndex - firstVisualColumn;-
1279-
1280 if (currentBit < 0
currentBit < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| currentBit >= drawn.size()
currentBit >= drawn.size()Description
TRUEnever evaluated
FALSEnever evaluated
|| drawn.testBit(currentBit)
drawn.testBit(currentBit)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1281 continue;
never executed: continue;
0
1282 drawn.setBit(currentBit);-
1283-
1284 int col = horizontalHeader->logicalIndex(visualColumnIndex);-
1285 if (horizontalHeader->isSectionHidden(col)
horizontalHead...ionHidden(col)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1286 continue;
never executed: continue;
0
1287 int colp = columnViewportPosition(col);-
1288 colp += offset.x();-
1289 int colw = columnWidth(col) - gridSize;-
1290-
1291 const QModelIndex index = d->model->index(row, col, d->root);-
1292 if (index.isValid()
index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1293 option.rect = QRect(colp + (showGrid && rightToLeft ? 1 : 0), rowY, colw, rowh);-
1294 if (alternate
alternateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1295 if (alternateBase
alternateBaseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1296 option.features |= QStyleOptionViewItem::Alternate;
never executed: option.features |= QStyleOptionViewItem::Alternate;
0
1297 else-
1298 option.features &= ~QStyleOptionViewItem::Alternate;
never executed: option.features &= ~QStyleOptionViewItem::Alternate;
0
1299 }-
1300 d->drawCell(&painter, option, index);-
1301 }
never executed: end of block
0
1302 }
never executed: end of block
0
1303 alternateBase = !alternateBase
!alternateBaseDescription
TRUEnever evaluated
FALSEnever evaluated
&& alternate
alternateDescription
TRUEnever evaluated
FALSEnever evaluated
;
0
1304 }
never executed: end of block
0
1305-
1306 if (showGrid
showGridDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1307-
1308 while (verticalHeader->isSectionHidden(verticalHeader->logicalIndex(bottom))
verticalHeader...Index(bottom))Description
TRUEnever evaluated
FALSEnever evaluated
) --
never executed: --bottom;
bottom;
never executed: --bottom;
0
1309 QPen old = painter.pen();-
1310 painter.setPen(gridPen);-
1311-
1312 for (int visualIndex = top; visualIndex <= bottom
visualIndex <= bottomDescription
TRUEnever evaluated
FALSEnever evaluated
; ++visualIndex) {
0
1313 int row = verticalHeader->logicalIndex(visualIndex);-
1314 if (verticalHeader->isSectionHidden(row)
verticalHeader...ionHidden(row)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1315 continue;
never executed: continue;
0
1316 int rowY = rowViewportPosition(row);-
1317 rowY += offset.y();-
1318 int rowh = rowHeight(row) - gridSize;-
1319 painter.drawLine(dirtyArea.left(), rowY + rowh, dirtyArea.right(), rowY + rowh);-
1320 }
never executed: end of block
0
1321-
1322-
1323 for (int h = left; h <= right
h <= rightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++h) {
0
1324 int col = horizontalHeader->logicalIndex(h);-
1325 if (horizontalHeader->isSectionHidden(col)
horizontalHead...ionHidden(col)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1326 continue;
never executed: continue;
0
1327 int colp = columnViewportPosition(col);-
1328 colp += offset.x();-
1329 if (!rightToLeft
!rightToLeftDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1330 colp += columnWidth(col) - gridSize;
never executed: colp += columnWidth(col) - gridSize;
0
1331 painter.drawLine(colp, dirtyArea.top(), colp, dirtyArea.bottom());-
1332 }
never executed: end of block
0
1333-
1334-
1335-
1336 if (horizontalHeader->isHidden()
horizontalHeader->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
&& verticalScrollMode() == ScrollPerItem
verticalScroll... ScrollPerItemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1337 painter.drawLine(dirtyArea.left(), 0, dirtyArea.right(), 0);
never executed: painter.drawLine(dirtyArea.left(), 0, dirtyArea.right(), 0);
0
1338 if (verticalHeader->isHidden()
verticalHeader->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
&& horizontalScrollMode() == ScrollPerItem
horizontalScro... ScrollPerItemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1339 painter.drawLine(0, dirtyArea.top(), 0, dirtyArea.bottom());
never executed: painter.drawLine(0, dirtyArea.top(), 0, dirtyArea.bottom());
0
1340 painter.setPen(old);-
1341 }
never executed: end of block
0
1342 }
never executed: end of block
0
1343-
1344-
1345-
1346 d->paintDropIndicator(&painter);-
1347-
1348}
never executed: end of block
0
1349-
1350-
1351-
1352-
1353-
1354QModelIndex QTableView::indexAt(const QPoint &pos) const-
1355{-
1356 const QTableViewPrivate * const d = d_func();-
1357 d->executePostedLayout();-
1358 int r = rowAt(pos.y());-
1359 int c = columnAt(pos.x());-
1360 if (r >= 0
r >= 0Description
TRUEnever evaluated
FALSEnever evaluated
&& c >= 0
c >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1361 if (d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1362 QSpanCollection::Span span = d->span(r, c);-
1363 r = span.top();-
1364 c = span.left();-
1365 }
never executed: end of block
0
1366 return
never executed: return d->model->index(r, c, d->root);
d->model->index(r, c, d->root);
never executed: return d->model->index(r, c, d->root);
0
1367 }-
1368 return
never executed: return QModelIndex();
QModelIndex();
never executed: return QModelIndex();
0
1369}-
1370int QTableView::horizontalOffset() const-
1371{-
1372 const QTableViewPrivate * const d = d_func();-
1373 return
never executed: return d->horizontalHeader->offset();
d->horizontalHeader->offset();
never executed: return d->horizontalHeader->offset();
0
1374}-
1375int QTableView::verticalOffset() const-
1376{-
1377 const QTableViewPrivate * const d = d_func();-
1378 return
never executed: return d->verticalHeader->offset();
d->verticalHeader->offset();
never executed: return d->verticalHeader->offset();
0
1379}-
1380QModelIndex QTableView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers)-
1381{-
1382 QTableViewPrivate * const d = d_func();-
1383 (void)modifiers;;-
1384-
1385 int bottom = d->model->rowCount(d->root) - 1;-
1386-
1387 while (bottom >= 0
bottom >= 0Description
TRUEnever evaluated
FALSEnever evaluated
&& isRowHidden(d->logicalRow(bottom))
isRowHidden(d-...alRow(bottom))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1388 --
never executed: --bottom;
bottom;
never executed: --bottom;
0
1389-
1390 int right = d->model->columnCount(d->root) - 1;-
1391-
1392 while (right >= 0
right >= 0Description
TRUEnever evaluated
FALSEnever evaluated
&& isColumnHidden(d->logicalColumn(right))
isColumnHidden...Column(right))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1393 --
never executed: --right;
right;
never executed: --right;
0
1394-
1395 if (bottom == -1
bottom == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| right == -1
right == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1396 return
never executed: return QModelIndex();
QModelIndex();
never executed: return QModelIndex();
0
1397-
1398 QModelIndex current = currentIndex();-
1399-
1400 if (!current.isValid()
!current.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1401 int row = 0;-
1402 int column = 0;-
1403 while (column < right
column < rightDescription
TRUEnever evaluated
FALSEnever evaluated
&& isColumnHidden(d->logicalColumn(column))
isColumnHidden...olumn(column))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1404 ++
never executed: ++column;
column;
never executed: ++column;
0
1405 while (isRowHidden(d->logicalRow(row))
isRowHidden(d-...gicalRow(row))Description
TRUEnever evaluated
FALSEnever evaluated
&& row < bottom
row < bottomDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1406 ++
never executed: ++row;
row;
never executed: ++row;
0
1407 d->visualCursor = QPoint(column, row);-
1408 return
never executed: return d->model->index(d->logicalRow(row), d->logicalColumn(column), d->root);
d->model->index(d->logicalRow(row), d->logicalColumn(column), d->root);
never executed: return d->model->index(d->logicalRow(row), d->logicalColumn(column), d->root);
0
1409 }-
1410-
1411-
1412 QPoint visualCurrent(d->visualColumn(current.column()), d->visualRow(current.row()));-
1413 if (visualCurrent != d->visualCursor
visualCurrent ...->visualCursorDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1414 if (d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1415 QSpanCollection::Span span = d->span(current.row(), current.column());-
1416 if (span.top() > d->visualCursor.y()
span.top() > d...sualCursor.y()Description
TRUEnever evaluated
FALSEnever evaluated
|| d->visualCursor.y() > span.bottom()
d->visualCurso... span.bottom()Description
TRUEnever evaluated
FALSEnever evaluated
0
1417 || span.left() > d->visualCursor.x()
span.left() > ...sualCursor.x()Description
TRUEnever evaluated
FALSEnever evaluated
|| d->visualCursor.x() > span.right()
d->visualCurso...> span.right()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1418 d->visualCursor = visualCurrent;
never executed: d->visualCursor = visualCurrent;
0
1419 }
never executed: end of block
else {
0
1420 d->visualCursor = visualCurrent;-
1421 }
never executed: end of block
0
1422 }-
1423-
1424 int visualRow = d->visualCursor.y();-
1425 if (visualRow > bottom
visualRow > bottomDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1426 visualRow = bottom;
never executed: visualRow = bottom;
0
1427 ((!(visualRow != -1)) ? qt_assert("visualRow != -1",__FILE__,1628) : qt_noop());-
1428 int visualColumn = d->visualCursor.x();-
1429 if (visualColumn > right
visualColumn > rightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1430 visualColumn = right;
never executed: visualColumn = right;
0
1431 ((!(visualColumn != -1)) ? qt_assert("visualColumn != -1",__FILE__,1632) : qt_noop());-
1432-
1433 if (isRightToLeft()
isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1434 if (cursorAction == MoveLeft
cursorAction == MoveLeftDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1435 cursorAction = MoveRight;
never executed: cursorAction = MoveRight;
0
1436 else if (cursorAction == MoveRight
cursorAction == MoveRightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1437 cursorAction = MoveLeft;
never executed: cursorAction = MoveLeft;
0
1438 }
never executed: end of block
0
1439-
1440 switch (cursorAction) {-
1441 case
never executed: case MoveUp:
MoveUp:
never executed: case MoveUp:
{
0
1442 int originalRow = visualRow;-
1443-
1444-
1445-
1446-
1447-
1448 int r = d->logicalRow(visualRow);-
1449 int c = d->logicalColumn(visualColumn);-
1450 if (r != -1
r != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1451 QSpanCollection::Span span = d->span(r, c);-
1452 if (span.width() > 1
span.width() > 1Description
TRUEnever evaluated
FALSEnever evaluated
|| span.height() > 1
span.height() > 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1453 visualRow = d->visualRow(span.top());
never executed: visualRow = d->visualRow(span.top());
0
1454 }
never executed: end of block
0
1455 while (visualRow >= 0
visualRow >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1456 --visualRow;-
1457 r = d->logicalRow(visualRow);-
1458 c = d->logicalColumn(visualColumn);-
1459 if (r == -1
r == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| (!isRowHidden(r)
!isRowHidden(r)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->isCellEnabled(r, c)
d->isCellEnabled(r, c)Description
TRUEnever evaluated
FALSEnever evaluated
))
0
1460 break;
never executed: break;
0
1461 }
never executed: end of block
0
1462 if (visualRow < 0
visualRow < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1463 visualRow = originalRow;
never executed: visualRow = originalRow;
0
1464 break;
never executed: break;
0
1465 }-
1466 case
never executed: case MoveDown:
MoveDown:
never executed: case MoveDown:
{
0
1467 int originalRow = visualRow;-
1468 if (d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1469 QSpanCollection::Span span = d->span(current.row(), current.column());-
1470 visualRow = d->visualRow(d->rowSpanEndLogical(span.top(), span.height()));-
1471 }
never executed: end of block
0
1472-
1473-
1474-
1475-
1476 int r = d->logicalRow(visualRow);-
1477 int c = d->logicalColumn(visualColumn);-
1478 if (r != -1
r != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1479 QSpanCollection::Span span = d->span(r, c);-
1480 if (span.width() > 1
span.width() > 1Description
TRUEnever evaluated
FALSEnever evaluated
|| span.height() > 1
span.height() > 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1481 visualRow = d->visualRow(d->rowSpanEndLogical(span.top(), span.height()));
never executed: visualRow = d->visualRow(d->rowSpanEndLogical(span.top(), span.height()));
0
1482 }
never executed: end of block
0
1483 while (visualRow <= bottom
visualRow <= bottomDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1484 ++visualRow;-
1485 r = d->logicalRow(visualRow);-
1486 c = d->logicalColumn(visualColumn);-
1487 if (r == -1
r == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| (!isRowHidden(r)
!isRowHidden(r)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->isCellEnabled(r, c)
d->isCellEnabled(r, c)Description
TRUEnever evaluated
FALSEnever evaluated
))
0
1488 break;
never executed: break;
0
1489 }
never executed: end of block
0
1490 if (visualRow > bottom
visualRow > bottomDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1491 visualRow = originalRow;
never executed: visualRow = originalRow;
0
1492 break;
never executed: break;
0
1493 }-
1494 case
never executed: case MovePrevious:
MovePrevious:
never executed: case MovePrevious:
0
1495 case
never executed: case MoveLeft:
MoveLeft:
never executed: case MoveLeft:
{
0
1496 int originalRow = visualRow;-
1497 int originalColumn = visualColumn;-
1498 bool firstTime = true;-
1499 bool looped = false;-
1500 bool wrapped = false;-
1501 do {-
1502 int r = d->logicalRow(visualRow);-
1503 int c = d->logicalColumn(visualColumn);-
1504 if (firstTime
firstTimeDescription
TRUEnever evaluated
FALSEnever evaluated
&& c != -1
c != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1505 firstTime = false;-
1506 QSpanCollection::Span span = d->span(r, c);-
1507 if (span.width() > 1
span.width() > 1Description
TRUEnever evaluated
FALSEnever evaluated
|| span.height() > 1
span.height() > 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1508 visualColumn = d->visualColumn(span.left());
never executed: visualColumn = d->visualColumn(span.left());
0
1509 }
never executed: end of block
0
1510 while (visualColumn >= 0
visualColumn >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1511 --visualColumn;-
1512 r = d->logicalRow(visualRow);-
1513 c = d->logicalColumn(visualColumn);-
1514 if (r == -1
r == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| c == -1
c == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| (!isRowHidden(r)
!isRowHidden(r)Description
TRUEnever evaluated
FALSEnever evaluated
&& !isColumnHidden(c)
!isColumnHidden(c)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->isCellEnabled(r, c)
d->isCellEnabled(r, c)Description
TRUEnever evaluated
FALSEnever evaluated
))
0
1515 break;
never executed: break;
0
1516 if (wrapped
wrappedDescription
TRUEnever evaluated
FALSEnever evaluated
&& (originalRow < visualRow
originalRow < visualRowDescription
TRUEnever evaluated
FALSEnever evaluated
|| (originalRow == visualRow
originalRow == visualRowDescription
TRUEnever evaluated
FALSEnever evaluated
&& originalColumn <= visualColumn
originalColumn <= visualColumnDescription
TRUEnever evaluated
FALSEnever evaluated
))) {
0
1517 looped = true;-
1518 break;
never executed: break;
0
1519 }-
1520 }
never executed: end of block
0
1521 if (cursorAction == MoveLeft
cursorAction == MoveLeftDescription
TRUEnever evaluated
FALSEnever evaluated
|| visualColumn >= 0
visualColumn >= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1522 break;
never executed: break;
0
1523 visualColumn = right + 1;-
1524 if (visualRow == 0
visualRow == 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1525 wrapped = true;-
1526 visualRow = bottom;-
1527 }
never executed: end of block
else {
0
1528 --visualRow;-
1529 }
never executed: end of block
0
1530 } while (!looped
!loopedDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
1531 if (visualColumn < 0
visualColumn < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1532 visualColumn = originalColumn;
never executed: visualColumn = originalColumn;
0
1533 break;
never executed: break;
0
1534 }-
1535 case
never executed: case MoveNext:
MoveNext:
never executed: case MoveNext:
0
1536 case
never executed: case MoveRight:
MoveRight:
never executed: case MoveRight:
{
0
1537 int originalRow = visualRow;-
1538 int originalColumn = visualColumn;-
1539 bool firstTime = true;-
1540 bool looped = false;-
1541 bool wrapped = false;-
1542 do {-
1543 int r = d->logicalRow(visualRow);-
1544 int c = d->logicalColumn(visualColumn);-
1545 if (firstTime
firstTimeDescription
TRUEnever evaluated
FALSEnever evaluated
&& c != -1
c != -1Description
TRUEnever evaluated
FALSEnever evaluated
&& d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1546 firstTime = false;-
1547 QSpanCollection::Span span = d->span(r, c);-
1548 if (span.width() > 1
span.width() > 1Description
TRUEnever evaluated
FALSEnever evaluated
|| span.height() > 1
span.height() > 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1549 visualColumn = d->visualColumn(d->columnSpanEndLogical(span.left(), span.width()));
never executed: visualColumn = d->visualColumn(d->columnSpanEndLogical(span.left(), span.width()));
0
1550 }
never executed: end of block
0
1551 while (visualColumn <= right
visualColumn <= rightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1552 ++visualColumn;-
1553 r = d->logicalRow(visualRow);-
1554 c = d->logicalColumn(visualColumn);-
1555 if (r == -1
r == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| c == -1
c == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| (!isRowHidden(r)
!isRowHidden(r)Description
TRUEnever evaluated
FALSEnever evaluated
&& !isColumnHidden(c)
!isColumnHidden(c)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->isCellEnabled(r, c)
d->isCellEnabled(r, c)Description
TRUEnever evaluated
FALSEnever evaluated
))
0
1556 break;
never executed: break;
0
1557 if (wrapped
wrappedDescription
TRUEnever evaluated
FALSEnever evaluated
&& (originalRow > visualRow
originalRow > visualRowDescription
TRUEnever evaluated
FALSEnever evaluated
|| (originalRow == visualRow
originalRow == visualRowDescription
TRUEnever evaluated
FALSEnever evaluated
&& originalColumn >= visualColumn
originalColumn >= visualColumnDescription
TRUEnever evaluated
FALSEnever evaluated
))) {
0
1558 looped = true;-
1559 break;
never executed: break;
0
1560 }-
1561 }
never executed: end of block
0
1562 if (cursorAction == MoveRight
cursorAction == MoveRightDescription
TRUEnever evaluated
FALSEnever evaluated
|| visualColumn <= right
visualColumn <= rightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1563 break;
never executed: break;
0
1564 visualColumn = -1;-
1565 if (visualRow == bottom
visualRow == bottomDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1566 wrapped = true;-
1567 visualRow = 0;-
1568 }
never executed: end of block
else {
0
1569 ++visualRow;-
1570 }
never executed: end of block
0
1571 } while (!looped
!loopedDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
1572 if (visualColumn > right
visualColumn > rightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1573 visualColumn = originalColumn;
never executed: visualColumn = originalColumn;
0
1574 break;
never executed: break;
0
1575 }-
1576 case
never executed: case MoveHome:
MoveHome:
never executed: case MoveHome:
0
1577 visualColumn = 0;-
1578 while (visualColumn < right
visualColumn < rightDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->isVisualColumnHiddenOrDisabled(visualRow, visualColumn)
d->isVisualCol... visualColumn)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1579 ++
never executed: ++visualColumn;
visualColumn;
never executed: ++visualColumn;
0
1580 if (modifiers & Qt::ControlModifier
modifiers & Qt...ontrolModifierDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1581 visualRow = 0;-
1582 while (visualRow < bottom
visualRow < bottomDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->isVisualRowHiddenOrDisabled(visualRow, visualColumn)
d->isVisualRow... visualColumn)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1583 ++
never executed: ++visualRow;
visualRow;
never executed: ++visualRow;
0
1584 }
never executed: end of block
0
1585 break;
never executed: break;
0
1586 case
never executed: case MoveEnd:
MoveEnd:
never executed: case MoveEnd:
0
1587 visualColumn = right;-
1588 if (modifiers & Qt::ControlModifier
modifiers & Qt...ontrolModifierDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1589 visualRow = bottom;
never executed: visualRow = bottom;
0
1590 break;
never executed: break;
0
1591 case
never executed: case MovePageUp:
MovePageUp:
never executed: case MovePageUp:
{
0
1592 int newRow = rowAt(visualRect(current).bottom() - d->viewport->height());-
1593 if (newRow == -1
newRow == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1594 newRow = d->logicalRow(0);
never executed: newRow = d->logicalRow(0);
0
1595 return
never executed: return d->model->index(newRow, current.column(), d->root);
d->model->index(newRow, current.column(), d->root);
never executed: return d->model->index(newRow, current.column(), d->root);
0
1596 }-
1597 case
never executed: case MovePageDown:
MovePageDown:
never executed: case MovePageDown:
{
0
1598 int newRow = rowAt(visualRect(current).top() + d->viewport->height());-
1599 if (newRow == -1
newRow == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1600 newRow = d->logicalRow(bottom);
never executed: newRow = d->logicalRow(bottom);
0
1601 return
never executed: return d->model->index(newRow, current.column(), d->root);
d->model->index(newRow, current.column(), d->root);
never executed: return d->model->index(newRow, current.column(), d->root);
0
1602 }}-
1603-
1604 d->visualCursor = QPoint(visualColumn, visualRow);-
1605 int logicalRow = d->logicalRow(visualRow);-
1606 int logicalColumn = d->logicalColumn(visualColumn);-
1607 if (!d->model->hasIndex(logicalRow, logicalColumn, d->root)
!d->model->has...lumn, d->root)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1608 return
never executed: return QModelIndex();
QModelIndex();
never executed: return QModelIndex();
0
1609-
1610 QModelIndex result = d->model->index(logicalRow, logicalColumn, d->root);-
1611 if (!d->isRowHidden(logicalRow)
!d->isRowHidden(logicalRow)Description
TRUEnever evaluated
FALSEnever evaluated
&& !d->isColumnHidden(logicalColumn)
!d->isColumnHi...logicalColumn)Description
TRUEnever evaluated
FALSEnever evaluated
&& d->isIndexEnabled(result)
d->isIndexEnabled(result)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1612 if (d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1613 QSpanCollection::Span span = d->span(result.row(), result.column());-
1614 if (span.width() > 1
span.width() > 1Description
TRUEnever evaluated
FALSEnever evaluated
|| span.height() > 1
span.height() > 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1615 result = d->model->sibling(span.top(), span.left(), result);-
1616 }
never executed: end of block
0
1617 }
never executed: end of block
0
1618 return
never executed: return result;
result;
never executed: return result;
0
1619 }-
1620-
1621 return
never executed: return QModelIndex();
QModelIndex();
never executed: return QModelIndex();
0
1622}-
1623void QTableView::setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command)-
1624{-
1625 QTableViewPrivate * const d = d_func();-
1626 QModelIndex tl = indexAt(QPoint(isRightToLeft() ? qMax(rect.left(), rect.right())-
1627 : qMin(rect.left(), rect.right()), qMin(rect.top(), rect.bottom())));-
1628 QModelIndex br = indexAt(QPoint(isRightToLeft() ? qMin(rect.left(), rect.right()) :-
1629 qMax(rect.left(), rect.right()), qMax(rect.top(), rect.bottom())));-
1630 if (!d->selectionModel
!d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
|| !tl.isValid()
!tl.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
|| !br.isValid()
!br.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
|| !d->isIndexEnabled(tl)
!d->isIndexEnabled(tl)Description
TRUEnever evaluated
FALSEnever evaluated
|| !d->isIndexEnabled(br)
!d->isIndexEnabled(br)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1631 return;
never executed: return;
0
1632-
1633 bool verticalMoved = verticalHeader()->sectionsMoved();-
1634 bool horizontalMoved = horizontalHeader()->sectionsMoved();-
1635-
1636 QItemSelection selection;-
1637-
1638 if (d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1639 bool expanded;-
1640 int top = qMin(d->visualRow(tl.row()), d->visualRow(br.row()));-
1641 int left = qMin(d->visualColumn(tl.column()), d->visualColumn(br.column()));-
1642 int bottom = qMax(d->visualRow(tl.row()), d->visualRow(br.row()));-
1643 int right = qMax(d->visualColumn(tl.column()), d->visualColumn(br.column()));-
1644 do {-
1645 expanded = false;-
1646 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(d->spans.spans)>::type> _container_((d->spans.spans)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QSpanCollection::Span *it = *_container_.i; _container_.control; _container_.control = 0) {-
1647 const QSpanCollection::Span &span = *it;-
1648 int t = d->visualRow(span.top());-
1649 int l = d->visualColumn(span.left());-
1650 int b = d->visualRow(d->rowSpanEndLogical(span.top(), span.height()));-
1651 int r = d->visualColumn(d->columnSpanEndLogical(span.left(), span.width()));-
1652 if ((
(t > bottom)Description
TRUEnever evaluated
FALSEnever evaluated
t > bottom)
(t > bottom)Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(l > right)Description
TRUEnever evaluated
FALSEnever evaluated
l > right)
(l > right)Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(top > b)Description
TRUEnever evaluated
FALSEnever evaluated
top > b)
(top > b)Description
TRUEnever evaluated
FALSEnever evaluated
|| (
(left > r)Description
TRUEnever evaluated
FALSEnever evaluated
left > r)
(left > r)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1653 continue;
never executed: continue;
0
1654 if (t < top
t < topDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1655 top = t;-
1656 expanded = true;-
1657 }
never executed: end of block
0
1658 if (l < left
l < leftDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1659 left = l;-
1660 expanded = true;-
1661 }
never executed: end of block
0
1662 if (b > bottom
b > bottomDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1663 bottom = b;-
1664 expanded = true;-
1665 }
never executed: end of block
0
1666 if (r > right
r > rightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1667 right = r;-
1668 expanded = true;-
1669 }
never executed: end of block
0
1670 if (expanded
expandedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1671 break;
never executed: break;
0
1672 }
never executed: end of block
0
1673 }
never executed: end of block
while (expanded
expandedDescription
TRUEnever evaluated
FALSEnever evaluated
);
0
1674 selection.reserve((right - left + 1) * (bottom - top + 1));-
1675 for (int horizontal = left; horizontal <= right
horizontal <= rightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++horizontal) {
0
1676 int column = d->logicalColumn(horizontal);-
1677 for (int vertical = top; vertical <= bottom
vertical <= bottomDescription
TRUEnever evaluated
FALSEnever evaluated
; ++vertical) {
0
1678 int row = d->logicalRow(vertical);-
1679 QModelIndex index = d->model->index(row, column, d->root);-
1680 selection.append(QItemSelectionRange(index));-
1681 }
never executed: end of block
0
1682 }
never executed: end of block
0
1683 }
never executed: end of block
else if (verticalMoved
verticalMovedDescription
TRUEnever evaluated
FALSEnever evaluated
&& horizontalMoved
horizontalMovedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1684 int top = d->visualRow(tl.row());-
1685 int left = d->visualColumn(tl.column());-
1686 int bottom = d->visualRow(br.row());-
1687 int right = d->visualColumn(br.column());-
1688 selection.reserve((right - left + 1) * (bottom - top + 1));-
1689 for (int horizontal = left; horizontal <= right
horizontal <= rightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++horizontal) {
0
1690 int column = d->logicalColumn(horizontal);-
1691 for (int vertical = top; vertical <= bottom
vertical <= bottomDescription
TRUEnever evaluated
FALSEnever evaluated
; ++vertical) {
0
1692 int row = d->logicalRow(vertical);-
1693 QModelIndex index = d->model->index(row, column, d->root);-
1694 selection.append(QItemSelectionRange(index));-
1695 }
never executed: end of block
0
1696 }
never executed: end of block
0
1697 }
never executed: end of block
else if (horizontalMoved
horizontalMovedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1698 int left = d->visualColumn(tl.column());-
1699 int right = d->visualColumn(br.column());-
1700 selection.reserve(right - left + 1);-
1701 for (int visual = left; visual <= right
visual <= rightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++visual) {
0
1702 int column = d->logicalColumn(visual);-
1703 QModelIndex topLeft = d->model->index(tl.row(), column, d->root);-
1704 QModelIndex bottomRight = d->model->index(br.row(), column, d->root);-
1705 selection.append(QItemSelectionRange(topLeft, bottomRight));-
1706 }
never executed: end of block
0
1707 }
never executed: end of block
else if (verticalMoved
verticalMovedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1708 int top = d->visualRow(tl.row());-
1709 int bottom = d->visualRow(br.row());-
1710 selection.reserve(bottom - top + 1);-
1711 for (int visual = top; visual <= bottom
visual <= bottomDescription
TRUEnever evaluated
FALSEnever evaluated
; ++visual) {
0
1712 int row = d->logicalRow(visual);-
1713 QModelIndex topLeft = d->model->index(row, tl.column(), d->root);-
1714 QModelIndex bottomRight = d->model->index(row, br.column(), d->root);-
1715 selection.append(QItemSelectionRange(topLeft, bottomRight));-
1716 }
never executed: end of block
0
1717 }
never executed: end of block
else {
0
1718 QItemSelectionRange range(tl, br);-
1719 if (!range.isEmpty()
!range.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1720 selection.append(range);
never executed: selection.append(range);
0
1721 }
never executed: end of block
0
1722-
1723 d->selectionModel->select(selection, command);-
1724}
never executed: end of block
0
1725QRegion QTableView::visualRegionForSelection(const QItemSelection &selection) const-
1726{-
1727 const QTableViewPrivate * const d = d_func();-
1728-
1729 if (selection.isEmpty()
selection.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1730 return
never executed: return QRegion();
QRegion();
never executed: return QRegion();
0
1731-
1732 QRegion selectionRegion;-
1733 const QRect &viewportRect = d->viewport->rect();-
1734 bool verticalMoved = verticalHeader()->sectionsMoved();-
1735 bool horizontalMoved = horizontalHeader()->sectionsMoved();-
1736-
1737 if ((verticalMoved
verticalMovedDescription
TRUEnever evaluated
FALSEnever evaluated
&& horizontalMoved
horizontalMovedDescription
TRUEnever evaluated
FALSEnever evaluated
) || (d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
&& (verticalMoved
verticalMovedDescription
TRUEnever evaluated
FALSEnever evaluated
|| horizontalMoved
horizontalMovedDescription
TRUEnever evaluated
FALSEnever evaluated
))) {
0
1738 for (const auto &range : selection) {-
1739 if (range.parent() != d->root
range.parent() != d->rootDescription
TRUEnever evaluated
FALSEnever evaluated
|| !range.isValid()
!range.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1740 continue;
never executed: continue;
0
1741 for (int r = range.top(); r <= range.bottom()
r <= range.bottom()Description
TRUEnever evaluated
FALSEnever evaluated
; ++r)
0
1742 for (int c = range.left(); c <= range.right()
c <= range.right()Description
TRUEnever evaluated
FALSEnever evaluated
; ++c) {
0
1743 const QRect &rangeRect = visualRect(d->model->index(r, c, d->root));-
1744 if (viewportRect.intersects(rangeRect)
viewportRect.i...cts(rangeRect)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1745 selectionRegion += rangeRect;
never executed: selectionRegion += rangeRect;
0
1746 }
never executed: end of block
0
1747 }
never executed: end of block
0
1748 }
never executed: end of block
else if (horizontalMoved
horizontalMovedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1749 for (const auto &range : selection) {-
1750 if (range.parent() != d->root
range.parent() != d->rootDescription
TRUEnever evaluated
FALSEnever evaluated
|| !range.isValid()
!range.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1751 continue;
never executed: continue;
0
1752 int top = rowViewportPosition(range.top());-
1753 int bottom = rowViewportPosition(range.bottom()) + rowHeight(range.bottom());-
1754 if (top > bottom
top > bottomDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1755 qSwap<int>(top, bottom);
never executed: qSwap<int>(top, bottom);
0
1756 int height = bottom - top;-
1757 for (int c = range.left(); c <= range.right()
c <= range.right()Description
TRUEnever evaluated
FALSEnever evaluated
; ++c) {
0
1758 const QRect rangeRect(columnViewportPosition(c), top, columnWidth(c), height);-
1759 if (viewportRect.intersects(rangeRect)
viewportRect.i...cts(rangeRect)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1760 selectionRegion += rangeRect;
never executed: selectionRegion += rangeRect;
0
1761 }
never executed: end of block
0
1762 }
never executed: end of block
0
1763 }
never executed: end of block
else if (verticalMoved
verticalMovedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1764 for (const auto &range : selection) {-
1765 if (range.parent() != d->root
range.parent() != d->rootDescription
TRUEnever evaluated
FALSEnever evaluated
|| !range.isValid()
!range.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1766 continue;
never executed: continue;
0
1767 int left = columnViewportPosition(range.left());-
1768 int right = columnViewportPosition(range.right()) + columnWidth(range.right());-
1769 if (left > right
left > rightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1770 qSwap<int>(left, right);
never executed: qSwap<int>(left, right);
0
1771 int width = right - left;-
1772 for (int r = range.top(); r <= range.bottom()
r <= range.bottom()Description
TRUEnever evaluated
FALSEnever evaluated
; ++r) {
0
1773 const QRect rangeRect(left, rowViewportPosition(r), width, rowHeight(r));-
1774 if (viewportRect.intersects(rangeRect)
viewportRect.i...cts(rangeRect)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1775 selectionRegion += rangeRect;
never executed: selectionRegion += rangeRect;
0
1776 }
never executed: end of block
0
1777 }
never executed: end of block
0
1778 }
never executed: end of block
else {
0
1779 const int gridAdjust = showGrid()
showGrid()Description
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0;
0
1780 for (auto range : selection) {-
1781 if (range.parent() != d->root
range.parent() != d->rootDescription
TRUEnever evaluated
FALSEnever evaluated
|| !range.isValid()
!range.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1782 continue;
never executed: continue;
0
1783 d->trimHiddenSelections(&range);-
1784-
1785 const int rtop = rowViewportPosition(range.top());-
1786 const int rbottom = rowViewportPosition(range.bottom()) + rowHeight(range.bottom());-
1787 int rleft;-
1788 int rright;-
1789 if (isLeftToRight()
isLeftToRight()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1790 rleft = columnViewportPosition(range.left());-
1791 rright = columnViewportPosition(range.right()) + columnWidth(range.right());-
1792 }
never executed: end of block
else {
0
1793 rleft = columnViewportPosition(range.right());-
1794 rright = columnViewportPosition(range.left()) + columnWidth(range.left());-
1795 }
never executed: end of block
0
1796 const QRect rangeRect(QPoint(rleft, rtop), QPoint(rright - 1 - gridAdjust, rbottom - 1 - gridAdjust));-
1797 if (viewportRect.intersects(rangeRect)
viewportRect.i...cts(rangeRect)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1798 selectionRegion += rangeRect;
never executed: selectionRegion += rangeRect;
0
1799 if (d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1800 const auto spansInRect = d->spans.spansInRect(range.left(), range.top(), range.width(), range.height());-
1801 for (QSpanCollection::Span *s : spansInRect) {-
1802 if (range.contains(s->top(), s->left(), range.parent())
range.contains...ange.parent())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1803 const QRect &visualSpanRect = d->visualSpanRect(*s);-
1804 if (viewportRect.intersects(visualSpanRect)
viewportRect.i...isualSpanRect)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1805 selectionRegion += visualSpanRect;
never executed: selectionRegion += visualSpanRect;
0
1806 }
never executed: end of block
0
1807 }
never executed: end of block
0
1808 }
never executed: end of block
0
1809 }
never executed: end of block
0
1810 }
never executed: end of block
0
1811-
1812 return
never executed: return selectionRegion;
selectionRegion;
never executed: return selectionRegion;
0
1813}-
1814-
1815-
1816-
1817-
1818-
1819QModelIndexList QTableView::selectedIndexes() const-
1820{-
1821 const QTableViewPrivate * const d = d_func();-
1822 QModelIndexList viewSelected;-
1823 QModelIndexList modelSelected;-
1824 if (d->selectionModel
d->selectionModelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1825 modelSelected = d->selectionModel->selectedIndexes();
never executed: modelSelected = d->selectionModel->selectedIndexes();
0
1826 for (int i = 0; i < modelSelected.count()
i < modelSelected.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1827 QModelIndex index = modelSelected.at(i);-
1828 if (!isIndexHidden(index)
!isIndexHidden(index)Description
TRUEnever evaluated
FALSEnever evaluated
&& index.parent() == d->root
index.parent() == d->rootDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1829 viewSelected.append(index);
never executed: viewSelected.append(index);
0
1830 }
never executed: end of block
0
1831 return
never executed: return viewSelected;
viewSelected;
never executed: return viewSelected;
0
1832}-
1833-
1834-
1835-
1836-
1837-
1838-
1839-
1840void QTableView::rowCountChanged(int oldCount, int newCount )-
1841{-
1842 QTableViewPrivate * const d = d_func();-
1843-
1844-
1845 if (newCount < oldCount
newCount < oldCountDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1846 d->verticalHeader->setUpdatesEnabled(false);
never executed: d->verticalHeader->setUpdatesEnabled(false);
0
1847 d->doDelayedItemsLayout();-
1848}
never executed: end of block
0
1849-
1850-
1851-
1852-
1853-
1854-
1855void QTableView::columnCountChanged(int, int)-
1856{-
1857 QTableViewPrivate * const d = d_func();-
1858 updateGeometries();-
1859 if (horizontalScrollMode() == QAbstractItemView::ScrollPerItem
horizontalScro...:ScrollPerItemDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1860 d->horizontalHeader->setOffsetToSectionPosition(horizontalScrollBar()->value());
never executed: d->horizontalHeader->setOffsetToSectionPosition(horizontalScrollBar()->value());
0
1861 else-
1862 d->horizontalHeader->setOffset(horizontalScrollBar()->value());
never executed: d->horizontalHeader->setOffset(horizontalScrollBar()->value());
0
1863 d->viewport->update();-
1864}
never executed: end of block
0
1865-
1866-
1867-
1868-
1869void QTableView::updateGeometries()-
1870{-
1871 QTableViewPrivate * const d = d_func();-
1872 if (d->geometryRecursionBlock
d->geometryRecursionBlockDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1873 return;
never executed: return;
0
1874 d->geometryRecursionBlock = true;-
1875-
1876 int width = 0;-
1877 if (!d->verticalHeader->isHidden()
!d->verticalHeader->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1878 width = qMax(d->verticalHeader->minimumWidth(), d->verticalHeader->sizeHint().width());-
1879 width = qMin(width, d->verticalHeader->maximumWidth());-
1880 }
never executed: end of block
0
1881 int height = 0;-
1882 if (!d->horizontalHeader->isHidden()
!d->horizontal...er->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1883 height = qMax(d->horizontalHeader->minimumHeight(), d->horizontalHeader->sizeHint().height());-
1884 height = qMin(height, d->horizontalHeader->maximumHeight());-
1885 }
never executed: end of block
0
1886 bool reverse = isRightToLeft();-
1887 if (reverse
reverseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1888 setViewportMargins(0, height, width, 0);
never executed: setViewportMargins(0, height, width, 0);
0
1889 else-
1890 setViewportMargins(width, height, 0, 0);
never executed: setViewportMargins(width, height, 0, 0);
0
1891-
1892-
1893-
1894 QRect vg = d->viewport->geometry();-
1895-
1896 int verticalLeft = reverse
reverseDescription
TRUEnever evaluated
FALSEnever evaluated
? vg.right() + 1 : (vg.left() - width);
0
1897 d->verticalHeader->setGeometry(verticalLeft, vg.top(), width, vg.height());-
1898 if (d->verticalHeader->isHidden()
d->verticalHeader->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1899 QMetaObject::invokeMethod(d->verticalHeader, "updateGeometries");
never executed: QMetaObject::invokeMethod(d->verticalHeader, "updateGeometries");
0
1900-
1901 int horizontalTop = vg.top() - height;-
1902 d->horizontalHeader->setGeometry(vg.left(), horizontalTop, vg.width(), height);-
1903 if (d->horizontalHeader->isHidden()
d->horizontalH...er->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1904 QMetaObject::invokeMethod(d->horizontalHeader, "updateGeometries");
never executed: QMetaObject::invokeMethod(d->horizontalHeader, "updateGeometries");
0
1905-
1906-
1907 if (d->horizontalHeader->isHidden()
d->horizontalH...er->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
|| d->verticalHeader->isHidden()
d->verticalHeader->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1908 d->cornerWidget->setHidden(true);-
1909 }
never executed: end of block
else {
0
1910 d->cornerWidget->setHidden(false);-
1911 d->cornerWidget->setGeometry(verticalLeft, horizontalTop, width, height);-
1912 }
never executed: end of block
0
1913-
1914-
1915-
1916-
1917 QSize vsize = d->viewport->size();-
1918 QSize max = maximumViewportSize();-
1919 uint horizontalLength = d->horizontalHeader->length();-
1920 uint verticalLength = d->verticalHeader->length();-
1921 if ((
(uint)max.widt...rizontalLengthDescription
TRUEnever evaluated
FALSEnever evaluated
uint)max.width() >= horizontalLength
(uint)max.widt...rizontalLengthDescription
TRUEnever evaluated
FALSEnever evaluated
&& (
(uint)max.heig...verticalLengthDescription
TRUEnever evaluated
FALSEnever evaluated
uint)max.height() >= verticalLength
(uint)max.heig...verticalLengthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1922 vsize = max;
never executed: vsize = max;
0
1923-
1924-
1925 const int columnCount = d->horizontalHeader->count();-
1926 const int viewportWidth = vsize.width();-
1927 int columnsInViewport = 0;-
1928 for (int width = 0, column = columnCount - 1; column >= 0
column >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --column) {
0
1929 int logical = d->horizontalHeader->logicalIndex(column);-
1930 if (!d->horizontalHeader->isSectionHidden(logical)
!d->horizontal...idden(logical)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1931 width += d->horizontalHeader->sectionSize(logical);-
1932 if (width > viewportWidth
width > viewportWidthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1933 break;
never executed: break;
0
1934 ++columnsInViewport;-
1935 }
never executed: end of block
0
1936 }
never executed: end of block
0
1937 columnsInViewport = qMax(columnsInViewport, 1);-
1938-
1939 if (horizontalScrollMode() == QAbstractItemView::ScrollPerItem
horizontalScro...:ScrollPerItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1940 const int visibleColumns = columnCount - d->horizontalHeader->hiddenSectionCount();-
1941 horizontalScrollBar()->setRange(0, visibleColumns - columnsInViewport);-
1942 horizontalScrollBar()->setPageStep(columnsInViewport);-
1943 if (columnsInViewport >= visibleColumns
columnsInViewp...visibleColumnsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1944 d->horizontalHeader->setOffset(0);
never executed: d->horizontalHeader->setOffset(0);
0
1945 horizontalScrollBar()->setSingleStep(1);-
1946 }
never executed: end of block
else {
0
1947 horizontalScrollBar()->setPageStep(vsize.width());-
1948 horizontalScrollBar()->setRange(0, horizontalLength - vsize.width());-
1949 horizontalScrollBar()->d_func()->itemviewChangeSingleStep(qMax(vsize.width() / (columnsInViewport + 1), 2));-
1950 }
never executed: end of block
0
1951-
1952-
1953 const int rowCount = d->verticalHeader->count();-
1954 const int viewportHeight = vsize.height();-
1955 int rowsInViewport = 0;-
1956 for (int height = 0, row = rowCount - 1; row >= 0
row >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --row) {
0
1957 int logical = d->verticalHeader->logicalIndex(row);-
1958 if (!d->verticalHeader->isSectionHidden(logical)
!d->verticalHe...idden(logical)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1959 height += d->verticalHeader->sectionSize(logical);-
1960 if (height > viewportHeight
height > viewportHeightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1961 break;
never executed: break;
0
1962 ++rowsInViewport;-
1963 }
never executed: end of block
0
1964 }
never executed: end of block
0
1965 rowsInViewport = qMax(rowsInViewport, 1);-
1966-
1967 if (verticalScrollMode() == QAbstractItemView::ScrollPerItem
verticalScroll...:ScrollPerItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1968 const int visibleRows = rowCount - d->verticalHeader->hiddenSectionCount();-
1969 verticalScrollBar()->setRange(0, visibleRows - rowsInViewport);-
1970 verticalScrollBar()->setPageStep(rowsInViewport);-
1971 if (rowsInViewport >= visibleRows
rowsInViewport >= visibleRowsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1972 d->verticalHeader->setOffset(0);
never executed: d->verticalHeader->setOffset(0);
0
1973 verticalScrollBar()->setSingleStep(1);-
1974 }
never executed: end of block
else {
0
1975 verticalScrollBar()->setPageStep(vsize.height());-
1976 verticalScrollBar()->setRange(0, verticalLength - vsize.height());-
1977 verticalScrollBar()->d_func()->itemviewChangeSingleStep(qMax(vsize.height() / (rowsInViewport + 1), 2));-
1978 }
never executed: end of block
0
1979-
1980 d->geometryRecursionBlock = false;-
1981 QAbstractItemView::updateGeometries();-
1982}
never executed: end of block
0
1983int QTableView::sizeHintForRow(int row) const-
1984{-
1985 const QTableViewPrivate * const d = d_func();-
1986-
1987 if (!model()
!model()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1988 return
never executed: return -1;
-1;
never executed: return -1;
0
1989-
1990 ensurePolished();-
1991 const int maximumProcessCols = d->verticalHeader->resizeContentsPrecision();-
1992-
1993-
1994 int left = qMax(0, d->horizontalHeader->visualIndexAt(0));-
1995 int right = d->horizontalHeader->visualIndexAt(d->viewport->width());-
1996 if (right == -1
right == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1997 right = d->model->columnCount(d->root) - 1;
never executed: right = d->model->columnCount(d->root) - 1;
0
1998-
1999 QStyleOptionViewItem option = d->viewOptionsV1();-
2000-
2001 int hint = 0;-
2002 QModelIndex index;-
2003 int columnsProcessed = 0;-
2004 int column = left;-
2005 for (; column <= right
column <= rightDescription
TRUEnever evaluated
FALSEnever evaluated
; ++column) {
0
2006 int logicalColumn = d->horizontalHeader->logicalIndex(column);-
2007 if (d->horizontalHeader->isSectionHidden(logicalColumn)
d->horizontalH...logicalColumn)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2008 continue;
never executed: continue;
0
2009 index = d->model->index(row, logicalColumn, d->root);-
2010 hint = d->heightHintForIndex(index, hint, option);-
2011-
2012 ++columnsProcessed;-
2013 if (columnsProcessed == maximumProcessCols
columnsProcess...mumProcessColsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2014 break;
never executed: break;
0
2015 }
never executed: end of block
0
2016-
2017 int actualRight = d->model->columnCount(d->root) - 1;-
2018 int idxLeft = left;-
2019 int idxRight = column - 1;-
2020-
2021 if (maximumProcessCols == 0
maximumProcessCols == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2022 columnsProcessed = 0;
never executed: columnsProcessed = 0;
0
2023-
2024 while (columnsProcessed != maximumProcessCols
columnsProcess...mumProcessColsDescription
TRUEnever evaluated
FALSEnever evaluated
&& (idxLeft > 0
idxLeft > 0Description
TRUEnever evaluated
FALSEnever evaluated
|| idxRight < actualRight
idxRight < actualRightDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
2025 int logicalIdx = -1;-
2026-
2027 if ((columnsProcessed % 2
columnsProcessed % 2Description
TRUEnever evaluated
FALSEnever evaluated
&& idxLeft > 0
idxLeft > 0Description
TRUEnever evaluated
FALSEnever evaluated
) || idxRight == actualRight
idxRight == actualRightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2028 while (idxLeft > 0
idxLeft > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2029 --idxLeft;-
2030 int logcol = d->horizontalHeader->logicalIndex(idxLeft);-
2031 if (d->horizontalHeader->isSectionHidden(logcol)
d->horizontalH...Hidden(logcol)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2032 continue;
never executed: continue;
0
2033 logicalIdx = logcol;-
2034 break;
never executed: break;
0
2035 }-
2036 }
never executed: end of block
else {
0
2037 while (idxRight < actualRight
idxRight < actualRightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2038 ++idxRight;-
2039 int logcol = d->horizontalHeader->logicalIndex(idxRight);-
2040 if (d->horizontalHeader->isSectionHidden(logcol)
d->horizontalH...Hidden(logcol)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2041 continue;
never executed: continue;
0
2042 logicalIdx = logcol;-
2043 break;
never executed: break;
0
2044 }-
2045 }
never executed: end of block
0
2046 if (logicalIdx < 0
logicalIdx < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2047 continue;
never executed: continue;
0
2048-
2049 index = d->model->index(row, logicalIdx, d->root);-
2050 hint = d->heightHintForIndex(index, hint, option);-
2051 ++columnsProcessed;-
2052 }
never executed: end of block
0
2053-
2054 return
never executed: return d->showGrid ? hint + 1 : hint;
d->showGrid ? hint + 1 : hint;
never executed: return d->showGrid ? hint + 1 : hint;
0
2055}-
2056int QTableView::sizeHintForColumn(int column) const-
2057{-
2058 const QTableViewPrivate * const d = d_func();-
2059-
2060 if (!model()
!model()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2061 return
never executed: return -1;
-1;
never executed: return -1;
0
2062-
2063 ensurePolished();-
2064 const int maximumProcessRows = d->horizontalHeader->resizeContentsPrecision();-
2065-
2066 int top = qMax(0, d->verticalHeader->visualIndexAt(0));-
2067 int bottom = d->verticalHeader->visualIndexAt(d->viewport->height());-
2068 if (!isVisible()
!isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
|| bottom == -1
bottom == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2069 bottom = d->model->rowCount(d->root) - 1;
never executed: bottom = d->model->rowCount(d->root) - 1;
0
2070-
2071 QStyleOptionViewItem option = d->viewOptionsV1();-
2072-
2073 int hint = 0;-
2074 int rowsProcessed = 0;-
2075 QModelIndex index;-
2076 int row = top;-
2077 for (; row <= bottom
row <= bottomDescription
TRUEnever evaluated
FALSEnever evaluated
; ++row) {
0
2078 int logicalRow = d->verticalHeader->logicalIndex(row);-
2079 if (d->verticalHeader->isSectionHidden(logicalRow)
d->verticalHea...en(logicalRow)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2080 continue;
never executed: continue;
0
2081 index = d->model->index(logicalRow, column, d->root);-
2082-
2083 hint = d->widthHintForIndex(index, hint, option);-
2084 ++rowsProcessed;-
2085 if (rowsProcessed == maximumProcessRows
rowsProcessed ...mumProcessRowsDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2086 break;
never executed: break;
0
2087 }
never executed: end of block
0
2088-
2089 int actualBottom = d->model->rowCount(d->root) - 1;-
2090 int idxTop = top;-
2091 int idxBottom = row - 1;-
2092-
2093 if (maximumProcessRows == 0
maximumProcessRows == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2094 rowsProcessed = 0;
never executed: rowsProcessed = 0;
0
2095-
2096 while (rowsProcessed != maximumProcessRows
rowsProcessed ...mumProcessRowsDescription
TRUEnever evaluated
FALSEnever evaluated
&& (idxTop > 0
idxTop > 0Description
TRUEnever evaluated
FALSEnever evaluated
|| idxBottom < actualBottom
idxBottom < actualBottomDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0
2097 int logicalIdx = -1;-
2098-
2099 if ((rowsProcessed % 2
rowsProcessed % 2Description
TRUEnever evaluated
FALSEnever evaluated
&& idxTop > 0
idxTop > 0Description
TRUEnever evaluated
FALSEnever evaluated
) || idxBottom == actualBottom
idxBottom == actualBottomDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2100 while (idxTop > 0
idxTop > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2101 --idxTop;-
2102 int logrow = d->verticalHeader->logicalIndex(idxTop);-
2103 if (d->verticalHeader->isSectionHidden(logrow)
d->verticalHea...Hidden(logrow)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2104 continue;
never executed: continue;
0
2105 logicalIdx = logrow;-
2106 break;
never executed: break;
0
2107 }-
2108 }
never executed: end of block
else {
0
2109 while (idxBottom < actualBottom
idxBottom < actualBottomDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2110 ++idxBottom;-
2111 int logrow = d->verticalHeader->logicalIndex(idxBottom);-
2112 if (d->verticalHeader->isSectionHidden(logrow)
d->verticalHea...Hidden(logrow)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2113 continue;
never executed: continue;
0
2114 logicalIdx = logrow;-
2115 break;
never executed: break;
0
2116 }-
2117 }
never executed: end of block
0
2118 if (logicalIdx < 0
logicalIdx < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2119 continue;
never executed: continue;
0
2120-
2121 index = d->model->index(logicalIdx, column, d->root);-
2122 hint = d->widthHintForIndex(index, hint, option);-
2123 ++rowsProcessed;-
2124 }
never executed: end of block
0
2125-
2126 return
never executed: return d->showGrid ? hint + 1 : hint;
d->showGrid ? hint + 1 : hint;
never executed: return d->showGrid ? hint + 1 : hint;
0
2127}-
2128-
2129-
2130-
2131-
2132-
2133int QTableView::rowViewportPosition(int row) const-
2134{-
2135 const QTableViewPrivate * const d = d_func();-
2136 return
never executed: return d->verticalHeader->sectionViewportPosition(row);
d->verticalHeader->sectionViewportPosition(row);
never executed: return d->verticalHeader->sectionViewportPosition(row);
0
2137}-
2138int QTableView::rowAt(int y) const-
2139{-
2140 const QTableViewPrivate * const d = d_func();-
2141 return
never executed: return d->verticalHeader->logicalIndexAt(y);
d->verticalHeader->logicalIndexAt(y);
never executed: return d->verticalHeader->logicalIndexAt(y);
0
2142}-
2143-
2144-
2145-
2146-
2147-
2148-
2149void QTableView::setRowHeight(int row, int height)-
2150{-
2151 const QTableViewPrivate * const d = d_func();-
2152 d->verticalHeader->resizeSection(row, height);-
2153}
never executed: end of block
0
2154-
2155-
2156-
2157-
2158-
2159-
2160int QTableView::rowHeight(int row) const-
2161{-
2162 const QTableViewPrivate * const d = d_func();-
2163 return
never executed: return d->verticalHeader->sectionSize(row);
d->verticalHeader->sectionSize(row);
never executed: return d->verticalHeader->sectionSize(row);
0
2164}-
2165-
2166-
2167-
2168-
2169-
2170int QTableView::columnViewportPosition(int column) const-
2171{-
2172 const QTableViewPrivate * const d = d_func();-
2173 return
never executed: return d->horizontalHeader->sectionViewportPosition(column);
d->horizontalHeader->sectionViewportPosition(column);
never executed: return d->horizontalHeader->sectionViewportPosition(column);
0
2174}-
2175int QTableView::columnAt(int x) const-
2176{-
2177 const QTableViewPrivate * const d = d_func();-
2178 return
never executed: return d->horizontalHeader->logicalIndexAt(x);
d->horizontalHeader->logicalIndexAt(x);
never executed: return d->horizontalHeader->logicalIndexAt(x);
0
2179}-
2180-
2181-
2182-
2183-
2184-
2185-
2186void QTableView::setColumnWidth(int column, int width)-
2187{-
2188 const QTableViewPrivate * const d = d_func();-
2189 d->horizontalHeader->resizeSection(column, width);-
2190}
never executed: end of block
0
2191-
2192-
2193-
2194-
2195-
2196-
2197int QTableView::columnWidth(int column) const-
2198{-
2199 const QTableViewPrivate * const d = d_func();-
2200 return
never executed: return d->horizontalHeader->sectionSize(column);
d->horizontalHeader->sectionSize(column);
never executed: return d->horizontalHeader->sectionSize(column);
0
2201}-
2202-
2203-
2204-
2205-
2206-
2207-
2208bool QTableView::isRowHidden(int row) const-
2209{-
2210 const QTableViewPrivate * const d = d_func();-
2211 return
never executed: return d->verticalHeader->isSectionHidden(row);
d->verticalHeader->isSectionHidden(row);
never executed: return d->verticalHeader->isSectionHidden(row);
0
2212}-
2213-
2214-
2215-
2216-
2217-
2218-
2219void QTableView::setRowHidden(int row, bool hide)-
2220{-
2221 QTableViewPrivate * const d = d_func();-
2222 if (row < 0
row < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| row >= d->verticalHeader->count()
row >= d->vert...eader->count()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2223 return;
never executed: return;
0
2224 d->verticalHeader->setSectionHidden(row, hide);-
2225}
never executed: end of block
0
2226-
2227-
2228-
2229-
2230-
2231-
2232bool QTableView::isColumnHidden(int column) const-
2233{-
2234 const QTableViewPrivate * const d = d_func();-
2235 return
never executed: return d->horizontalHeader->isSectionHidden(column);
d->horizontalHeader->isSectionHidden(column);
never executed: return d->horizontalHeader->isSectionHidden(column);
0
2236}-
2237-
2238-
2239-
2240-
2241-
2242-
2243-
2244void QTableView::setColumnHidden(int column, bool hide)-
2245{-
2246 QTableViewPrivate * const d = d_func();-
2247 if (column < 0
column < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| column >= d->horizontalHeader->count()
column >= d->h...eader->count()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2248 return;
never executed: return;
0
2249 d->horizontalHeader->setSectionHidden(column, hide);-
2250}
never executed: end of block
0
2251void QTableView::setSortingEnabled(bool enable)-
2252{-
2253 QTableViewPrivate * const d = d_func();-
2254 d->sortingEnabled = enable;-
2255 horizontalHeader()->setSortIndicatorShown(enable);-
2256 if (enable
enableDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2257 disconnect(d->horizontalHeader, qFlagLocation("2""sectionEntered(int)" "\0" __FILE__ ":" "2549"),-
2258 this, qFlagLocation("1""_q_selectColumn(int)" "\0" __FILE__ ":" "2550"));-
2259 disconnect(horizontalHeader(), qFlagLocation("2""sectionPressed(int)" "\0" __FILE__ ":" "2551"),-
2260 this, qFlagLocation("1""selectColumn(int)" "\0" __FILE__ ":" "2552"));-
2261 connect(horizontalHeader(), qFlagLocation("2""sortIndicatorChanged(int,Qt::SortOrder)" "\0" __FILE__ ":" "2553"),-
2262 this, qFlagLocation("1""sortByColumn(int)" "\0" __FILE__ ":" "2554"), Qt::UniqueConnection);-
2263 sortByColumn(horizontalHeader()->sortIndicatorSection(),-
2264 horizontalHeader()->sortIndicatorOrder());-
2265 }
never executed: end of block
else {
0
2266 connect(d->horizontalHeader, qFlagLocation("2""sectionEntered(int)" "\0" __FILE__ ":" "2558"),-
2267 this, qFlagLocation("1""_q_selectColumn(int)" "\0" __FILE__ ":" "2559"), Qt::UniqueConnection);-
2268 connect(horizontalHeader(), qFlagLocation("2""sectionPressed(int)" "\0" __FILE__ ":" "2560"),-
2269 this, qFlagLocation("1""selectColumn(int)" "\0" __FILE__ ":" "2561"), Qt::UniqueConnection);-
2270 disconnect(horizontalHeader(), qFlagLocation("2""sortIndicatorChanged(int,Qt::SortOrder)" "\0" __FILE__ ":" "2562"),-
2271 this, qFlagLocation("1""sortByColumn(int)" "\0" __FILE__ ":" "2563"));-
2272 }
never executed: end of block
0
2273}-
2274-
2275bool QTableView::isSortingEnabled() const-
2276{-
2277 const QTableViewPrivate * const d = d_func();-
2278 return
never executed: return d->sortingEnabled;
d->sortingEnabled;
never executed: return d->sortingEnabled;
0
2279}-
2280bool QTableView::showGrid() const-
2281{-
2282 const QTableViewPrivate * const d = d_func();-
2283 return
never executed: return d->showGrid;
d->showGrid;
never executed: return d->showGrid;
0
2284}-
2285-
2286void QTableView::setShowGrid(bool show)-
2287{-
2288 QTableViewPrivate * const d = d_func();-
2289 if (d->showGrid != show
d->showGrid != showDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2290 d->showGrid = show;-
2291 d->viewport->update();-
2292 }
never executed: end of block
0
2293}
never executed: end of block
0
2294-
2295-
2296-
2297-
2298-
2299-
2300-
2301Qt::PenStyle QTableView::gridStyle() const-
2302{-
2303 const QTableViewPrivate * const d = d_func();-
2304 return
never executed: return d->gridStyle;
d->gridStyle;
never executed: return d->gridStyle;
0
2305}-
2306-
2307void QTableView::setGridStyle(Qt::PenStyle style)-
2308{-
2309 QTableViewPrivate * const d = d_func();-
2310 if (d->gridStyle != style
d->gridStyle != styleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2311 d->gridStyle = style;-
2312 d->viewport->update();-
2313 }
never executed: end of block
0
2314}
never executed: end of block
0
2315void QTableView::setWordWrap(bool on)-
2316{-
2317 QTableViewPrivate * const d = d_func();-
2318 if (d->wrapItemText == on
d->wrapItemText == onDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2319 return;
never executed: return;
0
2320 d->wrapItemText = on;-
2321 QMetaObject::invokeMethod(d->verticalHeader, "resizeSections");-
2322 QMetaObject::invokeMethod(d->horizontalHeader, "resizeSections");-
2323}
never executed: end of block
0
2324-
2325bool QTableView::wordWrap() const-
2326{-
2327 const QTableViewPrivate * const d = d_func();-
2328 return
never executed: return d->wrapItemText;
d->wrapItemText;
never executed: return d->wrapItemText;
0
2329}-
2330void QTableView::setCornerButtonEnabled(bool enable)-
2331{-
2332 QTableViewPrivate * const d = d_func();-
2333 d->cornerWidget->setEnabled(enable);-
2334}
never executed: end of block
0
2335-
2336bool QTableView::isCornerButtonEnabled() const-
2337{-
2338 const QTableViewPrivate * const d = d_func();-
2339 return
never executed: return d->cornerWidget->isEnabled();
d->cornerWidget->isEnabled();
never executed: return d->cornerWidget->isEnabled();
0
2340}-
2341QRect QTableView::visualRect(const QModelIndex &index) const-
2342{-
2343 const QTableViewPrivate * const d = d_func();-
2344 if (!d->isIndexValid(index)
!d->isIndexValid(index)Description
TRUEnever evaluated
FALSEnever evaluated
|| index.parent() != d->root
index.parent() != d->rootDescription
TRUEnever evaluated
FALSEnever evaluated
0
2345 || (!d->hasSpans()
!d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
&& isIndexHidden(index)
isIndexHidden(index)Description
TRUEnever evaluated
FALSEnever evaluated
))
0
2346 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
2347-
2348 d->executePostedLayout();-
2349-
2350 if (d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2351 QSpanCollection::Span span = d->span(index.row(), index.column());-
2352 return
never executed: return d->visualSpanRect(span);
d->visualSpanRect(span);
never executed: return d->visualSpanRect(span);
0
2353 }-
2354-
2355 int rowp = rowViewportPosition(index.row());-
2356 int rowh = rowHeight(index.row());-
2357 int colp = columnViewportPosition(index.column());-
2358 int colw = columnWidth(index.column());-
2359-
2360 const int i = showGrid()
showGrid()Description
TRUEnever evaluated
FALSEnever evaluated
? 1 : 0;
0
2361 return
never executed: return QRect(colp, rowp, colw - i, rowh - i);
QRect(colp, rowp, colw - i, rowh - i);
never executed: return QRect(colp, rowp, colw - i, rowh - i);
0
2362}-
2363-
2364-
2365-
2366-
2367-
2368-
2369-
2370void QTableView::scrollTo(const QModelIndex &index, ScrollHint hint)-
2371{-
2372 QTableViewPrivate * const d = d_func();-
2373-
2374-
2375 if (!d->isIndexValid(index)
!d->isIndexValid(index)Description
TRUEnever evaluated
FALSEnever evaluated
0
2376 || (
(d->model->par...x) != d->root)Description
TRUEnever evaluated
FALSEnever evaluated
d->model->parent(index) != d->root)
(d->model->par...x) != d->root)Description
TRUEnever evaluated
FALSEnever evaluated
0
2377 || isRowHidden(index.row())
isRowHidden(index.row())Description
TRUEnever evaluated
FALSEnever evaluated
|| isColumnHidden(index.column())
isColumnHidden(index.column())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2378 return;
never executed: return;
0
2379-
2380 QSpanCollection::Span span;-
2381 if (d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2382 span = d->span(index.row(), index.column());
never executed: span = d->span(index.row(), index.column());
0
2383-
2384-
2385-
2386 int viewportWidth = d->viewport->width();-
2387 int horizontalOffset = d->horizontalHeader->offset();-
2388 int horizontalPosition = d->horizontalHeader->sectionPosition(index.column());-
2389 int horizontalIndex = d->horizontalHeader->visualIndex(index.column());-
2390 int cellWidth = d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
0
2391 ? d->columnSpanWidth(index.column(), span.width())-
2392 : d->horizontalHeader->sectionSize(index.column());-
2393-
2394 if (horizontalScrollMode() == QAbstractItemView::ScrollPerItem
horizontalScro...:ScrollPerItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2395-
2396 bool positionAtLeft = (horizontalPosition - horizontalOffset < 0);-
2397 bool positionAtRight = (horizontalPosition - horizontalOffset + cellWidth > viewportWidth);-
2398-
2399 if (hint == PositionAtCenter
hint == PositionAtCenterDescription
TRUEnever evaluated
FALSEnever evaluated
|| positionAtRight
positionAtRightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2400 int w = (hint == PositionAtCenter
hint == PositionAtCenterDescription
TRUEnever evaluated
FALSEnever evaluated
? viewportWidth / 2 : viewportWidth);
0
2401 int x = cellWidth;-
2402 while (horizontalIndex > 0
horizontalIndex > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2403 x += columnWidth(d->horizontalHeader->logicalIndex(horizontalIndex-1));-
2404 if (x > w
x > wDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2405 break;
never executed: break;
0
2406 --horizontalIndex;-
2407 }
never executed: end of block
0
2408 }
never executed: end of block
0
2409-
2410 if (positionAtRight
positionAtRightDescription
TRUEnever evaluated
FALSEnever evaluated
|| hint == PositionAtCenter
hint == PositionAtCenterDescription
TRUEnever evaluated
FALSEnever evaluated
|| positionAtLeft
positionAtLeftDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2411 int hiddenSections = 0;-
2412 if (d->horizontalHeader->sectionsHidden()
d->horizontalH...ctionsHidden()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2413 for (int s = horizontalIndex - 1; s >= 0
s >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --s) {
0
2414 int column = d->horizontalHeader->logicalIndex(s);-
2415 if (d->horizontalHeader->isSectionHidden(column)
d->horizontalH...Hidden(column)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2416 ++
never executed: ++hiddenSections;
hiddenSections;
never executed: ++hiddenSections;
0
2417 }
never executed: end of block
0
2418 }
never executed: end of block
0
2419 horizontalScrollBar()->setValue(horizontalIndex - hiddenSections);-
2420 }
never executed: end of block
0
2421-
2422 }
never executed: end of block
else {
0
2423 if (hint == PositionAtCenter
hint == PositionAtCenterDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2424 horizontalScrollBar()->setValue(horizontalPosition - ((viewportWidth - cellWidth) / 2));-
2425 }
never executed: end of block
else {
0
2426 if (horizontalPosition - horizontalOffset < 0
horizontalPosi...ntalOffset < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| cellWidth > viewportWidth
cellWidth > viewportWidthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2427 horizontalScrollBar()->setValue(horizontalPosition);
never executed: horizontalScrollBar()->setValue(horizontalPosition);
0
2428 else if (horizontalPosition - horizontalOffset + cellWidth > viewportWidth
horizontalPosi... viewportWidthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2429 horizontalScrollBar()->setValue(horizontalPosition - viewportWidth + cellWidth);
never executed: horizontalScrollBar()->setValue(horizontalPosition - viewportWidth + cellWidth);
0
2430 }
never executed: end of block
0
2431 }-
2432-
2433-
2434-
2435 int viewportHeight = d->viewport->height();-
2436 int verticalOffset = d->verticalHeader->offset();-
2437 int verticalPosition = d->verticalHeader->sectionPosition(index.row());-
2438 int verticalIndex = d->verticalHeader->visualIndex(index.row());-
2439 int cellHeight = d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
0
2440 ? d->rowSpanHeight(index.row(), span.height())-
2441 : d->verticalHeader->sectionSize(index.row());-
2442-
2443 if (verticalPosition - verticalOffset < 0
verticalPositi...icalOffset < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| cellHeight > viewportHeight
cellHeight > viewportHeightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2444 if (hint == EnsureVisible
hint == EnsureVisibleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2445 hint = PositionAtTop;
never executed: hint = PositionAtTop;
0
2446 }
never executed: end of block
else if (verticalPosition - verticalOffset + cellHeight > viewportHeight
verticalPositi...viewportHeightDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2447 if (hint == EnsureVisible
hint == EnsureVisibleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2448 hint = PositionAtBottom;
never executed: hint = PositionAtBottom;
0
2449 }
never executed: end of block
0
2450-
2451 if (verticalScrollMode() == QAbstractItemView::ScrollPerItem
verticalScroll...:ScrollPerItemDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2452-
2453 if (hint == PositionAtBottom
hint == PositionAtBottomDescription
TRUEnever evaluated
FALSEnever evaluated
|| hint == PositionAtCenter
hint == PositionAtCenterDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2454 int h = (hint == PositionAtCenter
hint == PositionAtCenterDescription
TRUEnever evaluated
FALSEnever evaluated
? viewportHeight / 2 : viewportHeight);
0
2455 int y = cellHeight;-
2456 while (verticalIndex > 0
verticalIndex > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2457 int row = d->verticalHeader->logicalIndex(verticalIndex - 1);-
2458 y += d->verticalHeader->sectionSize(row);-
2459 if (y > h
y > hDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2460 break;
never executed: break;
0
2461 --verticalIndex;-
2462 }
never executed: end of block
0
2463 }
never executed: end of block
0
2464-
2465 if (hint == PositionAtBottom
hint == PositionAtBottomDescription
TRUEnever evaluated
FALSEnever evaluated
|| hint == PositionAtCenter
hint == PositionAtCenterDescription
TRUEnever evaluated
FALSEnever evaluated
|| hint == PositionAtTop
hint == PositionAtTopDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2466 int hiddenSections = 0;-
2467 if (d->verticalHeader->sectionsHidden()
d->verticalHea...ctionsHidden()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2468 for (int s = verticalIndex - 1; s >= 0
s >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --s) {
0
2469 int row = d->verticalHeader->logicalIndex(s);-
2470 if (d->verticalHeader->isSectionHidden(row)
d->verticalHea...ionHidden(row)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2471 ++
never executed: ++hiddenSections;
hiddenSections;
never executed: ++hiddenSections;
0
2472 }
never executed: end of block
0
2473 }
never executed: end of block
0
2474 verticalScrollBar()->setValue(verticalIndex - hiddenSections);-
2475 }
never executed: end of block
0
2476-
2477 }
never executed: end of block
else {
0
2478 if (hint == PositionAtTop
hint == PositionAtTopDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2479 verticalScrollBar()->setValue(verticalPosition);-
2480 }
never executed: end of block
else if (hint == PositionAtBottom
hint == PositionAtBottomDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2481 verticalScrollBar()->setValue(verticalPosition - viewportHeight + cellHeight);-
2482 }
never executed: end of block
else if (hint == PositionAtCenter
hint == PositionAtCenterDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2483 verticalScrollBar()->setValue(verticalPosition - ((viewportHeight - cellHeight) / 2));-
2484 }
never executed: end of block
0
2485 }
never executed: end of block
0
2486-
2487 update(index);-
2488}
never executed: end of block
0
2489void QTableView::rowResized(int row, int, int)-
2490{-
2491 QTableViewPrivate * const d = d_func();-
2492 d->rowsToUpdate.append(row);-
2493 if (d->rowResizeTimerID == 0
d->rowResizeTimerID == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2494 d->rowResizeTimerID = startTimer(0);
never executed: d->rowResizeTimerID = startTimer(0);
0
2495}
never executed: end of block
0
2496void QTableView::columnResized(int column, int, int)-
2497{-
2498 QTableViewPrivate * const d = d_func();-
2499 d->columnsToUpdate.append(column);-
2500 if (d->columnResizeTimerID == 0
d->columnResizeTimerID == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2501 d->columnResizeTimerID = startTimer(0);
never executed: d->columnResizeTimerID = startTimer(0);
0
2502}
never executed: end of block
0
2503-
2504-
2505-
2506-
2507void QTableView::timerEvent(QTimerEvent *event)-
2508{-
2509 QTableViewPrivate * const d = d_func();-
2510-
2511 if (event->timerId() == d->columnResizeTimerID
event->timerId...nResizeTimerIDDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2512 updateGeometries();-
2513 killTimer(d->columnResizeTimerID);-
2514 d->columnResizeTimerID = 0;-
2515-
2516 QRect rect;-
2517 int viewportHeight = d->viewport->height();-
2518 int viewportWidth = d->viewport->width();-
2519 if (d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2520 rect = QRect(0, 0, viewportWidth, viewportHeight);-
2521 }
never executed: end of block
else {
0
2522 for (int i = d->columnsToUpdate.size()-1; i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i) {
0
2523 int column = d->columnsToUpdate.at(i);-
2524 int x = columnViewportPosition(column);-
2525 if (isRightToLeft()
isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2526 rect |= QRect(0, 0, x + columnWidth(column), viewportHeight);
never executed: rect |= QRect(0, 0, x + columnWidth(column), viewportHeight);
0
2527 else-
2528 rect |= QRect(x, 0, viewportWidth - x, viewportHeight);
never executed: rect |= QRect(x, 0, viewportWidth - x, viewportHeight);
0
2529 }-
2530 }
never executed: end of block
0
2531-
2532 d->viewport->update(rect.normalized());-
2533 d->columnsToUpdate.clear();-
2534 }
never executed: end of block
0
2535-
2536 if (event->timerId() == d->rowResizeTimerID
event->timerId...wResizeTimerIDDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
2537 updateGeometries();-
2538 killTimer(d->rowResizeTimerID);-
2539 d->rowResizeTimerID = 0;-
2540-
2541 int viewportHeight = d->viewport->height();-
2542 int viewportWidth = d->viewport->width();-
2543 int top;-
2544 if (d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2545 top = 0;-
2546 }
never executed: end of block
else {
0
2547 top = viewportHeight;-
2548 for (int i = d->rowsToUpdate.size()-1; i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i) {
0
2549 int y = rowViewportPosition(d->rowsToUpdate.at(i));-
2550 top = qMin(top, y);-
2551 }
never executed: end of block
0
2552 }
never executed: end of block
0
2553-
2554 d->viewport->update(QRect(0, top, viewportWidth, viewportHeight - top));-
2555 d->rowsToUpdate.clear();-
2556 }
never executed: end of block
0
2557-
2558 QAbstractItemView::timerEvent(event);-
2559}
never executed: end of block
0
2560void QTableView::rowMoved(int, int oldIndex, int newIndex)-
2561{-
2562 QTableViewPrivate * const d = d_func();-
2563-
2564 updateGeometries();-
2565 int logicalOldIndex = d->verticalHeader->logicalIndex(oldIndex);-
2566 int logicalNewIndex = d->verticalHeader->logicalIndex(newIndex);-
2567 if (d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2568 d->viewport->update();-
2569 }
never executed: end of block
else {
0
2570 int oldTop = rowViewportPosition(logicalOldIndex);-
2571 int newTop = rowViewportPosition(logicalNewIndex);-
2572 int oldBottom = oldTop + rowHeight(logicalOldIndex);-
2573 int newBottom = newTop + rowHeight(logicalNewIndex);-
2574 int top = qMin(oldTop, newTop);-
2575 int bottom = qMax(oldBottom, newBottom);-
2576 int height = bottom - top;-
2577 d->viewport->update(0, top, d->viewport->width(), height);-
2578 }
never executed: end of block
0
2579}-
2580void QTableView::columnMoved(int, int oldIndex, int newIndex)-
2581{-
2582 QTableViewPrivate * const d = d_func();-
2583-
2584 updateGeometries();-
2585 int logicalOldIndex = d->horizontalHeader->logicalIndex(oldIndex);-
2586 int logicalNewIndex = d->horizontalHeader->logicalIndex(newIndex);-
2587 if (d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2588 d->viewport->update();-
2589 }
never executed: end of block
else {
0
2590 int oldLeft = columnViewportPosition(logicalOldIndex);-
2591 int newLeft = columnViewportPosition(logicalNewIndex);-
2592 int oldRight = oldLeft + columnWidth(logicalOldIndex);-
2593 int newRight = newLeft + columnWidth(logicalNewIndex);-
2594 int left = qMin(oldLeft, newLeft);-
2595 int right = qMax(oldRight, newRight);-
2596 int width = right - left;-
2597 d->viewport->update(left, 0, width, d->viewport->height());-
2598 }
never executed: end of block
0
2599}-
2600-
2601-
2602-
2603-
2604-
2605-
2606-
2607void QTableView::selectRow(int row)-
2608{-
2609 QTableViewPrivate * const d = d_func();-
2610 d->selectRow(row, true);-
2611}
never executed: end of block
0
2612-
2613-
2614-
2615-
2616-
2617-
2618-
2619void QTableView::selectColumn(int column)-
2620{-
2621 QTableViewPrivate * const d = d_func();-
2622 d->selectColumn(column, true);-
2623}
never executed: end of block
0
2624-
2625-
2626-
2627-
2628-
2629-
2630void QTableView::hideRow(int row)-
2631{-
2632 QTableViewPrivate * const d = d_func();-
2633 d->verticalHeader->hideSection(row);-
2634}
never executed: end of block
0
2635-
2636-
2637-
2638-
2639-
2640-
2641void QTableView::hideColumn(int column)-
2642{-
2643 QTableViewPrivate * const d = d_func();-
2644 d->horizontalHeader->hideSection(column);-
2645}
never executed: end of block
0
2646-
2647-
2648-
2649-
2650-
2651-
2652void QTableView::showRow(int row)-
2653{-
2654 QTableViewPrivate * const d = d_func();-
2655 d->verticalHeader->showSection(row);-
2656}
never executed: end of block
0
2657-
2658-
2659-
2660-
2661-
2662-
2663void QTableView::showColumn(int column)-
2664{-
2665 QTableViewPrivate * const d = d_func();-
2666 d->horizontalHeader->showSection(column);-
2667}
never executed: end of block
0
2668-
2669-
2670-
2671-
2672-
2673-
2674-
2675void QTableView::resizeRowToContents(int row)-
2676{-
2677 QTableViewPrivate * const d = d_func();-
2678 int content = sizeHintForRow(row);-
2679 int header = d->verticalHeader->sectionSizeHint(row);-
2680 d->verticalHeader->resizeSection(row, qMax(content, header));-
2681}
never executed: end of block
0
2682-
2683-
2684-
2685-
2686-
2687-
2688-
2689void QTableView::resizeRowsToContents()-
2690{-
2691 QTableViewPrivate * const d = d_func();-
2692 d->verticalHeader->resizeSections(QHeaderView::ResizeToContents);-
2693}
never executed: end of block
0
2694void QTableView::resizeColumnToContents(int column)-
2695{-
2696 QTableViewPrivate * const d = d_func();-
2697 int content = sizeHintForColumn(column);-
2698 int header = d->horizontalHeader->sectionSizeHint(column);-
2699 d->horizontalHeader->resizeSection(column, qMax(content, header));-
2700}
never executed: end of block
0
2701-
2702-
2703-
2704-
2705-
2706-
2707-
2708void QTableView::resizeColumnsToContents()-
2709{-
2710 QTableViewPrivate * const d = d_func();-
2711 d->horizontalHeader->resizeSections(QHeaderView::ResizeToContents);-
2712}
never executed: end of block
0
2713-
2714-
2715-
2716-
2717-
2718-
2719-
2720void QTableView::sortByColumn(int column)-
2721{-
2722 QTableViewPrivate * const d = d_func();-
2723 if (column == -1
column == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2724 return;
never executed: return;
0
2725 d->model->sort(column, d->horizontalHeader->sortIndicatorOrder());-
2726}
never executed: end of block
0
2727void QTableView::sortByColumn(int column, Qt::SortOrder order)-
2728{-
2729 QTableViewPrivate * const d = d_func();-
2730 d->horizontalHeader->setSortIndicator(column, order);-
2731 sortByColumn(column);-
2732}
never executed: end of block
0
2733-
2734-
2735-
2736-
2737void QTableView::verticalScrollbarAction(int action)-
2738{-
2739 QAbstractItemView::verticalScrollbarAction(action);-
2740}
never executed: end of block
0
2741-
2742-
2743-
2744-
2745void QTableView::horizontalScrollbarAction(int action)-
2746{-
2747 QAbstractItemView::horizontalScrollbarAction(action);-
2748}
never executed: end of block
0
2749-
2750-
2751-
2752-
2753bool QTableView::isIndexHidden(const QModelIndex &index) const-
2754{-
2755 const QTableViewPrivate * const d = d_func();-
2756 ((!(d->isIndexValid(index))) ? qt_assert("d->isIndexValid(index)",__FILE__,3141) : qt_noop());-
2757 if (isRowHidden(index.row())
isRowHidden(index.row())Description
TRUEnever evaluated
FALSEnever evaluated
|| isColumnHidden(index.column())
isColumnHidden(index.column())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2758 return
never executed: return true;
true;
never executed: return true;
0
2759 if (d->hasSpans()
d->hasSpans()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2760 QSpanCollection::Span span = d->span(index.row(), index.column());-
2761 return
never executed: return !((span.top() == index.row()) && (span.left() == index.column()));
!((span.top() == index.row()) && (span.left() == index.column()));
never executed: return !((span.top() == index.row()) && (span.left() == index.column()));
0
2762 }-
2763 return
never executed: return false;
false;
never executed: return false;
0
2764}-
2765void QTableView::setSpan(int row, int column, int rowSpan, int columnSpan)-
2766{-
2767 QTableViewPrivate * const d = d_func();-
2768 if (row < 0
row < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| column < 0
column < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| rowSpan < 0
rowSpan < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| columnSpan < 0
columnSpan < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2769 return;
never executed: return;
0
2770 d->setSpan(row, column, rowSpan, columnSpan);-
2771 d->viewport->update();-
2772}
never executed: end of block
0
2773int QTableView::rowSpan(int row, int column) const-
2774{-
2775 const QTableViewPrivate * const d = d_func();-
2776 return
never executed: return d->rowSpan(row, column);
d->rowSpan(row, column);
never executed: return d->rowSpan(row, column);
0
2777}-
2778int QTableView::columnSpan(int row, int column) const-
2779{-
2780 const QTableViewPrivate * const d = d_func();-
2781 return
never executed: return d->columnSpan(row, column);
d->columnSpan(row, column);
never executed: return d->columnSpan(row, column);
0
2782}-
2783void QTableView::clearSpans()-
2784{-
2785 QTableViewPrivate * const d = d_func();-
2786 d->spans.clear();-
2787 d->viewport->update();-
2788}
never executed: end of block
0
2789-
2790void QTableViewPrivate::_q_selectRow(int row)-
2791{-
2792 selectRow(row, false);-
2793}
never executed: end of block
0
2794-
2795void QTableViewPrivate::_q_selectColumn(int column)-
2796{-
2797 selectColumn(column, false);-
2798}
never executed: end of block
0
2799-
2800void QTableViewPrivate::selectRow(int row, bool anchor)-
2801{-
2802 QTableView * const q = q_func();-
2803-
2804 if (q->selectionBehavior() == QTableView::SelectColumns
q->selectionBe...:SelectColumnsDescription
TRUEnever evaluated
FALSEnever evaluated
0
2805 || (q->selectionMode() == QTableView::SingleSelection
q->selectionMo...ingleSelectionDescription
TRUEnever evaluated
FALSEnever evaluated
0
2806 && q->selectionBehavior() == QTableView::SelectItems
q->selectionBe...w::SelectItemsDescription
TRUEnever evaluated
FALSEnever evaluated
))
0
2807 return;
never executed: return;
0
2808-
2809 if (row >= 0
row >= 0Description
TRUEnever evaluated
FALSEnever evaluated
&& row < model->rowCount(root)
row < model->rowCount(root)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2810 int column = horizontalHeader->logicalIndexAt(q->isRightToLeft() ? viewport->width() : 0);-
2811 QModelIndex index = model->index(row, column, root);-
2812 QItemSelectionModel::SelectionFlags command = q->selectionCommand(index);-
2813 selectionModel->setCurrentIndex(index, QItemSelectionModel::NoUpdate);-
2814 if ((anchor
anchorDescription
TRUEnever evaluated
FALSEnever evaluated
&& !(command & QItemSelectionModel::Current)
!(command & QI...odel::Current)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2815 || (
(q->selectionM...ngleSelection)Description
TRUEnever evaluated
FALSEnever evaluated
q->selectionMode() == QTableView::SingleSelection)
(q->selectionM...ngleSelection)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2816 rowSectionAnchor = row;
never executed: rowSectionAnchor = row;
0
2817-
2818 if (q->selectionMode() != QTableView::SingleSelection
q->selectionMo...ingleSelectionDescription
TRUEnever evaluated
FALSEnever evaluated
0
2819 && command.testFlag(QItemSelectionModel::Toggle)
command.testFl...Model::Toggle)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2820 if (anchor
anchorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2821 ctrlDragSelectionFlag = verticalHeader->selectionModel()->selectedRows().contains(index)
verticalHeader...ontains(index)Description
TRUEnever evaluated
FALSEnever evaluated
never executed: ctrlDragSelectionFlag = verticalHeader->selectionModel()->selectedRows().contains(index) ? QItemSelectionModel::Deselect : QItemSelectionModel::Select;
0
2822 ? QItemSelectionModel::Deselect : QItemSelectionModel::Select;
never executed: ctrlDragSelectionFlag = verticalHeader->selectionModel()->selectedRows().contains(index) ? QItemSelectionModel::Deselect : QItemSelectionModel::Select;
0
2823 command &= ~QItemSelectionModel::Toggle;-
2824 command |= ctrlDragSelectionFlag;-
2825 if (!anchor
!anchorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2826 command |= QItemSelectionModel::Current;
never executed: command |= QItemSelectionModel::Current;
0
2827 }
never executed: end of block
0
2828-
2829 QModelIndex upper = model->index(qMin(rowSectionAnchor, row), column, root);-
2830 QModelIndex lower = model->index(qMax(rowSectionAnchor, row), column, root);-
2831 if ((verticalHeader->sectionsMoved()
verticalHeader...ectionsMoved()Description
TRUEnever evaluated
FALSEnever evaluated
&& upper.row() != lower.row()
upper.row() != lower.row()Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
2832 q->setSelection(q->visualRect(upper) | q->visualRect(lower), command | QItemSelectionModel::Rows);-
2833 }
never executed: end of block
else {
0
2834 selectionModel->select(QItemSelection(upper, lower), command | QItemSelectionModel::Rows);-
2835 }
never executed: end of block
0
2836 }-
2837}
never executed: end of block
0
2838-
2839void QTableViewPrivate::selectColumn(int column, bool anchor)-
2840{-
2841 QTableView * const q = q_func();-
2842-
2843 if (q->selectionBehavior() == QTableView::SelectRows
q->selectionBe...ew::SelectRowsDescription
TRUEnever evaluated
FALSEnever evaluated
0
2844 || (q->selectionMode() == QTableView::SingleSelection
q->selectionMo...ingleSelectionDescription
TRUEnever evaluated
FALSEnever evaluated
0
2845 && q->selectionBehavior() == QTableView::SelectItems
q->selectionBe...w::SelectItemsDescription
TRUEnever evaluated
FALSEnever evaluated
))
0
2846 return;
never executed: return;
0
2847-
2848 if (column >= 0
column >= 0Description
TRUEnever evaluated
FALSEnever evaluated
&& column < model->columnCount(root)
column < model...umnCount(root)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2849 int row = verticalHeader->logicalIndexAt(0);-
2850 QModelIndex index = model->index(row, column, root);-
2851 QItemSelectionModel::SelectionFlags command = q->selectionCommand(index);-
2852 selectionModel->setCurrentIndex(index, QItemSelectionModel::NoUpdate);-
2853 if ((anchor
anchorDescription
TRUEnever evaluated
FALSEnever evaluated
&& !(command & QItemSelectionModel::Current)
!(command & QI...odel::Current)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2854 || (
(q->selectionM...ngleSelection)Description
TRUEnever evaluated
FALSEnever evaluated
q->selectionMode() == QTableView::SingleSelection)
(q->selectionM...ngleSelection)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2855 columnSectionAnchor = column;
never executed: columnSectionAnchor = column;
0
2856-
2857 if (q->selectionMode() != QTableView::SingleSelection
q->selectionMo...ingleSelectionDescription
TRUEnever evaluated
FALSEnever evaluated
0
2858 && command.testFlag(QItemSelectionModel::Toggle)
command.testFl...Model::Toggle)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2859 if (anchor
anchorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2860 ctrlDragSelectionFlag = horizontalHeader->selectionModel()->selectedColumns().contains(index)
horizontalHead...ontains(index)Description
TRUEnever evaluated
FALSEnever evaluated
never executed: ctrlDragSelectionFlag = horizontalHeader->selectionModel()->selectedColumns().contains(index) ? QItemSelectionModel::Deselect : QItemSelectionModel::Select;
0
2861 ? QItemSelectionModel::Deselect : QItemSelectionModel::Select;
never executed: ctrlDragSelectionFlag = horizontalHeader->selectionModel()->selectedColumns().contains(index) ? QItemSelectionModel::Deselect : QItemSelectionModel::Select;
0
2862 command &= ~QItemSelectionModel::Toggle;-
2863 command |= ctrlDragSelectionFlag;-
2864 if (!anchor
!anchorDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2865 command |= QItemSelectionModel::Current;
never executed: command |= QItemSelectionModel::Current;
0
2866 }
never executed: end of block
0
2867-
2868 QModelIndex left = model->index(row, qMin(columnSectionAnchor, column), root);-
2869 QModelIndex right = model->index(row, qMax(columnSectionAnchor, column), root);-
2870 if ((horizontalHeader->sectionsMoved()
horizontalHead...ectionsMoved()Description
TRUEnever evaluated
FALSEnever evaluated
&& left.column() != right.column()
left.column() ...right.column()Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
2871 q->setSelection(q->visualRect(left) | q->visualRect(right), command | QItemSelectionModel::Columns);-
2872 }
never executed: end of block
else {
0
2873 selectionModel->select(QItemSelection(left, right), command | QItemSelectionModel::Columns);-
2874 }
never executed: end of block
0
2875 }-
2876}
never executed: end of block
0
2877-
2878-
2879-
2880-
2881void QTableView::currentChanged(const QModelIndex &current, const QModelIndex &previous)-
2882{-
2883-
2884 if (QAccessible::isActive()
QAccessible::isActive()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2885 if (current.isValid()
current.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2886 QTableViewPrivate * const d = d_func();-
2887 int entry = d->accessibleTable2Index(current);-
2888 QAccessibleEvent event(this, QAccessible::Focus);-
2889 event.setChild(entry);-
2890 QAccessible::updateAccessibility(&event);-
2891 }
never executed: end of block
0
2892 }
never executed: end of block
0
2893-
2894 QAbstractItemView::currentChanged(current, previous);-
2895}
never executed: end of block
0
2896-
2897-
2898-
2899-
2900void QTableView::selectionChanged(const QItemSelection &selected,-
2901 const QItemSelection &deselected)-
2902{-
2903 QTableViewPrivate * const d = d_func();-
2904 (void)d;-
2905-
2906 if (QAccessible::isActive()
QAccessible::isActive()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2907-
2908 QModelIndex sel = selected.indexes().value(0);-
2909 if (sel.isValid()
sel.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2910 int entry = d->accessibleTable2Index(sel);-
2911 QAccessibleEvent event(this, QAccessible::SelectionAdd);-
2912 event.setChild(entry);-
2913 QAccessible::updateAccessibility(&event);-
2914 }
never executed: end of block
0
2915 QModelIndex desel = deselected.indexes().value(0);-
2916 if (desel.isValid()
desel.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
2917 int entry = d->accessibleTable2Index(desel);-
2918 QAccessibleEvent event(this, QAccessible::SelectionRemove);-
2919 event.setChild(entry);-
2920 QAccessible::updateAccessibility(&event);-
2921 }
never executed: end of block
0
2922 }
never executed: end of block
0
2923-
2924 QAbstractItemView::selectionChanged(selected, deselected);-
2925}
never executed: end of block
0
2926-
2927int QTableView::visualIndex(const QModelIndex &index) const-
2928{-
2929 return
never executed: return index.row();
index.row();
never executed: return index.row();
0
2930}-
2931-
2932-
2933-
2934-
Switch to Source codePreprocessed file

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