| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/itemviews/qtableview.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | void 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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | SubIndex sub_index; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | if (it_y != index.end()
| 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()
| 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(-
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | (*it_y).insert(-span->left(), span); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | if(it_y == index.begin()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | --it_y; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | void QSpanCollection::updateSpan(QSpanCollection::Span *span, int old_height) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | if (old_height < span->height()
| 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__,101) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | while (-
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | (*it_y).insert(-span->left(), span); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | if(it_y == index.begin()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | --it_y; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | } never executed: else if (old_height > span->height()end of block
| 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__,111) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | while (-
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | if (-
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | int removed = (*it_y).remove(-span->left()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | ((!(removed == 1)) ? qt_assert("removed == 1",__FILE__,115) : qt_noop()); (void)removed;; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | if (it_y->isEmpty()
| 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()
| 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
| 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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | QSpanCollection::Span *QSpanCollection::spanAt(int x, int y) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | Index::const_iterator it_y = index.lowerBound(-y); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | if (it_y == index.end()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | SubIndex::const_iterator it_x = (*it_y).lowerBound(-x); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | if (it_x == (*it_y).end()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | Span *span = *it_x; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | if (span->right() >= x
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | return never executed: span;return span;never executed: return span; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | void QSpanCollection::clear() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | qDeleteAll(spans); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | index.clear(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | spans.clear(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | QList<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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | -- never executed: it_y;--it_y;never executed: --it_y; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | while(-
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | SubIndex::const_iterator it_x = (*it_y).lowerBound(-x); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | if (it_x == (*it_y).end()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | -- never executed: it_x;--it_x;never executed: --it_x; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | while(-
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | Span *s = *it_x; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | if (s->bottom() >= y
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | list << s; never executed: list << s; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | if (it_x == (*it_y).begin()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | --it_x; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | if(it_y == index.begin()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | --it_y; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | return never executed: list.toList();return list.toList();never executed: return list.toList(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | void QSpanCollection::updateInsertedRows(int start, int end) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | if (spans.isEmpty()
| 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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | Span *span = *it; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | if (span->m_bottom < start
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | if (span->m_top >= start
| 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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | int y = -it_y.key(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | if (y < start
| 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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | void QSpanCollection::updateInsertedColumns(int start, int end) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | if (spans.isEmpty()
| 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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | Span *span = *it; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | if (span->m_right < start
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | if (span->m_left >= start
| 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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | SubIndex &subindex = it_y.value(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | for (SubIndex::iterator it = subindex.begin(); it != subindex.end()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | int x = -it.key(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | if (x < start
| 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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | bool QSpanCollection::cleanSpanSubIndex(QSpanCollection::SubIndex &subindex, int y, bool update) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | if (subindex.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | return never executed: true;return 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
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | it = subindex.erase(it); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | if (update
| 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
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | should_be_deleted = false; never executed: should_be_deleted = false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | } never executed: while (it != subindex.begin()end of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | return never executed: should_be_deleted;return should_be_deleted;never executed: return should_be_deleted; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | void QSpanCollection::updateRemovedRows(int start, int end) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | if (spans.isEmpty()
| 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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | Span *span = *it; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | if (span->m_bottom < start
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | ++it; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | if (span->m_top < start
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | if (span->m_bottom <= end
| 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
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | if (span->m_top <= end
| 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: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | span->will_be_deleted = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | if (span->m_top == span->m_bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | span->will_be_deleted = true; never executed: span->will_be_deleted = true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | if (span->will_be_deleted
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | spansToBeDeleted.append(span); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | it = spans.erase(it); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | ++it; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | if (spans.isEmpty()
| 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
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | if (cleanSpanSubIndex(subindex, y)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | it_y = index.erase(it_y); never executed: it_y = index.erase(it_y); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | } never executed: else if (y >= startend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | bool span_at_start = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | SubIndex spansToBeMoved; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | for (SubIndex::iterator it = subindex.begin(); it != subindex.end()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | Span *span = it.value(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | if (span->will_be_deleted
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | if (!span_at_start
| 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
| 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
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | Index::iterator it_start; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | if (y == start
| 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()
| 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()
| 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: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | if (y == end + 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | Index::iterator it_top = index.find(-y + delta); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | if (it_top == index.end()
| 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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | Span *span = it.value(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | if (!span->will_be_deleted
| 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: else {end of block | 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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | qDeleteAll(spansToBeDeleted); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | void QSpanCollection::updateRemovedColumns(int start, int end) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | if (spans.isEmpty()
| 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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | Span *span = *it; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | if (span->m_right < start
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | ++it; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | if (span->m_left < start
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | if (span->m_right <= end
| 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
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | if (span->m_left <= end
| 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: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | span->will_be_deleted = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | if (span->m_top == span->m_bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | span->will_be_deleted = true; never executed: span->will_be_deleted = true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | if (span->will_be_deleted
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | toBeDeleted.append(span); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | it = spans.erase(it); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | ++it; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | if (spans.isEmpty()
| 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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | int y = -it_y.key(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | if (cleanSpanSubIndex(it_y.value(), y, true)
| 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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | bool QSpanCollection::checkConsistency() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | for (Index::const_iterator it_y = index.begin(); it_y != index.end()
| 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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | int x = -it.key(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | Span *span = it.value(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | if (!spans.contains(span)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | || y < span->top()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | return never executed: false;return 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
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | || (span->width() == 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | for (int y = span->top(); y <= span->bottom()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | Index::const_iterator it_y = index.find(-y); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | if (it_y == index.end()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | if (y == span->top()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | return never executed: false;return 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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | class 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 {}; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | public: | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | state |= QStyle::State_Enabled; never executed: state |= QStyle::State_Enabled; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | if (isActiveWindow()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | state |= QStyle::State_Active; never executed: state |= QStyle::State_Active; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | if (isDown()
| 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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | void 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__ ":" "617"), q, qFlagLocation("1""selectAll()" "\0" __FILE__ ":" "617")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | void QTableViewPrivate::trimHiddenSelections(QItemSelectionRange *range) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | ((!(range && range->isValid())) ? qt_assert("range && range->isValid()",__FILE__,626) : 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
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | -- never executed: bottom;--bottom;never executed: --bottom; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | while (right >= left
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | -- never executed: right;--right;never executed: --right; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | if (top > bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | *range = QItemSelectionRange(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | while (verticalHeader->isSectionHidden(top)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | ++ never executed: top;++top;never executed: ++top; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | while (horizontalHeader->isSectionHidden(left)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | ++ never executed: left;++left;never executed: ++left; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | if (top > bottom
| 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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | void QTableViewPrivate::setSpan(int row, int column, int rowSpan, int columnSpan) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 597 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 598 | if (row < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 599 | QMessageLogger(__FILE__, 665, __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
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 605 | if (sp->top() != row
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 606 | QMessageLogger(__FILE__, 672, __PRETTY_FUNCTION__).warning("QTableView::setSpan: span cannot overlap"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 607 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 608 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 609 | if (rowSpan == 1
| 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 (rowSpan == 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 618 | QMessageLogger(__FILE__, 684, __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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 629 | QSpanCollection::Span QTableViewPrivate::span(int row, int column) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 630 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 631 | QSpanCollection::Span *sp = spans.spanAt(column, row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 632 | if (sp
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 633 | return never executed: *sp;return *sp;never executed: return *sp; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 634 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 635 | return never executed: QSpanCollection::Span(row, column, 1, 1);return QSpanCollection::Span(row, column, 1, 1);never executed: return QSpanCollection::Span(row, column, 1, 1); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 636 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 637 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 638 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 639 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 640 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 641 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 642 | int QTableViewPrivate::sectionSpanEndLogical(const QHeaderView *header, int logical, int span) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 643 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 644 | int visual = header->visualIndex(logical); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 645 | for (int i = 1; i < span
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 646 | if (++
| 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: logical;return logical;never executed: return logical; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 652 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 653 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 654 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 655 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 656 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 657 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 658 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 659 | int QTableViewPrivate::sectionSpanSize(const QHeaderView *header, int logical, int span) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 660 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 661 | int endLogical = sectionSpanEndLogical(header, logical, span); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 662 | return never executed: header->sectionPosition(endLogical)return header->sectionPosition(endLogical) - header->sectionPosition(logical) + header->sectionSize(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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 673 | bool QTableViewPrivate::spanContainsSection(const QHeaderView *header, int logical, int spanLogical, int span) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 674 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 675 | if (logical == spanLogical
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 676 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 677 | int visual = header->visualIndex(spanLogical); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 678 | for (int i = 1; i < span
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 679 | if (++
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 680 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 681 | spanLogical = header->logicalIndex(visual); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 682 | if (logical == spanLogical
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 683 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 684 | ++i; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 685 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 686 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 687 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 688 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 689 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 690 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 691 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 692 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 693 | QRect 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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 704 | column = span.right(); never executed: column = span.right(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 705 | int colp = horizontalHeader->sectionViewportPosition(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 706 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 707 | const int i = showGrid
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 708 | if (q->isRightToLeft()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 709 | return never executed: QRect(colp + i, rowp, colw - i, rowh - i);return QRect(colp + i, rowp, colw - i, rowh - i);never executed: return QRect(colp + i, rowp, colw - i, rowh - i); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 710 | return never executed: QRect(colp, rowp, colw - i, rowh - i);return 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 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 719 | void 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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 728 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 729 | if (!sectionMoved
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 730 | visibleSpans = spans.spansInRect(logicalColumn(firstVisualColumn), logicalRow(firstVisualRow), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 731 | lastVisualColumn - firstVisualColumn + 1, lastVisualRow - firstVisualRow + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 732 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 733 | QSet<QSpanCollection::Span *> set; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 734 | for(int x = firstVisualColumn; x <= lastVisualColumn
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 735 | for(int y = firstVisualRow; y <= lastVisualRow
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 736 | set. never executed: insert(spans.spanAt(x,y));set.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()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 746 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 747 | QRect rect = visualSpanRect(*span); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 748 | rect.translate(scrollDelayOffset); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 749 | if (!area.intersects(rect)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 750 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 751 | QStyleOptionViewItem opt = option; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 752 | opt.rect = rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 753 | alternateBase = alternatingColors
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 754 | if (alternateBase
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 755 | opt.features |= QStyleOptionViewItem::Alternate; never executed: opt.features |= QStyleOptionViewItem::Alternate; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 756 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 757 | opt.features &= ~QStyleOptionViewItem::Alternate; never executed: opt.features &= ~QStyleOptionViewItem::Alternate; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 758 | drawCell(painter, opt, index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 759 | region -= rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 760 | for (int r = span->top(); r <= span->bottom()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 761 | const int vr = visualRow(r); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 762 | if (vr < firstVisualRow
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 763 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 764 | for (int c = span->left(); c <= span->right()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 765 | const int vc = visualColumn(c); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 766 | if (vc < firstVisualColumn
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 767 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 768 | drawn->setBit((vr - firstVisualRow) * (lastVisualColumn - firstVisualColumn + 1) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 769 | + vc - firstVisualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 770 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 771 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 772 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 773 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 774 | painter->setClipRegion(region); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 775 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 776 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 777 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 778 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 779 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 780 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 781 | void QTableViewPrivate::_q_updateSpanInsertedRows(const QModelIndex &parent, int start, int end) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 782 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 783 | (void)parent; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 784 | spans.updateInsertedRows(start, end); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 785 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 786 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 787 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 788 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 789 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 790 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 791 | void QTableViewPrivate::_q_updateSpanInsertedColumns(const QModelIndex &parent, int start, int end) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 792 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 793 | (void)parent; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 794 | spans.updateInsertedColumns(start, end); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 795 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 796 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 797 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 798 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 799 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 800 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 801 | void QTableViewPrivate::_q_updateSpanRemovedRows(const QModelIndex &parent, int start, int end) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 802 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 803 | (void)parent; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 804 | spans.updateRemovedRows(start, end); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 805 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 806 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 807 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 808 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 809 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 810 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 811 | void QTableViewPrivate::_q_updateSpanRemovedColumns(const QModelIndex &parent, int start, int end) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 812 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 813 | (void)parent; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 814 | spans.updateRemovedColumns(start, end); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 815 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 816 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 817 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 818 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 819 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 820 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 821 | void QTableViewPrivate::drawCell(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 822 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 823 | QTableView * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 824 | QStyleOptionViewItem opt = option; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 825 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 826 | if (selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 827 | opt.state |= QStyle::State_Selected; never executed: opt.state |= QStyle::State_Selected; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 828 | if (index == hover
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 829 | opt.state |= QStyle::State_MouseOver; never executed: opt.state |= QStyle::State_MouseOver; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 830 | if (option.state & QStyle::State_Enabled
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 831 | QPalette::ColorGroup cg; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 832 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 833 | opt.state &= ~QStyle::State_Enabled; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 834 | cg = QPalette::Disabled; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 835 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 836 | cg = QPalette::Normal; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 837 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 838 | opt.palette.setCurrentColorGroup(cg); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 839 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 840 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 841 | if (index == q->currentIndex()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 842 | const bool focus = (q->hasFocus()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 843 | if (focus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 844 | opt.state |= QStyle::State_HasFocus; never executed: opt.state |= QStyle::State_HasFocus; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 845 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 846 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 847 | q->style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, q); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 848 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 849 | q->itemDelegate(index)->paint(painter, opt, index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 850 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 851 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 852 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 853 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 854 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 855 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 856 | int QTableViewPrivate::widthHintForIndex(const QModelIndex &index, int hint, const QStyleOptionViewItem &option) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 857 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 858 | const QTableView * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 859 | QWidget *editor = editorForIndex(index).widget.data(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 860 | if (editor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 861 | hint = qMax(hint, editor->sizeHint().width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 862 | int min = editor->minimumSize().width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 863 | int max = editor->maximumSize().width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 864 | hint = qBound(min, hint, max); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 865 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 866 | hint = qMax(hint, q->itemDelegate(index)->sizeHint(option, index).width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 867 | return never executed: hint;return hint;never executed: return hint; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 868 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 869 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 870 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 871 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 872 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 873 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 874 | int QTableViewPrivate::heightHintForIndex(const QModelIndex &index, int hint, QStyleOptionViewItem &option) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 875 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 876 | const QTableView * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 877 | QWidget *editor = editorForIndex(index).widget.data(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 878 | if (editor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 879 | hint = qMax(hint, editor->sizeHint().height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 880 | int min = editor->minimumSize().height(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 881 | int max = editor->maximumSize().height(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 882 | hint = qBound(min, hint, max); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 883 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 884 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 885 | if (wrapItemText
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 886 | option.rect.setY(q->rowViewportPosition(index.row())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 887 | int height = q->rowHeight(index.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 888 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 889 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 890 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 891 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 892 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 893 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 894 | if (height == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 895 | height = 1; never executed: height = 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 896 | option.rect.setHeight(height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 897 | option.rect.setX(q->columnViewportPosition(index.column())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 898 | option.rect.setWidth(q->columnWidth(index.column())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 899 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 900 | hint = qMax(hint, q->itemDelegate(index)->sizeHint(option, index).height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 901 | return never executed: hint;return hint;never executed: return hint; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 902 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 903 | QTableView::QTableView(QWidget *parent) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 904 | : QAbstractItemView(*new QTableViewPrivate, parent) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 905 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 906 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 907 | d->init(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 908 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 909 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 910 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 911 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 912 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 913 | QTableView::QTableView(QTableViewPrivate &dd, QWidget *parent) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 914 | : QAbstractItemView(dd, parent) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 915 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 916 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 917 | d->init(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 918 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 919 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 920 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 921 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 922 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 923 | QTableView::~QTableView() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 924 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 925 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 926 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 927 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 928 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 929 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 930 | QSize QTableView::viewportSizeHint() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 931 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 932 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 933 | QSize result( (d->verticalHeader->isHidden() ? 0 : d->verticalHeader->width()) + d->horizontalHeader->length(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 934 | (d->horizontalHeader->isHidden() ? 0 : d->horizontalHeader->height()) + d->verticalHeader->length()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 935 | result += QSize(verticalScrollBar()->isVisible() ? verticalScrollBar()->width() : 0, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 936 | horizontalScrollBar()->isVisible() ? horizontalScrollBar()->height() : 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 937 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 938 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 939 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 940 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 941 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 942 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 943 | void QTableView::setModel(QAbstractItemModel *model) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 944 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 945 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 946 | if (model == d->model
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 947 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 948 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 949 | if (d->model
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 950 | disconnect(d->model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1117"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 951 | this, qFlagLocation("1""_q_updateSpanInsertedRows(QModelIndex,int,int)" "\0" __FILE__ ":" "1118")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 952 | disconnect(d->model, qFlagLocation("2""columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1119"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 953 | this, qFlagLocation("1""_q_updateSpanInsertedColumns(QModelIndex,int,int)" "\0" __FILE__ ":" "1120")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 954 | disconnect(d->model, qFlagLocation("2""rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1121"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 955 | this, qFlagLocation("1""_q_updateSpanRemovedRows(QModelIndex,int,int)" "\0" __FILE__ ":" "1122")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 956 | disconnect(d->model, qFlagLocation("2""columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1123"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 957 | this, qFlagLocation("1""_q_updateSpanRemovedColumns(QModelIndex,int,int)" "\0" __FILE__ ":" "1124")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 958 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 959 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 960 | disconnect(d->selectionModel, qFlagLocation("2""currentRowChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "1127"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 961 | d->model, qFlagLocation("1""submit()" "\0" __FILE__ ":" "1128")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 962 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 963 | if (model
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 964 | connect(model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1131"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 965 | this, qFlagLocation("1""_q_updateSpanInsertedRows(QModelIndex,int,int)" "\0" __FILE__ ":" "1132")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 966 | connect(model, qFlagLocation("2""columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1133"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 967 | this, qFlagLocation("1""_q_updateSpanInsertedColumns(QModelIndex,int,int)" "\0" __FILE__ ":" "1134")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 968 | connect(model, qFlagLocation("2""rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1135"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 969 | this, qFlagLocation("1""_q_updateSpanRemovedRows(QModelIndex,int,int)" "\0" __FILE__ ":" "1136")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 970 | connect(model, qFlagLocation("2""columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1137"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 971 | this, qFlagLocation("1""_q_updateSpanRemovedColumns(QModelIndex,int,int)" "\0" __FILE__ ":" "1138")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 972 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 973 | d->verticalHeader->setModel(model); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 974 | d->horizontalHeader->setModel(model); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 975 | QAbstractItemView::setModel(model); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 976 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 977 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 978 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 979 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 980 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 981 | void QTableView::setRootIndex(const QModelIndex &index) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 982 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 983 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 984 | if (index == d->root
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 985 | viewport()->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 986 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 987 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 988 | d->verticalHeader->setRootIndex(index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 989 | d->horizontalHeader->setRootIndex(index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 990 | QAbstractItemView::setRootIndex(index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 991 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 992 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 993 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 994 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 995 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 996 | void QTableView::doItemsLayout() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 997 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 998 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 999 | QAbstractItemView::doItemsLayout(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1000 | d->verticalHeader->d_func()->setScrollOffset(verticalScrollBar(), verticalScrollMode()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1001 | if (!d->verticalHeader->updatesEnabled()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1002 | d->verticalHeader->setUpdatesEnabled(true); never executed: d->verticalHeader->setUpdatesEnabled(true); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1003 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1004 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1005 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1006 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1007 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1008 | void QTableView::setSelectionModel(QItemSelectionModel *selectionModel) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1009 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1010 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1011 | ((!(selectionModel)) ? qt_assert("selectionModel",__FILE__,1178) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1012 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1013 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1014 | disconnect(d->selectionModel, qFlagLocation("2""currentRowChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "1181"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1015 | d->model, qFlagLocation("1""submit()" "\0" __FILE__ ":" "1182")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1016 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1017 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1018 | d->verticalHeader->setSelectionModel(selectionModel); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1019 | d->horizontalHeader->setSelectionModel(selectionModel); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1020 | QAbstractItemView::setSelectionModel(selectionModel); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1021 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1022 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1023 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1024 | connect(d->selectionModel, qFlagLocation("2""currentRowChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "1191"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1025 | d->model, qFlagLocation("1""submit()" "\0" __FILE__ ":" "1192")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1026 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1027 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1028 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1029 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1030 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1031 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1032 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1033 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1034 | QHeaderView *QTableView::horizontalHeader() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1035 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1036 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1037 | return never executed: d->horizontalHeader;return d->horizontalHeader;never executed: return d->horizontalHeader; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1038 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1039 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1040 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1041 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1042 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1043 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1044 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1045 | QHeaderView *QTableView::verticalHeader() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1046 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1047 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1048 | return never executed: d->verticalHeader;return d->verticalHeader;never executed: return d->verticalHeader; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1049 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1050 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1051 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1052 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1053 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1054 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1055 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1056 | void QTableView::setHorizontalHeader(QHeaderView *header) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1057 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1058 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1059 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1060 | if (!header
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1061 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1062 | if (d->horizontalHeader
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1063 | delete d->horizontalHeader; never executed: delete d->horizontalHeader; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1064 | d->horizontalHeader = header; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1065 | d->horizontalHeader->setParent(this); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1066 | d->horizontalHeader->d_func()->setAllowUserMoveOfSection0(true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1067 | if (!d->horizontalHeader->model()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1068 | d->horizontalHeader->setModel(d->model); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1069 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1070 | d->horizontalHeader->setSelectionModel(d->selectionModel); never executed: d->horizontalHeader->setSelectionModel(d->selectionModel); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1071 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1072 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1073 | connect(d->horizontalHeader,qFlagLocation("2""sectionResized(int,int,int)" "\0" __FILE__ ":" "1240"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1074 | this, qFlagLocation("1""columnResized(int,int,int)" "\0" __FILE__ ":" "1241")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1075 | connect(d->horizontalHeader, qFlagLocation("2""sectionMoved(int,int,int)" "\0" __FILE__ ":" "1242"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1076 | this, qFlagLocation("1""columnMoved(int,int,int)" "\0" __FILE__ ":" "1243")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1077 | connect(d->horizontalHeader, qFlagLocation("2""sectionCountChanged(int,int)" "\0" __FILE__ ":" "1244"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1078 | this, qFlagLocation("1""columnCountChanged(int,int)" "\0" __FILE__ ":" "1245")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1079 | connect(d->horizontalHeader, qFlagLocation("2""sectionPressed(int)" "\0" __FILE__ ":" "1246"), this, qFlagLocation("1""selectColumn(int)" "\0" __FILE__ ":" "1246")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1080 | connect(d->horizontalHeader, qFlagLocation("2""sectionEntered(int)" "\0" __FILE__ ":" "1247"), this, qFlagLocation("1""_q_selectColumn(int)" "\0" __FILE__ ":" "1247")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1081 | connect(d->horizontalHeader, qFlagLocation("2""sectionHandleDoubleClicked(int)" "\0" __FILE__ ":" "1248"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1082 | this, qFlagLocation("1""resizeColumnToContents(int)" "\0" __FILE__ ":" "1249")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1083 | connect(d->horizontalHeader, qFlagLocation("2""geometriesChanged()" "\0" __FILE__ ":" "1250"), this, qFlagLocation("1""updateGeometries()" "\0" __FILE__ ":" "1250")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1084 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1085 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1086 | setSortingEnabled(d->sortingEnabled); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1087 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1088 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1089 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1090 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1091 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1092 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1093 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1094 | void QTableView::setVerticalHeader(QHeaderView *header) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1095 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1096 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1097 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1098 | if (!header
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1099 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1100 | if (d->verticalHeader
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1101 | delete d->verticalHeader; never executed: delete d->verticalHeader; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1102 | d->verticalHeader = header; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1103 | d->verticalHeader->setParent(this); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1104 | d->verticalHeader->d_func()->setAllowUserMoveOfSection0(true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1105 | if (!d->verticalHeader->model()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1106 | d->verticalHeader->setModel(d->model); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1107 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1108 | d->verticalHeader->setSelectionModel(d->selectionModel); never executed: d->verticalHeader->setSelectionModel(d->selectionModel); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1109 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1110 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1111 | connect(d->verticalHeader, qFlagLocation("2""sectionResized(int,int,int)" "\0" __FILE__ ":" "1278"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1112 | this, qFlagLocation("1""rowResized(int,int,int)" "\0" __FILE__ ":" "1279")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1113 | connect(d->verticalHeader, qFlagLocation("2""sectionMoved(int,int,int)" "\0" __FILE__ ":" "1280"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1114 | this, qFlagLocation("1""rowMoved(int,int,int)" "\0" __FILE__ ":" "1281")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1115 | connect(d->verticalHeader, qFlagLocation("2""sectionCountChanged(int,int)" "\0" __FILE__ ":" "1282"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1116 | this, qFlagLocation("1""rowCountChanged(int,int)" "\0" __FILE__ ":" "1283")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1117 | connect(d->verticalHeader, qFlagLocation("2""sectionPressed(int)" "\0" __FILE__ ":" "1284"), this, qFlagLocation("1""selectRow(int)" "\0" __FILE__ ":" "1284")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1118 | connect(d->verticalHeader, qFlagLocation("2""sectionEntered(int)" "\0" __FILE__ ":" "1285"), this, qFlagLocation("1""_q_selectRow(int)" "\0" __FILE__ ":" "1285")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1119 | connect(d->verticalHeader, qFlagLocation("2""sectionHandleDoubleClicked(int)" "\0" __FILE__ ":" "1286"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1120 | this, qFlagLocation("1""resizeRowToContents(int)" "\0" __FILE__ ":" "1287")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1121 | connect(d->verticalHeader, qFlagLocation("2""geometriesChanged()" "\0" __FILE__ ":" "1288"), this, qFlagLocation("1""updateGeometries()" "\0" __FILE__ ":" "1288")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1122 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1123 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1124 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1125 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1126 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1127 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1128 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1129 | void QTableView::scrollContentsBy(int dx, int dy) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1130 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1131 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1132 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1133 | d->delayedAutoScroll.stop(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1134 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1135 | dx = isRightToLeft()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1136 | if (dx
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1137 | int oldOffset = d->horizontalHeader->offset(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1138 | d->horizontalHeader->d_func()->setScrollOffset(horizontalScrollBar(), horizontalScrollMode()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1139 | if (horizontalScrollMode() == QAbstractItemView::ScrollPerItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1140 | int newOffset = d->horizontalHeader->offset(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1141 | dx = isRightToLeft()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1142 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1143 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1144 | if (dy
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1145 | int oldOffset = d->verticalHeader->offset(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1146 | d->verticalHeader->d_func()->setScrollOffset(verticalScrollBar(), verticalScrollMode()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1147 | if (verticalScrollMode() == QAbstractItemView::ScrollPerItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1148 | int newOffset = d->verticalHeader->offset(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1149 | dy = oldOffset - newOffset; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1150 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1151 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1152 | d->scrollContentsBy(dx, dy); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1153 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1154 | if (d->showGrid
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1155 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1156 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1157 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1158 | if (dy > 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1159 | d->viewport->update(0, dy, d->viewport->width(), dy); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1160 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1161 | if (dx > 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1162 | d->viewport->update(dx, 0, dx, d->viewport->height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1163 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1164 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1165 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1166 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1167 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1168 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1169 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1170 | QStyleOptionViewItem QTableView::viewOptions() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1171 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1172 | QStyleOptionViewItem option = QAbstractItemView::viewOptions(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1173 | option.showDecorationSelected = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1174 | return never executed: option;return option;never executed: return option; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1175 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1176 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1177 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1178 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1179 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1180 | void QTableView::paintEvent(QPaintEvent *event) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1181 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1182 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1183 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1184 | QStyleOptionViewItem option = d->viewOptionsV1(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1185 | const QPoint offset = d->scrollDelayOffset; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1186 | const bool showGrid = d->showGrid; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1187 | const int gridSize = showGrid
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1188 | const int gridHint = style()->styleHint(QStyle::SH_Table_GridLineColor, &option, this); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1189 | const QColor gridColor = static_cast<QRgb>(gridHint); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1190 | const QPen gridPen = QPen(gridColor, 0, d->gridStyle); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1191 | const QHeaderView *verticalHeader = d->verticalHeader; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1192 | const QHeaderView *horizontalHeader = d->horizontalHeader; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1193 | const bool alternate = d->alternatingColors; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1194 | const bool rightToLeft = isRightToLeft(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1195 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1196 | QPainter painter(d->viewport); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1197 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1198 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1199 | if (horizontalHeader->count() == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1200 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1201 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1202 | uint x = horizontalHeader->length() - horizontalHeader->offset() - (rightToLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1203 | uint y = verticalHeader->length() - verticalHeader->offset() - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1204 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1205 | const QRegion region = event->region().translated(offset); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1206 | const QVector<QRect> rects = region.rects(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1207 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1208 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1209 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1210 | int firstVisualRow = qMax(verticalHeader->visualIndexAt(0),0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1211 | int lastVisualRow = verticalHeader->visualIndexAt(verticalHeader->viewport()->height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1212 | if (lastVisualRow == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1213 | lastVisualRow = d->model->rowCount(d->root) - 1; never executed: lastVisualRow = d->model->rowCount(d->root) - 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1214 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1215 | int firstVisualColumn = horizontalHeader->visualIndexAt(0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1216 | int lastVisualColumn = horizontalHeader->visualIndexAt(horizontalHeader->viewport()->width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1217 | if (rightToLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1218 | qSwap(firstVisualColumn, lastVisualColumn); never executed: qSwap(firstVisualColumn, lastVisualColumn); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1219 | if (firstVisualColumn == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1220 | firstVisualColumn = 0; never executed: firstVisualColumn = 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1221 | if (lastVisualColumn == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1222 | lastVisualColumn = horizontalHeader->count() - 1; never executed: lastVisualColumn = horizontalHeader->count() - 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1223 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1224 | QBitArray drawn((lastVisualRow - firstVisualRow + 1) * (lastVisualColumn - firstVisualColumn + 1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1225 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1226 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1227 | d->drawAndClipSpans(region, &painter, option, &drawn, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1228 | firstVisualRow, lastVisualRow, firstVisualColumn, lastVisualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1229 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1230 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1231 | for (int i = 0; i < rects.size()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1232 | QRect dirtyArea = rects.at(i); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1233 | dirtyArea.setBottom(qMin(dirtyArea.bottom(), int(y))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1234 | if (rightToLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1235 | dirtyArea.setLeft(qMax(dirtyArea.left(), d->viewport->width() - int(x))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1236 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1237 | dirtyArea.setRight(qMin(dirtyArea.right(), int(x))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1238 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1239 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1240 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1241 | int left = horizontalHeader->visualIndexAt(dirtyArea.left()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1242 | int right = horizontalHeader->visualIndexAt(dirtyArea.right()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1243 | if (rightToLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1244 | qSwap(left, right); never executed: qSwap(left, right); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1245 | if (left == -1
never executed: left = 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1246 | if (right == -1
never executed: right = horizontalHeader->count() - 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1247 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1248 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1249 | int bottom = verticalHeader->visualIndexAt(dirtyArea.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1250 | if (bottom == -1
never executed: bottom = verticalHeader->count() - 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1251 | int top = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1252 | bool alternateBase = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1253 | if (alternate
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1254 | uint verticalOffset = verticalHeader->offset(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1255 | int row = verticalHeader->logicalIndex(top); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1256 | for (int y = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1257 | ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1258 | ++top) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1259 | row = verticalHeader->logicalIndex(top); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1260 | if (alternate
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1261 | alternateBase = !alternateBase; never executed: alternateBase = !alternateBase; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1262 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1263 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1264 | top = verticalHeader->visualIndexAt(dirtyArea.top()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1265 | alternateBase = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1266 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1267 | if (top == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1268 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1269 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1270 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1271 | for (int visualRowIndex = top; visualRowIndex <= bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1272 | int row = verticalHeader->logicalIndex(visualRowIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1273 | if (verticalHeader->isSectionHidden(row)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1274 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1275 | int rowY = rowViewportPosition(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1276 | rowY += offset.y(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1277 | int rowh = rowHeight(row) - gridSize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1278 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1279 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1280 | for (int visualColumnIndex = left; visualColumnIndex <= right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1281 | int currentBit = (visualRowIndex - firstVisualRow) * (lastVisualColumn - firstVisualColumn + 1) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1282 | + visualColumnIndex - firstVisualColumn; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1283 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1284 | if (currentBit < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1285 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1286 | drawn.setBit(currentBit); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1287 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1288 | int col = horizontalHeader->logicalIndex(visualColumnIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1289 | if (horizontalHeader->isSectionHidden(col)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1290 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1291 | int colp = columnViewportPosition(col); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1292 | colp += offset.x(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1293 | int colw = columnWidth(col) - gridSize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1294 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1295 | const QModelIndex index = d->model->index(row, col, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1296 | if (index.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1297 | option.rect = QRect(colp + (showGrid && rightToLeft ? 1 : 0), rowY, colw, rowh); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1298 | if (alternate
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1299 | if (alternateBase
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1300 | option.features |= QStyleOptionViewItem::Alternate; never executed: option.features |= QStyleOptionViewItem::Alternate; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1301 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1302 | option.features &= ~QStyleOptionViewItem::Alternate; never executed: option.features &= ~QStyleOptionViewItem::Alternate; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1303 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1304 | d->drawCell(&painter, option, index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1305 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1306 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1307 | alternateBase = !alternateBase
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1308 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1309 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1310 | if (showGrid
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1311 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1312 | while (verticalHeader->isSectionHidden(verticalHeader->logicalIndex(bottom))
never executed: bottom;--bottom;never executed: --bottom; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1313 | QPen old = painter.pen(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1314 | painter.setPen(gridPen); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1315 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1316 | for (int visualIndex = top; visualIndex <= bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1317 | int row = verticalHeader->logicalIndex(visualIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1318 | if (verticalHeader->isSectionHidden(row)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1319 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1320 | int rowY = rowViewportPosition(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1321 | rowY += offset.y(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1322 | int rowh = rowHeight(row) - gridSize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1323 | painter.drawLine(dirtyArea.left(), rowY + rowh, dirtyArea.right(), rowY + rowh); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1324 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1325 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1326 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1327 | for (int h = left; h <= right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1328 | int col = horizontalHeader->logicalIndex(h); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1329 | if (horizontalHeader->isSectionHidden(col)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1330 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1331 | int colp = columnViewportPosition(col); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1332 | colp += offset.x(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1333 | if (!rightToLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1334 | colp += columnWidth(col) - gridSize; never executed: colp += columnWidth(col) - gridSize; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1335 | painter.drawLine(colp, dirtyArea.top(), colp, dirtyArea.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1336 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1337 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1338 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1339 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1340 | if (horizontalHeader->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1341 | painter.drawLine(dirtyArea.left(), 0, dirtyArea.right(), 0); never executed: painter.drawLine(dirtyArea.left(), 0, dirtyArea.right(), 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1342 | if (verticalHeader->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1343 | painter.drawLine(0, dirtyArea.top(), 0, dirtyArea.bottom()); never executed: painter.drawLine(0, dirtyArea.top(), 0, dirtyArea.bottom()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1344 | painter.setPen(old); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1345 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1346 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1347 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1348 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1349 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1350 | d->paintDropIndicator(&painter); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1351 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1352 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1353 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1354 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1355 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1356 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1357 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1358 | QModelIndex QTableView::indexAt(const QPoint &pos) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1359 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1360 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1361 | d->executePostedLayout(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1362 | int r = rowAt(pos.y()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1363 | int c = columnAt(pos.x()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1364 | if (r >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1365 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1366 | QSpanCollection::Span span = d->span(r, c); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1367 | r = span.top(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1368 | c = span.left(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1369 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1370 | return never executed: d->model->index(r, c, d->root);return d->model->index(r, c, d->root);never executed: return d->model->index(r, c, d->root); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1371 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1372 | return never executed: QModelIndex();return QModelIndex();never executed: return QModelIndex(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1373 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1374 | int QTableView::horizontalOffset() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1375 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1376 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1377 | return never executed: d->horizontalHeader->offset();return d->horizontalHeader->offset();never executed: return d->horizontalHeader->offset(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1378 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1379 | int QTableView::verticalOffset() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1380 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1381 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1382 | return never executed: d->verticalHeader->offset();return d->verticalHeader->offset();never executed: return d->verticalHeader->offset(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1383 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1384 | QModelIndex QTableView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1385 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1386 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1387 | (void)modifiers;; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1388 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1389 | int bottom = d->model->rowCount(d->root) - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1390 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1391 | while (bottom >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1392 | -- never executed: bottom;--bottom;never executed: --bottom; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1393 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1394 | int right = d->model->columnCount(d->root) - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1395 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1396 | while (right >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1397 | -- never executed: right;--right;never executed: --right; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1398 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1399 | if (bottom == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1400 | return never executed: QModelIndex();return QModelIndex();never executed: return QModelIndex(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1401 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1402 | QModelIndex current = currentIndex(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1403 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1404 | if (!current.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1405 | int row = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1406 | int column = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1407 | while (column < right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1408 | ++ never executed: column;++column;never executed: ++column; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1409 | while (isRowHidden(d->logicalRow(row))
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1410 | ++ never executed: row;++row;never executed: ++row; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1411 | d->visualCursor = QPoint(column, row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1412 | return never executed: d->model->index(d->logicalRow(row), d->logicalColumn(column), d->root);return 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 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1413 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1414 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1415 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1416 | QPoint visualCurrent(d->visualColumn(current.column()), d->visualRow(current.row())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1417 | if (visualCurrent != d->visualCursor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1418 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1419 | QSpanCollection::Span span = d->span(current.row(), current.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1420 | if (span.top() > d->visualCursor.y()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1421 | || span.left() > d->visualCursor.x()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1422 | d->visualCursor = visualCurrent; never executed: d->visualCursor = visualCurrent; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1423 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1424 | d->visualCursor = visualCurrent; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1425 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1426 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1427 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1428 | int visualRow = d->visualCursor.y(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1429 | if (visualRow > bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1430 | visualRow = bottom; never executed: visualRow = bottom; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1431 | ((!(visualRow != -1)) ? qt_assert("visualRow != -1",__FILE__,1625) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1432 | int visualColumn = d->visualCursor.x(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1433 | if (visualColumn > right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1434 | visualColumn = right; never executed: visualColumn = right; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1435 | ((!(visualColumn != -1)) ? qt_assert("visualColumn != -1",__FILE__,1629) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1436 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1437 | if (isRightToLeft()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1438 | if (cursorAction == MoveLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1439 | cursorAction = MoveRight; never executed: cursorAction = MoveRight; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1440 | else if (cursorAction == MoveRight
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1441 | cursorAction = MoveLeft; never executed: cursorAction = MoveLeft; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1442 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1443 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1444 | switch (cursorAction) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1445 | case never executed: MoveUp:case MoveUp:never executed: {case MoveUp: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1446 | int originalRow = visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1447 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1448 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1449 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1450 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1451 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1452 | int r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1453 | int c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1454 | if (r != -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1455 | QSpanCollection::Span span = d->span(r, c); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1456 | if (span.width() > 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1457 | visualRow = d->visualRow(span.top()); never executed: visualRow = d->visualRow(span.top()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1458 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1459 | while (visualRow >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1460 | --visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1461 | r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1462 | c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1463 | if (r == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1464 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1465 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1466 | if (visualRow < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1467 | visualRow = originalRow; never executed: visualRow = originalRow; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1468 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1469 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1470 | case never executed: MoveDown:case MoveDown:never executed: {case MoveDown: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1471 | int originalRow = visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1472 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1473 | QSpanCollection::Span span = d->span(current.row(), current.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1474 | visualRow = d->visualRow(d->rowSpanEndLogical(span.top(), span.height())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1475 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1476 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1477 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1478 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1479 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1480 | int r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1481 | int c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1482 | if (r != -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1483 | QSpanCollection::Span span = d->span(r, c); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1484 | if (span.width() > 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1485 | visualRow = d->visualRow(d->rowSpanEndLogical(span.top(), span.height())); never executed: visualRow = d->visualRow(d->rowSpanEndLogical(span.top(), span.height())); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1486 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1487 | while (visualRow <= bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1488 | ++visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1489 | r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1490 | c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1491 | if (r == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1492 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1493 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1494 | if (visualRow > bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1495 | visualRow = originalRow; never executed: visualRow = originalRow; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1496 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1497 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1498 | case never executed: MovePrevious:case MovePrevious:never executed: case MovePrevious: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1499 | case never executed: MoveLeft:case MoveLeft:never executed: {case MoveLeft: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1500 | int originalRow = visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1501 | int originalColumn = visualColumn; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1502 | bool firstTime = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1503 | bool looped = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1504 | bool wrapped = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1505 | do { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1506 | int r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1507 | int c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1508 | if (firstTime
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1509 | firstTime = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1510 | QSpanCollection::Span span = d->span(r, c); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1511 | if (span.width() > 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1512 | visualColumn = d->visualColumn(span.left()); never executed: visualColumn = d->visualColumn(span.left()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1513 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1514 | while (visualColumn >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1515 | --visualColumn; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1516 | r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1517 | c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1518 | if (r == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1519 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1520 | if (wrapped
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1521 | looped = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1522 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1523 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1524 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1525 | if (cursorAction == MoveLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1526 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1527 | visualColumn = right + 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1528 | if (visualRow == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1529 | wrapped = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1530 | visualRow = bottom; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1531 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1532 | --visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1533 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1534 | } while (!looped
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1535 | if (visualColumn < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1536 | visualColumn = originalColumn; never executed: visualColumn = originalColumn; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1537 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1538 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1539 | case never executed: MoveNext:case MoveNext:never executed: case MoveNext: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1540 | case never executed: MoveRight:case MoveRight:never executed: {case MoveRight: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1541 | int originalRow = visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1542 | int originalColumn = visualColumn; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1543 | bool firstTime = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1544 | bool looped = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1545 | bool wrapped = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1546 | do { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1547 | int r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1548 | int c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1549 | if (firstTime
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1550 | firstTime = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1551 | QSpanCollection::Span span = d->span(r, c); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1552 | if (span.width() > 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1553 | visualColumn = d->visualColumn(d->columnSpanEndLogical(span.left(), span.width())); never executed: visualColumn = d->visualColumn(d->columnSpanEndLogical(span.left(), span.width())); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1554 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1555 | while (visualColumn <= right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1556 | ++visualColumn; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1557 | r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1558 | c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1559 | if (r == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1560 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1561 | if (wrapped
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1562 | looped = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1563 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1564 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1565 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1566 | if (cursorAction == MoveRight
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1567 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1568 | visualColumn = -1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1569 | if (visualRow == bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1570 | wrapped = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1571 | visualRow = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1572 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1573 | ++visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1574 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1575 | } while (!looped
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1576 | if (visualColumn > right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1577 | visualColumn = originalColumn; never executed: visualColumn = originalColumn; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1578 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1579 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1580 | case never executed: MoveHome:case MoveHome:never executed: case MoveHome: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1581 | visualColumn = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1582 | while (visualColumn < right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1583 | ++ never executed: visualColumn;++visualColumn;never executed: ++visualColumn; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1584 | if (modifiers & Qt::ControlModifier
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1585 | visualRow = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1586 | while (visualRow < bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1587 | ++ never executed: visualRow;++visualRow;never executed: ++visualRow; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1588 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1589 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1590 | case never executed: MoveEnd:case MoveEnd:never executed: case MoveEnd: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1591 | visualColumn = right; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1592 | if (modifiers & Qt::ControlModifier
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1593 | visualRow = bottom; never executed: visualRow = bottom; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1594 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1595 | case never executed: MovePageUp:case MovePageUp:never executed: {case MovePageUp: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1596 | int newRow = rowAt(visualRect(current).bottom() - d->viewport->height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1597 | if (newRow == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1598 | newRow = d->logicalRow(0); never executed: newRow = d->logicalRow(0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1599 | return never executed: d->model->index(newRow, current.column(), d->root);return d->model->index(newRow, current.column(), d->root);never executed: return d->model->index(newRow, current.column(), d->root); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1600 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1601 | case never executed: MovePageDown:case MovePageDown:never executed: {case MovePageDown: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1602 | int newRow = rowAt(visualRect(current).top() + d->viewport->height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1603 | if (newRow == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1604 | newRow = d->logicalRow(bottom); never executed: newRow = d->logicalRow(bottom); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1605 | return never executed: d->model->index(newRow, current.column(), d->root);return d->model->index(newRow, current.column(), d->root);never executed: return d->model->index(newRow, current.column(), d->root); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1606 | }} | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1607 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1608 | d->visualCursor = QPoint(visualColumn, visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1609 | int logicalRow = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1610 | int logicalColumn = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1611 | if (!d->model->hasIndex(logicalRow, logicalColumn, d->root)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1612 | return never executed: QModelIndex();return QModelIndex();never executed: return QModelIndex(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1613 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1614 | QModelIndex result = d->model->index(logicalRow, logicalColumn, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1615 | if (!d->isRowHidden(logicalRow)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1616 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1617 | QSpanCollection::Span span = d->span(result.row(), result.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1618 | if (span.width() > 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1619 | result = d->model->sibling(span.top(), span.left(), result); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1620 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1621 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1622 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1623 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1624 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1625 | return never executed: QModelIndex();return QModelIndex();never executed: return QModelIndex(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1626 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1627 | void QTableView::setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1628 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1629 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1630 | QModelIndex tl = indexAt(QPoint(isRightToLeft() ? qMax(rect.left(), rect.right()) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1631 | : qMin(rect.left(), rect.right()), qMin(rect.top(), rect.bottom()))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1632 | QModelIndex br = indexAt(QPoint(isRightToLeft() ? qMin(rect.left(), rect.right()) : | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1633 | qMax(rect.left(), rect.right()), qMax(rect.top(), rect.bottom()))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1634 | if (!d->selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1635 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1636 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1637 | bool verticalMoved = verticalHeader()->sectionsMoved(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1638 | bool horizontalMoved = horizontalHeader()->sectionsMoved(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1639 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1640 | QItemSelection selection; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1641 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1642 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1643 | bool expanded; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1644 | int top = qMin(d->visualRow(tl.row()), d->visualRow(br.row())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1645 | int left = qMin(d->visualColumn(tl.column()), d->visualColumn(br.column())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1646 | int bottom = qMax(d->visualRow(tl.row()), d->visualRow(br.row())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1647 | int right = qMax(d->visualColumn(tl.column()), d->visualColumn(br.column())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1648 | do { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1649 | expanded = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1650 | 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) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1651 | const QSpanCollection::Span &span = *it; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1652 | int t = d->visualRow(span.top()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1653 | int l = d->visualColumn(span.left()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1654 | int b = d->visualRow(d->rowSpanEndLogical(span.top(), span.height())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1655 | int r = d->visualColumn(d->columnSpanEndLogical(span.left(), span.width())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1656 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1657 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1658 | if (t < top
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1659 | top = t; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1660 | expanded = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1661 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1662 | if (l < left
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1663 | left = l; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1664 | expanded = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1665 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1666 | if (b > bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1667 | bottom = b; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1668 | expanded = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1669 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1670 | if (r > right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1671 | right = r; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1672 | expanded = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1673 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1674 | if (expanded
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1675 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1676 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1677 | } never executed: while (expandedend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1678 | selection.reserve((right - left + 1) * (bottom - top + 1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1679 | for (int horizontal = left; horizontal <= right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1680 | int column = d->logicalColumn(horizontal); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1681 | for (int vertical = top; vertical <= bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1682 | int row = d->logicalRow(vertical); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1683 | QModelIndex index = d->model->index(row, column, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1684 | selection.append(QItemSelectionRange(index)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1685 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1686 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1687 | } never executed: else if (verticalMovedend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1688 | int top = d->visualRow(tl.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1689 | int left = d->visualColumn(tl.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1690 | int bottom = d->visualRow(br.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1691 | int right = d->visualColumn(br.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1692 | selection.reserve((right - left + 1) * (bottom - top + 1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1693 | for (int horizontal = left; horizontal <= right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1694 | int column = d->logicalColumn(horizontal); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1695 | for (int vertical = top; vertical <= bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1696 | int row = d->logicalRow(vertical); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1697 | QModelIndex index = d->model->index(row, column, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1698 | selection.append(QItemSelectionRange(index)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1699 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1700 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1701 | } never executed: else if (horizontalMovedend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1702 | int left = d->visualColumn(tl.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1703 | int right = d->visualColumn(br.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1704 | selection.reserve(right - left + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1705 | for (int visual = left; visual <= right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1706 | int column = d->logicalColumn(visual); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1707 | QModelIndex topLeft = d->model->index(tl.row(), column, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1708 | QModelIndex bottomRight = d->model->index(br.row(), column, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1709 | selection.append(QItemSelectionRange(topLeft, bottomRight)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1710 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1711 | } never executed: else if (verticalMovedend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1712 | int top = d->visualRow(tl.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1713 | int bottom = d->visualRow(br.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1714 | selection.reserve(bottom - top + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1715 | for (int visual = top; visual <= bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1716 | int row = d->logicalRow(visual); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1717 | QModelIndex topLeft = d->model->index(row, tl.column(), d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1718 | QModelIndex bottomRight = d->model->index(row, br.column(), d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1719 | selection.append(QItemSelectionRange(topLeft, bottomRight)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1720 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1721 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1722 | QItemSelectionRange range(tl, br); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1723 | if (!range.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1724 | selection.append(range); never executed: selection.append(range); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1725 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1726 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1727 | d->selectionModel->select(selection, command); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1728 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1729 | QRegion QTableView::visualRegionForSelection(const QItemSelection &selection) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1730 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1731 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1732 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1733 | if (selection.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1734 | return never executed: QRegion();return QRegion();never executed: return QRegion(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1735 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1736 | QRegion selectionRegion; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1737 | const QRect &viewportRect = d->viewport->rect(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1738 | bool verticalMoved = verticalHeader()->sectionsMoved(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1739 | bool horizontalMoved = horizontalHeader()->sectionsMoved(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1740 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1741 | if ((verticalMoved
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1742 | for (int i = 0; i < selection.count()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1743 | QItemSelectionRange range = selection.at(i); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1744 | if (range.parent() != d->root
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1745 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1746 | for (int r = range.top(); r <= range.bottom()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1747 | for (int c = range.left(); c <= range.right()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1748 | const QRect &rangeRect = visualRect(d->model->index(r, c, d->root)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1749 | if (viewportRect.intersects(rangeRect)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1750 | selectionRegion += rangeRect; never executed: selectionRegion += rangeRect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1751 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1752 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1753 | } never executed: else if (horizontalMovedend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1754 | for (int i = 0; i < selection.count()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1755 | QItemSelectionRange range = selection.at(i); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1756 | if (range.parent() != d->root
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1757 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1758 | int top = rowViewportPosition(range.top()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1759 | int bottom = rowViewportPosition(range.bottom()) + rowHeight(range.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1760 | if (top > bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1761 | qSwap<int>(top, bottom); never executed: qSwap<int>(top, bottom); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1762 | int height = bottom - top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1763 | for (int c = range.left(); c <= range.right()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1764 | const QRect rangeRect(columnViewportPosition(c), top, columnWidth(c), height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1765 | if (viewportRect.intersects(rangeRect)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1766 | selectionRegion += rangeRect; never executed: selectionRegion += rangeRect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1767 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1768 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1769 | } never executed: else if (verticalMovedend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1770 | for (int i = 0; i < selection.count()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1771 | QItemSelectionRange range = selection.at(i); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1772 | if (range.parent() != d->root
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1773 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1774 | int left = columnViewportPosition(range.left()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1775 | int right = columnViewportPosition(range.right()) + columnWidth(range.right()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1776 | if (left > right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1777 | qSwap<int>(left, right); never executed: qSwap<int>(left, right); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1778 | int width = right - left; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1779 | for (int r = range.top(); r <= range.bottom()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1780 | const QRect rangeRect(left, rowViewportPosition(r), width, rowHeight(r)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1781 | if (viewportRect.intersects(rangeRect)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1782 | selectionRegion += rangeRect; never executed: selectionRegion += rangeRect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1783 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1784 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1785 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1786 | const int gridAdjust = showGrid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1787 | for (int i = 0; i < selection.count()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1788 | QItemSelectionRange range = selection.at(i); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1789 | if (range.parent() != d->root
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1790 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1791 | d->trimHiddenSelections(&range); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1792 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1793 | const int rtop = rowViewportPosition(range.top()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1794 | const int rbottom = rowViewportPosition(range.bottom()) + rowHeight(range.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1795 | int rleft; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1796 | int rright; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1797 | if (isLeftToRight()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1798 | rleft = columnViewportPosition(range.left()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1799 | rright = columnViewportPosition(range.right()) + columnWidth(range.right()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1800 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1801 | rleft = columnViewportPosition(range.right()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1802 | rright = columnViewportPosition(range.left()) + columnWidth(range.left()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1803 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1804 | const QRect rangeRect(QPoint(rleft, rtop), QPoint(rright - 1 - gridAdjust, rbottom - 1 - gridAdjust)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1805 | if (viewportRect.intersects(rangeRect)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1806 | selectionRegion += rangeRect; never executed: selectionRegion += rangeRect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1807 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1808 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(d->spans.spansInRect(range.left(), range.top(), range.width(), range.height()))>::type> _container_((d->spans.spansInRect(range.left(), range.top(), range.width(), range.height()))); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QSpanCollection::Span *s = *_container_.i; _container_.control; _container_.control = 0) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1809 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1810 | if (range.contains(s->top(), s->left(), range.parent())
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1811 | const QRect &visualSpanRect = d->visualSpanRect(*s); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1812 | if (viewportRect.intersects(visualSpanRect)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1813 | selectionRegion += visualSpanRect; never executed: selectionRegion += visualSpanRect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1814 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1815 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1816 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1817 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1818 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1819 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1820 | return never executed: selectionRegion;return selectionRegion;never executed: return selectionRegion; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1821 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1822 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1823 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1824 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1825 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1826 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1827 | QModelIndexList QTableView::selectedIndexes() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1828 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1829 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1830 | QModelIndexList viewSelected; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1831 | QModelIndexList modelSelected; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1832 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1833 | modelSelected = d->selectionModel->selectedIndexes(); never executed: modelSelected = d->selectionModel->selectedIndexes(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1834 | for (int i = 0; i < modelSelected.count()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1835 | QModelIndex index = modelSelected.at(i); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1836 | if (!isIndexHidden(index)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1837 | viewSelected.append(index); never executed: viewSelected.append(index); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1838 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1839 | return never executed: viewSelected;return viewSelected;never executed: return viewSelected; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1840 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1841 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1842 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1843 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1844 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1845 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1846 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1847 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1848 | void QTableView::rowCountChanged(int oldCount, int newCount ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1849 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1850 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1851 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1852 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1853 | if (newCount < oldCount
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1854 | d->verticalHeader->setUpdatesEnabled(false); never executed: d->verticalHeader->setUpdatesEnabled(false); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1855 | d->doDelayedItemsLayout(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1856 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1857 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1858 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1859 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1860 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1861 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1862 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1863 | void QTableView::columnCountChanged(int, int) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1864 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1865 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1866 | updateGeometries(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1867 | if (horizontalScrollMode() == QAbstractItemView::ScrollPerItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1868 | d->horizontalHeader->setOffsetToSectionPosition(horizontalScrollBar()->value()); never executed: d->horizontalHeader->setOffsetToSectionPosition(horizontalScrollBar()->value()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1869 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1870 | d->horizontalHeader->setOffset(horizontalScrollBar()->value()); never executed: d->horizontalHeader->setOffset(horizontalScrollBar()->value()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1871 | d->viewport->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1872 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1873 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1874 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1875 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1876 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1877 | void QTableView::updateGeometries() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1878 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1879 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1880 | if (d->geometryRecursionBlock
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1881 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1882 | d->geometryRecursionBlock = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1883 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1884 | int width = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1885 | if (!d->verticalHeader->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1886 | width = qMax(d->verticalHeader->minimumWidth(), d->verticalHeader->sizeHint().width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1887 | width = qMin(width, d->verticalHeader->maximumWidth()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1888 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1889 | int height = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1890 | if (!d->horizontalHeader->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1891 | height = qMax(d->horizontalHeader->minimumHeight(), d->horizontalHeader->sizeHint().height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1892 | height = qMin(height, d->horizontalHeader->maximumHeight()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1893 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1894 | bool reverse = isRightToLeft(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1895 | if (reverse
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1896 | setViewportMargins(0, height, width, 0); never executed: setViewportMargins(0, height, width, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1897 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1898 | setViewportMargins(width, height, 0, 0); never executed: setViewportMargins(width, height, 0, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1899 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1900 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1901 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1902 | QRect vg = d->viewport->geometry(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1903 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1904 | int verticalLeft = reverse
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1905 | d->verticalHeader->setGeometry(verticalLeft, vg.top(), width, vg.height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1906 | if (d->verticalHeader->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1907 | QMetaObject::invokeMethod(d->verticalHeader, "updateGeometries"); never executed: QMetaObject::invokeMethod(d->verticalHeader, "updateGeometries"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1908 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1909 | int horizontalTop = vg.top() - height; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1910 | d->horizontalHeader->setGeometry(vg.left(), horizontalTop, vg.width(), height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1911 | if (d->horizontalHeader->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1912 | QMetaObject::invokeMethod(d->horizontalHeader, "updateGeometries"); never executed: QMetaObject::invokeMethod(d->horizontalHeader, "updateGeometries"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1913 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1914 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1915 | if (d->horizontalHeader->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1916 | d->cornerWidget->setHidden(true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1917 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1918 | d->cornerWidget->setHidden(false); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1919 | d->cornerWidget->setGeometry(verticalLeft, horizontalTop, width, height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1920 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1921 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1922 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1923 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1924 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1925 | QSize vsize = d->viewport->size(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1926 | QSize max = maximumViewportSize(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1927 | uint horizontalLength = d->horizontalHeader->length(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1928 | uint verticalLength = d->verticalHeader->length(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1929 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1930 | vsize = max; never executed: vsize = max; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1931 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1932 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1933 | const int columnCount = d->horizontalHeader->count(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1934 | const int viewportWidth = vsize.width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1935 | int columnsInViewport = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1936 | for (int width = 0, column = columnCount - 1; column >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1937 | int logical = d->horizontalHeader->logicalIndex(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1938 | if (!d->horizontalHeader->isSectionHidden(logical)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1939 | width += d->horizontalHeader->sectionSize(logical); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1940 | if (width > viewportWidth
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1941 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1942 | ++columnsInViewport; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1943 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1944 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1945 | columnsInViewport = qMax(columnsInViewport, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1946 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1947 | if (horizontalScrollMode() == QAbstractItemView::ScrollPerItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1948 | const int visibleColumns = columnCount - d->horizontalHeader->hiddenSectionCount(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1949 | horizontalScrollBar()->setRange(0, visibleColumns - columnsInViewport); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1950 | horizontalScrollBar()->setPageStep(columnsInViewport); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1951 | if (columnsInViewport >= visibleColumns
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1952 | d->horizontalHeader->setOffset(0); never executed: d->horizontalHeader->setOffset(0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1953 | horizontalScrollBar()->setSingleStep(1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1954 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1955 | horizontalScrollBar()->setPageStep(vsize.width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1956 | horizontalScrollBar()->setRange(0, horizontalLength - vsize.width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1957 | horizontalScrollBar()->setSingleStep(qMax(vsize.width() / (columnsInViewport + 1), 2)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1958 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1959 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1960 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1961 | const int rowCount = d->verticalHeader->count(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1962 | const int viewportHeight = vsize.height(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1963 | int rowsInViewport = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1964 | for (int height = 0, row = rowCount - 1; row >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1965 | int logical = d->verticalHeader->logicalIndex(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1966 | if (!d->verticalHeader->isSectionHidden(logical)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1967 | height += d->verticalHeader->sectionSize(logical); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1968 | if (height > viewportHeight
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1969 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1970 | ++rowsInViewport; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1971 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1972 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1973 | rowsInViewport = qMax(rowsInViewport, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1974 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1975 | if (verticalScrollMode() == QAbstractItemView::ScrollPerItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1976 | const int visibleRows = rowCount - d->verticalHeader->hiddenSectionCount(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1977 | verticalScrollBar()->setRange(0, visibleRows - rowsInViewport); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1978 | verticalScrollBar()->setPageStep(rowsInViewport); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1979 | if (rowsInViewport >= visibleRows
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1980 | d->verticalHeader->setOffset(0); never executed: d->verticalHeader->setOffset(0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1981 | verticalScrollBar()->setSingleStep(1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1982 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1983 | verticalScrollBar()->setPageStep(vsize.height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1984 | verticalScrollBar()->setRange(0, verticalLength - vsize.height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1985 | verticalScrollBar()->setSingleStep(qMax(vsize.height() / (rowsInViewport + 1), 2)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1986 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1987 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1988 | d->geometryRecursionBlock = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1989 | QAbstractItemView::updateGeometries(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1990 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1991 | int QTableView::sizeHintForRow(int row) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1992 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1993 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1994 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1995 | if (!model()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1996 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1997 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1998 | ensurePolished(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1999 | const int maximumProcessCols = d->verticalHeader->resizeContentsPrecision(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2000 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2001 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2002 | int left = qMax(0, d->horizontalHeader->visualIndexAt(0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2003 | int right = d->horizontalHeader->visualIndexAt(d->viewport->width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2004 | if (right == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2005 | right = d->model->columnCount(d->root) - 1; never executed: right = d->model->columnCount(d->root) - 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2006 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2007 | QStyleOptionViewItem option = d->viewOptionsV1(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2008 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2009 | int hint = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2010 | QModelIndex index; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2011 | int columnsProcessed = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2012 | int column = left; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2013 | for (; column <= right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2014 | int logicalColumn = d->horizontalHeader->logicalIndex(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2015 | if (d->horizontalHeader->isSectionHidden(logicalColumn)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2016 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2017 | index = d->model->index(row, logicalColumn, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2018 | hint = d->heightHintForIndex(index, hint, option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2019 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2020 | ++columnsProcessed; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2021 | if (columnsProcessed == maximumProcessCols
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2022 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2023 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2024 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2025 | int actualRight = d->model->columnCount(d->root) - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2026 | int idxLeft = left; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2027 | int idxRight = column - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2028 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2029 | if (maximumProcessCols == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2030 | columnsProcessed = 0; never executed: columnsProcessed = 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2031 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2032 | while (columnsProcessed != maximumProcessCols
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2033 | int logicalIdx = -1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2034 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2035 | if ((columnsProcessed % 2
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2036 | while (idxLeft > 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2037 | --idxLeft; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2038 | int logcol = d->horizontalHeader->logicalIndex(idxLeft); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2039 | if (d->horizontalHeader->isSectionHidden(logcol)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2040 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2041 | logicalIdx = logcol; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2042 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2043 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2044 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2045 | while (idxRight < actualRight
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2046 | ++idxRight; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2047 | int logcol = d->horizontalHeader->logicalIndex(idxRight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2048 | if (d->horizontalHeader->isSectionHidden(logcol)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2049 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2050 | logicalIdx = logcol; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2051 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2052 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2053 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2054 | if (logicalIdx < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2055 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2056 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2057 | index = d->model->index(row, logicalIdx, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2058 | hint = d->heightHintForIndex(index, hint, option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2059 | ++columnsProcessed; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2060 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2061 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2062 | return never executed: d->showGridreturn d->showGrid ? hint + 1 : hint;
never executed: return d->showGrid ? hint + 1 : hint; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2063 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2064 | int QTableView::sizeHintForColumn(int column) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2065 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2066 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2067 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2068 | if (!model()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2069 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2070 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2071 | ensurePolished(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2072 | const int maximumProcessRows = d->horizontalHeader->resizeContentsPrecision(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2073 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2074 | int top = qMax(0, d->verticalHeader->visualIndexAt(0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2075 | int bottom = d->verticalHeader->visualIndexAt(d->viewport->height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2076 | if (!isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2077 | bottom = d->model->rowCount(d->root) - 1; never executed: bottom = d->model->rowCount(d->root) - 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2078 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2079 | QStyleOptionViewItem option = d->viewOptionsV1(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2080 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2081 | int hint = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2082 | int rowsProcessed = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2083 | QModelIndex index; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2084 | int row = top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2085 | for (; row <= bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2086 | int logicalRow = d->verticalHeader->logicalIndex(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2087 | if (d->verticalHeader->isSectionHidden(logicalRow)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2088 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2089 | index = d->model->index(logicalRow, column, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2090 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2091 | hint = d->widthHintForIndex(index, hint, option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2092 | ++rowsProcessed; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2093 | if (rowsProcessed == maximumProcessRows
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2094 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2095 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2096 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2097 | int actualBottom = d->model->rowCount(d->root) - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2098 | int idxTop = top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2099 | int idxBottom = row - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2100 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2101 | if (maximumProcessRows == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2102 | rowsProcessed = 0; never executed: rowsProcessed = 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2103 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2104 | while (rowsProcessed != maximumProcessRows
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2105 | int logicalIdx = -1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2106 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2107 | if ((rowsProcessed % 2
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2108 | while (idxTop > 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2109 | --idxTop; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2110 | int logrow = d->verticalHeader->logicalIndex(idxTop); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2111 | if (d->verticalHeader->isSectionHidden(logrow)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2112 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2113 | logicalIdx = logrow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2114 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2115 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2116 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2117 | while (idxBottom < actualBottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2118 | ++idxBottom; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2119 | int logrow = d->verticalHeader->logicalIndex(idxBottom); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2120 | if (d->verticalHeader->isSectionHidden(logrow)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2121 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2122 | logicalIdx = logrow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2123 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2124 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2125 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2126 | if (logicalIdx < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2127 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2128 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2129 | index = d->model->index(logicalIdx, column, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2130 | hint = d->widthHintForIndex(index, hint, option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2131 | ++rowsProcessed; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2132 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2133 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2134 | return never executed: d->showGridreturn d->showGrid ? hint + 1 : hint;
never executed: return d->showGrid ? hint + 1 : hint; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2135 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2136 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2137 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2138 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2139 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2140 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2141 | int QTableView::rowViewportPosition(int row) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2142 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2143 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2144 | return never executed: d->verticalHeader->sectionViewportPosition(row);return d->verticalHeader->sectionViewportPosition(row);never executed: return d->verticalHeader->sectionViewportPosition(row); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2145 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2146 | int QTableView::rowAt(int y) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2147 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2148 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2149 | return never executed: d->verticalHeader->logicalIndexAt(y);return d->verticalHeader->logicalIndexAt(y);never executed: return d->verticalHeader->logicalIndexAt(y); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2150 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2151 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2152 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2153 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2154 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2155 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2156 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2157 | void QTableView::setRowHeight(int row, int height) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2158 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2159 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2160 | d->verticalHeader->resizeSection(row, height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2161 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2162 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2163 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2164 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2165 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2166 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2167 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2168 | int QTableView::rowHeight(int row) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2169 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2170 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2171 | return never executed: d->verticalHeader->sectionSize(row);return d->verticalHeader->sectionSize(row);never executed: return d->verticalHeader->sectionSize(row); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2172 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2173 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2174 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2175 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2176 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2177 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2178 | int QTableView::columnViewportPosition(int column) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2179 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2180 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2181 | return never executed: d->horizontalHeader->sectionViewportPosition(column);return d->horizontalHeader->sectionViewportPosition(column);never executed: return d->horizontalHeader->sectionViewportPosition(column); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2182 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2183 | int QTableView::columnAt(int x) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2184 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2185 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2186 | return never executed: d->horizontalHeader->logicalIndexAt(x);return d->horizontalHeader->logicalIndexAt(x);never executed: return d->horizontalHeader->logicalIndexAt(x); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2187 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2188 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2189 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2190 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2191 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2192 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2193 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2194 | void QTableView::setColumnWidth(int column, int width) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2195 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2196 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2197 | d->horizontalHeader->resizeSection(column, width); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2198 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2199 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2200 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2201 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2202 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2203 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2204 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2205 | int QTableView::columnWidth(int column) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2206 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2207 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2208 | return never executed: d->horizontalHeader->sectionSize(column);return d->horizontalHeader->sectionSize(column);never executed: return d->horizontalHeader->sectionSize(column); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2209 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2210 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2211 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2212 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2213 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2214 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2215 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2216 | bool QTableView::isRowHidden(int row) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2217 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2218 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2219 | return never executed: d->verticalHeader->isSectionHidden(row);return d->verticalHeader->isSectionHidden(row);never executed: return d->verticalHeader->isSectionHidden(row); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2220 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2221 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2222 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2223 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2224 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2225 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2226 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2227 | void QTableView::setRowHidden(int row, bool hide) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2228 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2229 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2230 | if (row < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2231 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2232 | d->verticalHeader->setSectionHidden(row, hide); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2233 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2234 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2235 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2236 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2237 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2238 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2239 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2240 | bool QTableView::isColumnHidden(int column) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2241 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2242 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2243 | return never executed: d->horizontalHeader->isSectionHidden(column);return d->horizontalHeader->isSectionHidden(column);never executed: return d->horizontalHeader->isSectionHidden(column); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2244 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2245 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2246 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2247 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2248 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2249 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2250 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2251 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2252 | void QTableView::setColumnHidden(int column, bool hide) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2253 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2254 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2255 | if (column < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2256 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2257 | d->horizontalHeader->setSectionHidden(column, hide); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2258 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2259 | void QTableView::setSortingEnabled(bool enable) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2260 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2261 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2262 | d->sortingEnabled = enable; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2263 | horizontalHeader()->setSortIndicatorShown(enable); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2264 | if (enable
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2265 | disconnect(d->horizontalHeader, qFlagLocation("2""sectionEntered(int)" "\0" __FILE__ ":" "2550"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2266 | this, qFlagLocation("1""_q_selectColumn(int)" "\0" __FILE__ ":" "2551")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2267 | disconnect(horizontalHeader(), qFlagLocation("2""sectionPressed(int)" "\0" __FILE__ ":" "2552"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2268 | this, qFlagLocation("1""selectColumn(int)" "\0" __FILE__ ":" "2553")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2269 | connect(horizontalHeader(), qFlagLocation("2""sortIndicatorChanged(int,Qt::SortOrder)" "\0" __FILE__ ":" "2554"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2270 | this, qFlagLocation("1""sortByColumn(int)" "\0" __FILE__ ":" "2555"), Qt::UniqueConnection); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2271 | sortByColumn(horizontalHeader()->sortIndicatorSection(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2272 | horizontalHeader()->sortIndicatorOrder()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2273 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2274 | connect(d->horizontalHeader, qFlagLocation("2""sectionEntered(int)" "\0" __FILE__ ":" "2559"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2275 | this, qFlagLocation("1""_q_selectColumn(int)" "\0" __FILE__ ":" "2560"), Qt::UniqueConnection); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2276 | connect(horizontalHeader(), qFlagLocation("2""sectionPressed(int)" "\0" __FILE__ ":" "2561"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2277 | this, qFlagLocation("1""selectColumn(int)" "\0" __FILE__ ":" "2562"), Qt::UniqueConnection); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2278 | disconnect(horizontalHeader(), qFlagLocation("2""sortIndicatorChanged(int,Qt::SortOrder)" "\0" __FILE__ ":" "2563"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2279 | this, qFlagLocation("1""sortByColumn(int)" "\0" __FILE__ ":" "2564")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2280 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2281 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2282 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2283 | bool QTableView::isSortingEnabled() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2284 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2285 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2286 | return never executed: d->sortingEnabled;return d->sortingEnabled;never executed: return d->sortingEnabled; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2287 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2288 | bool QTableView::showGrid() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2289 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2290 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2291 | return never executed: d->showGrid;return d->showGrid;never executed: return d->showGrid; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2292 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2293 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2294 | void QTableView::setShowGrid(bool show) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2295 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2296 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2297 | if (d->showGrid != show
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2298 | d->showGrid = show; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2299 | d->viewport->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2300 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2301 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2302 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2303 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2304 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2305 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2306 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2307 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2308 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2309 | Qt::PenStyle QTableView::gridStyle() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2310 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2311 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2312 | return never executed: d->gridStyle;return d->gridStyle;never executed: return d->gridStyle; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2313 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2314 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2315 | void QTableView::setGridStyle(Qt::PenStyle style) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2316 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2317 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2318 | if (d->gridStyle != style
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2319 | d->gridStyle = style; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2320 | d->viewport->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2321 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2322 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2323 | void QTableView::setWordWrap(bool on) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2324 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2325 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2326 | if (d->wrapItemText == on
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2327 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2328 | d->wrapItemText = on; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2329 | QMetaObject::invokeMethod(d->verticalHeader, "resizeSections"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2330 | QMetaObject::invokeMethod(d->horizontalHeader, "resizeSections"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2331 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2332 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2333 | bool QTableView::wordWrap() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2334 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2335 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2336 | return never executed: d->wrapItemText;return d->wrapItemText;never executed: return d->wrapItemText; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2337 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2338 | void QTableView::setCornerButtonEnabled(bool enable) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2339 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2340 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2341 | d->cornerWidget->setEnabled(enable); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2342 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2343 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2344 | bool QTableView::isCornerButtonEnabled() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2345 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2346 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2347 | return never executed: d->cornerWidget->isEnabled();return d->cornerWidget->isEnabled();never executed: return d->cornerWidget->isEnabled(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2348 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2349 | QRect QTableView::visualRect(const QModelIndex &index) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2350 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2351 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2352 | if (!d->isIndexValid(index)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2353 | || (!d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2354 | return never executed: QRect();return QRect();never executed: return QRect(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2355 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2356 | d->executePostedLayout(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2357 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2358 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2359 | QSpanCollection::Span span = d->span(index.row(), index.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2360 | return never executed: d->visualSpanRect(span);return d->visualSpanRect(span);never executed: return d->visualSpanRect(span); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2361 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2362 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2363 | int rowp = rowViewportPosition(index.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2364 | int rowh = rowHeight(index.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2365 | int colp = columnViewportPosition(index.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2366 | int colw = columnWidth(index.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2367 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2368 | const int i = showGrid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2369 | return never executed: QRect(colp, rowp, colw - i, rowh - i);return QRect(colp, rowp, colw - i, rowh - i);never executed: return QRect(colp, rowp, colw - i, rowh - i); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2370 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2371 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2372 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2373 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2374 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2375 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2376 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2377 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2378 | void QTableView::scrollTo(const QModelIndex &index, ScrollHint hint) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2379 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2380 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2381 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2382 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2383 | if (!d->isIndexValid(index)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2384 | || (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2385 | || isRowHidden(index.row())
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2386 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2387 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2388 | QSpanCollection::Span span; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2389 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2390 | span = d->span(index.row(), index.column()); never executed: span = d->span(index.row(), index.column()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2391 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2392 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2393 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2394 | int viewportWidth = d->viewport->width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2395 | int horizontalOffset = d->horizontalHeader->offset(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2396 | int horizontalPosition = d->horizontalHeader->sectionPosition(index.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2397 | int horizontalIndex = d->horizontalHeader->visualIndex(index.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2398 | int cellWidth = d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2399 | ? d->columnSpanWidth(index.column(), span.width()) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2400 | : d->horizontalHeader->sectionSize(index.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2401 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2402 | if (horizontalScrollMode() == QAbstractItemView::ScrollPerItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2403 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2404 | bool positionAtLeft = (horizontalPosition - horizontalOffset < 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2405 | bool positionAtRight = (horizontalPosition - horizontalOffset + cellWidth > viewportWidth); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2406 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2407 | if (hint == PositionAtCenter
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2408 | int w = (hint == PositionAtCenter
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2409 | int x = cellWidth; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2410 | while (horizontalIndex > 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2411 | x += columnWidth(d->horizontalHeader->logicalIndex(horizontalIndex-1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2412 | if (x > w
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2413 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2414 | --horizontalIndex; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2415 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2416 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2417 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2418 | if (positionAtRight
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2419 | int hiddenSections = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2420 | if (d->horizontalHeader->sectionsHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2421 | for (int s = horizontalIndex - 1; s >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2422 | int column = d->horizontalHeader->logicalIndex(s); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2423 | if (d->horizontalHeader->isSectionHidden(column)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2424 | ++ never executed: hiddenSections;++hiddenSections;never executed: ++hiddenSections; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2425 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2426 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2427 | horizontalScrollBar()->setValue(horizontalIndex - hiddenSections); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2428 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2429 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2430 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2431 | if (hint == PositionAtCenter
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2432 | horizontalScrollBar()->setValue(horizontalPosition - ((viewportWidth - cellWidth) / 2)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2433 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2434 | if (horizontalPosition - horizontalOffset < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2435 | horizontalScrollBar()->setValue(horizontalPosition); never executed: horizontalScrollBar()->setValue(horizontalPosition); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2436 | else if (horizontalPosition - horizontalOffset + cellWidth > viewportWidth
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2437 | horizontalScrollBar()->setValue(horizontalPosition - viewportWidth + cellWidth); never executed: horizontalScrollBar()->setValue(horizontalPosition - viewportWidth + cellWidth); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2438 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2439 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2440 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2441 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2442 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2443 | int viewportHeight = d->viewport->height(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2444 | int verticalOffset = d->verticalHeader->offset(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2445 | int verticalPosition = d->verticalHeader->sectionPosition(index.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2446 | int verticalIndex = d->verticalHeader->visualIndex(index.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2447 | int cellHeight = d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2448 | ? d->rowSpanHeight(index.row(), span.height()) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2449 | : d->verticalHeader->sectionSize(index.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2450 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2451 | if (verticalPosition - verticalOffset < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2452 | if (hint == EnsureVisible
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2453 | hint = PositionAtTop; never executed: hint = PositionAtTop; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2454 | } never executed: else if (verticalPosition - verticalOffset + cellHeight > viewportHeightend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2455 | if (hint == EnsureVisible
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2456 | hint = PositionAtBottom; never executed: hint = PositionAtBottom; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2457 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2458 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2459 | if (verticalScrollMode() == QAbstractItemView::ScrollPerItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2460 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2461 | if (hint == PositionAtBottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2462 | int h = (hint == PositionAtCenter
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2463 | int y = cellHeight; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2464 | while (verticalIndex > 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2465 | int row = d->verticalHeader->logicalIndex(verticalIndex - 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2466 | y += d->verticalHeader->sectionSize(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2467 | if (y > h
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2468 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2469 | --verticalIndex; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2470 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2471 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2472 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2473 | if (hint == PositionAtBottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2474 | int hiddenSections = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2475 | if (d->verticalHeader->sectionsHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2476 | for (int s = verticalIndex - 1; s >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2477 | int row = d->verticalHeader->logicalIndex(s); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2478 | if (d->verticalHeader->isSectionHidden(row)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2479 | ++ never executed: hiddenSections;++hiddenSections;never executed: ++hiddenSections; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2480 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2481 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2482 | verticalScrollBar()->setValue(verticalIndex - hiddenSections); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2483 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2484 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2485 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2486 | if (hint == PositionAtTop
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2487 | verticalScrollBar()->setValue(verticalPosition); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2488 | } never executed: else if (hint == PositionAtBottomend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2489 | verticalScrollBar()->setValue(verticalPosition - viewportHeight + cellHeight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2490 | } never executed: else if (hint == PositionAtCenterend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2491 | verticalScrollBar()->setValue(verticalPosition - ((viewportHeight - cellHeight) / 2)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2492 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2493 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2494 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2495 | update(index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2496 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2497 | void QTableView::rowResized(int row, int, int) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2498 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2499 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2500 | d->rowsToUpdate.append(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2501 | if (d->rowResizeTimerID == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2502 | d->rowResizeTimerID = startTimer(0); never executed: d->rowResizeTimerID = startTimer(0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2503 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2504 | void QTableView::columnResized(int column, int, int) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2505 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2506 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2507 | d->columnsToUpdate.append(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2508 | if (d->columnResizeTimerID == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2509 | d->columnResizeTimerID = startTimer(0); never executed: d->columnResizeTimerID = startTimer(0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2510 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2511 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2512 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2513 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2514 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2515 | void QTableView::timerEvent(QTimerEvent *event) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2516 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2517 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2518 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2519 | if (event->timerId() == d->columnResizeTimerID
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2520 | updateGeometries(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2521 | killTimer(d->columnResizeTimerID); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2522 | d->columnResizeTimerID = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2523 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2524 | QRect rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2525 | int viewportHeight = d->viewport->height(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2526 | int viewportWidth = d->viewport->width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2527 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2528 | rect = QRect(0, 0, viewportWidth, viewportHeight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2529 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2530 | for (int i = d->columnsToUpdate.size()-1; i >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2531 | int column = d->columnsToUpdate.at(i); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2532 | int x = columnViewportPosition(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2533 | if (isRightToLeft()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2534 | rect |= QRect(0, 0, x + columnWidth(column), viewportHeight); never executed: rect |= QRect(0, 0, x + columnWidth(column), viewportHeight); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2535 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2536 | rect |= QRect(x, 0, viewportWidth - x, viewportHeight); never executed: rect |= QRect(x, 0, viewportWidth - x, viewportHeight); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2537 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2538 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2539 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2540 | d->viewport->update(rect.normalized()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2541 | d->columnsToUpdate.clear(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2542 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2543 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2544 | if (event->timerId() == d->rowResizeTimerID
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2545 | updateGeometries(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2546 | killTimer(d->rowResizeTimerID); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2547 | d->rowResizeTimerID = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2548 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2549 | int viewportHeight = d->viewport->height(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2550 | int viewportWidth = d->viewport->width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2551 | int top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2552 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2553 | top = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2554 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2555 | top = viewportHeight; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2556 | for (int i = d->rowsToUpdate.size()-1; i >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2557 | int y = rowViewportPosition(d->rowsToUpdate.at(i)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2558 | top = qMin(top, y); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2559 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2560 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2561 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2562 | d->viewport->update(QRect(0, top, viewportWidth, viewportHeight - top)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2563 | d->rowsToUpdate.clear(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2564 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2565 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2566 | QAbstractItemView::timerEvent(event); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2567 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2568 | void QTableView::rowMoved(int, int oldIndex, int newIndex) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2569 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2570 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2571 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2572 | updateGeometries(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2573 | int logicalOldIndex = d->verticalHeader->logicalIndex(oldIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2574 | int logicalNewIndex = d->verticalHeader->logicalIndex(newIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2575 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2576 | d->viewport->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2577 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2578 | int oldTop = rowViewportPosition(logicalOldIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2579 | int newTop = rowViewportPosition(logicalNewIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2580 | int oldBottom = oldTop + rowHeight(logicalOldIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2581 | int newBottom = newTop + rowHeight(logicalNewIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2582 | int top = qMin(oldTop, newTop); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2583 | int bottom = qMax(oldBottom, newBottom); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2584 | int height = bottom - top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2585 | d->viewport->update(0, top, d->viewport->width(), height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2586 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2587 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2588 | void QTableView::columnMoved(int, int oldIndex, int newIndex) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2589 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2590 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2591 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2592 | updateGeometries(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2593 | int logicalOldIndex = d->horizontalHeader->logicalIndex(oldIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2594 | int logicalNewIndex = d->horizontalHeader->logicalIndex(newIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2595 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2596 | d->viewport->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2597 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2598 | int oldLeft = columnViewportPosition(logicalOldIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2599 | int newLeft = columnViewportPosition(logicalNewIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2600 | int oldRight = oldLeft + columnWidth(logicalOldIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2601 | int newRight = newLeft + columnWidth(logicalNewIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2602 | int left = qMin(oldLeft, newLeft); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2603 | int right = qMax(oldRight, newRight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2604 | int width = right - left; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2605 | d->viewport->update(left, 0, width, d->viewport->height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2606 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2607 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2608 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2609 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2610 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2611 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2612 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2613 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2614 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2615 | void QTableView::selectRow(int row) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2616 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2617 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2618 | d->selectRow(row, true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2619 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2620 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2621 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2622 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2623 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2624 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2625 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2626 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2627 | void QTableView::selectColumn(int column) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2628 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2629 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2630 | d->selectColumn(column, true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2631 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2632 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2633 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2634 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2635 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2636 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2637 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2638 | void QTableView::hideRow(int row) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2639 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2640 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2641 | d->verticalHeader->hideSection(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2642 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2643 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2644 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2645 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2646 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2647 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2648 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2649 | void QTableView::hideColumn(int column) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2650 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2651 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2652 | d->horizontalHeader->hideSection(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2653 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2654 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2655 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2656 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2657 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2658 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2659 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2660 | void QTableView::showRow(int row) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2661 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2662 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2663 | d->verticalHeader->showSection(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2664 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2665 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2666 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2667 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2668 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2669 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2670 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2671 | void QTableView::showColumn(int column) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2672 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2673 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2674 | d->horizontalHeader->showSection(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2675 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2676 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2677 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2678 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2679 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2680 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2681 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2682 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2683 | void QTableView::resizeRowToContents(int row) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2684 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2685 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2686 | int content = sizeHintForRow(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2687 | int header = d->verticalHeader->sectionSizeHint(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2688 | d->verticalHeader->resizeSection(row, qMax(content, header)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2689 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2690 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2691 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2692 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2693 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2694 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2695 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2696 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2697 | void QTableView::resizeRowsToContents() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2698 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2699 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2700 | d->verticalHeader->resizeSections(QHeaderView::ResizeToContents); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2701 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2702 | void QTableView::resizeColumnToContents(int column) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2703 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2704 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2705 | int content = sizeHintForColumn(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2706 | int header = d->horizontalHeader->sectionSizeHint(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2707 | d->horizontalHeader->resizeSection(column, qMax(content, header)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2708 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2709 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2710 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2711 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2712 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2713 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2714 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2715 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2716 | void QTableView::resizeColumnsToContents() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2717 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2718 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2719 | d->horizontalHeader->resizeSections(QHeaderView::ResizeToContents); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2720 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2721 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2722 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2723 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2724 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2725 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2726 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2727 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2728 | void QTableView::sortByColumn(int column) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2729 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2730 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2731 | if (column == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2732 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2733 | d->model->sort(column, d->horizontalHeader->sortIndicatorOrder()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2734 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2735 | void QTableView::sortByColumn(int column, Qt::SortOrder order) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2736 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2737 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2738 | d->horizontalHeader->setSortIndicator(column, order); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2739 | sortByColumn(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2740 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2741 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2742 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2743 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2744 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2745 | void QTableView::verticalScrollbarAction(int action) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2746 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2747 | QAbstractItemView::verticalScrollbarAction(action); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2748 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2749 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2750 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2751 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2752 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2753 | void QTableView::horizontalScrollbarAction(int action) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2754 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2755 | QAbstractItemView::horizontalScrollbarAction(action); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2756 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2757 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2758 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2759 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2760 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2761 | bool QTableView::isIndexHidden(const QModelIndex &index) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2762 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2763 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2764 | ((!(d->isIndexValid(index))) ? qt_assert("d->isIndexValid(index)",__FILE__,3142) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2765 | if (isRowHidden(index.row())
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2766 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2767 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2768 | QSpanCollection::Span span = d->span(index.row(), index.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2769 | return never executed: !((return !((span.top() == index.row()) && (span.left() == index.column()));
never executed: return !((span.top() == index.row()) && (span.left() == index.column())); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2770 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2771 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2772 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2773 | void QTableView::setSpan(int row, int column, int rowSpan, int columnSpan) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2774 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2775 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2776 | if (row < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2777 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2778 | d->setSpan(row, column, rowSpan, columnSpan); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2779 | d->viewport->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2780 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2781 | int QTableView::rowSpan(int row, int column) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2782 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2783 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2784 | return never executed: d->rowSpan(row, column);return d->rowSpan(row, column);never executed: return d->rowSpan(row, column); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2785 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2786 | int QTableView::columnSpan(int row, int column) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2787 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2788 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2789 | return never executed: d->columnSpan(row, column);return d->columnSpan(row, column);never executed: return d->columnSpan(row, column); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2790 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2791 | void QTableView::clearSpans() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2792 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2793 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2794 | d->spans.clear(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2795 | d->viewport->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2796 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2797 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2798 | void QTableViewPrivate::_q_selectRow(int row) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2799 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2800 | selectRow(row, false); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2801 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2802 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2803 | void QTableViewPrivate::_q_selectColumn(int column) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2804 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2805 | selectColumn(column, false); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2806 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2807 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2808 | void QTableViewPrivate::selectRow(int row, bool anchor) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2809 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2810 | QTableView * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2811 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2812 | if (q->selectionBehavior() == QTableView::SelectColumns
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2813 | || (q->selectionMode() == QTableView::SingleSelection
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2814 | && q->selectionBehavior() == QTableView::SelectItems
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2815 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2816 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2817 | if (row >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2818 | int column = horizontalHeader->logicalIndexAt(q->isRightToLeft() ? viewport->width() : 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2819 | QModelIndex index = model->index(row, column, root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2820 | QItemSelectionModel::SelectionFlags command = q->selectionCommand(index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2821 | selectionModel->setCurrentIndex(index, QItemSelectionModel::NoUpdate); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2822 | if ((anchor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2823 | || (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2824 | rowSectionAnchor = row; never executed: rowSectionAnchor = row; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2825 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2826 | if (q->selectionMode() != QTableView::SingleSelection
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2827 | && command.testFlag(QItemSelectionModel::Toggle)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2828 | if (anchor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2829 | ctrlDragSelectionFlag = verticalHeader->selectionModel()->selectedRows().contains(index)
never executed: ctrlDragSelectionFlag = verticalHeader->selectionModel()->selectedRows().contains(index) ? QItemSelectionModel::Deselect : QItemSelectionModel::Select; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2830 | ? QItemSelectionModel::Deselect : QItemSelectionModel::Select; never executed: ctrlDragSelectionFlag = verticalHeader->selectionModel()->selectedRows().contains(index) ? QItemSelectionModel::Deselect : QItemSelectionModel::Select; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2831 | command &= ~QItemSelectionModel::Toggle; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2832 | command |= ctrlDragSelectionFlag; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2833 | if (!anchor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2834 | command |= QItemSelectionModel::Current; never executed: command |= QItemSelectionModel::Current; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2835 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2836 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2837 | QModelIndex upper = model->index(qMin(rowSectionAnchor, row), column, root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2838 | QModelIndex lower = model->index(qMax(rowSectionAnchor, row), column, root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2839 | if ((verticalHeader->sectionsMoved()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2840 | q->setSelection(q->visualRect(upper) | q->visualRect(lower), command | QItemSelectionModel::Rows); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2841 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2842 | selectionModel->select(QItemSelection(upper, lower), command | QItemSelectionModel::Rows); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2843 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2844 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2845 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2846 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2847 | void QTableViewPrivate::selectColumn(int column, bool anchor) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2848 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2849 | QTableView * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2850 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2851 | if (q->selectionBehavior() == QTableView::SelectRows
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2852 | || (q->selectionMode() == QTableView::SingleSelection
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2853 | && q->selectionBehavior() == QTableView::SelectItems
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2854 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2855 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2856 | if (column >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2857 | int row = verticalHeader->logicalIndexAt(0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2858 | QModelIndex index = model->index(row, column, root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2859 | QItemSelectionModel::SelectionFlags command = q->selectionCommand(index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2860 | selectionModel->setCurrentIndex(index, QItemSelectionModel::NoUpdate); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2861 | if ((anchor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2862 | || (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2863 | columnSectionAnchor = column; never executed: columnSectionAnchor = column; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2864 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2865 | if (q->selectionMode() != QTableView::SingleSelection
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2866 | && command.testFlag(QItemSelectionModel::Toggle)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2867 | if (anchor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2868 | ctrlDragSelectionFlag = horizontalHeader->selectionModel()->selectedColumns().contains(index)
never executed: ctrlDragSelectionFlag = horizontalHeader->selectionModel()->selectedColumns().contains(index) ? QItemSelectionModel::Deselect : QItemSelectionModel::Select; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2869 | ? QItemSelectionModel::Deselect : QItemSelectionModel::Select; never executed: ctrlDragSelectionFlag = horizontalHeader->selectionModel()->selectedColumns().contains(index) ? QItemSelectionModel::Deselect : QItemSelectionModel::Select; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2870 | command &= ~QItemSelectionModel::Toggle; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2871 | command |= ctrlDragSelectionFlag; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2872 | if (!anchor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2873 | command |= QItemSelectionModel::Current; never executed: command |= QItemSelectionModel::Current; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2874 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2875 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2876 | QModelIndex left = model->index(row, qMin(columnSectionAnchor, column), root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2877 | QModelIndex right = model->index(row, qMax(columnSectionAnchor, column), root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2878 | if ((horizontalHeader->sectionsMoved()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2879 | q->setSelection(q->visualRect(left) | q->visualRect(right), command | QItemSelectionModel::Columns); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2880 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2881 | selectionModel->select(QItemSelection(left, right), command | QItemSelectionModel::Columns); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2882 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2883 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2884 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2885 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2886 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2887 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2888 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2889 | void QTableView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2890 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2891 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2892 | if (QAccessible::isActive()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2893 | if (current.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2894 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2895 | int entry = d->accessibleTable2Index(current); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2896 | QAccessibleEvent event(this, QAccessible::Focus); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2897 | event.setChild(entry); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2898 | QAccessible::updateAccessibility(&event); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2899 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2900 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2901 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2902 | QAbstractItemView::currentChanged(current, previous); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2903 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2904 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2905 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2906 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2907 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2908 | void QTableView::selectionChanged(const QItemSelection &selected, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2909 | const QItemSelection &deselected) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2910 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2911 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2912 | (void)d; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2913 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2914 | if (QAccessible::isActive()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2915 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2916 | QModelIndex sel = selected.indexes().value(0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2917 | if (sel.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2918 | int entry = d->accessibleTable2Index(sel); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2919 | QAccessibleEvent event(this, QAccessible::SelectionAdd); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2920 | event.setChild(entry); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2921 | QAccessible::updateAccessibility(&event); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2922 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2923 | QModelIndex desel = deselected.indexes().value(0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2924 | if (desel.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2925 | int entry = d->accessibleTable2Index(desel); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2926 | QAccessibleEvent event(this, QAccessible::SelectionRemove); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2927 | event.setChild(entry); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2928 | QAccessible::updateAccessibility(&event); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2929 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2930 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2931 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2932 | QAbstractItemView::selectionChanged(selected, deselected); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2933 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2934 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2935 | int QTableView::visualIndex(const QModelIndex &index) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2936 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2937 | return never executed: index.row();return index.row();never executed: return index.row(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2938 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2939 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2940 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2941 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2942 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |