| 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__,108) : 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__,118) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | while (-
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | if (-
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | int removed = (*it_y).remove(-span->left()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | ((!(removed == 1)) ? qt_assert("removed == 1",__FILE__,122) : qt_noop()); (void)removed;; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | if (it_y->isEmpty()
| 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__ ":" "624"), q, qFlagLocation("1""selectAll()" "\0" __FILE__ ":" "624")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 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__,633) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | int top = range->top(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | int left = range->left(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | int bottom = range->bottom(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | int right = range->right(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | while (bottom >= top
| 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 (__builtin_expect(!!(row < 0 || column < 0 || rowSpan <= 0 || columnSpan <= 0), false)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 599 | QMessageLogger(__FILE__, 672, __PRETTY_FUNCTION__).warning("QTableView::setSpan: invalid span given: (%d, %d, %d, %d)", | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 600 | row, column, rowSpan, columnSpan); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 601 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 602 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 603 | QSpanCollection::Span *sp = spans.spanAt(column, row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 604 | if (sp
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 605 | if (sp->top() != row
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 606 | QMessageLogger(__FILE__, 679, __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 (__builtin_expect(!!(rowSpan == 1 && columnSpan == 1), false)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 618 | QMessageLogger(__FILE__, 691, __PRETTY_FUNCTION__).warning("QTableView::setSpan: single cell span won't be added"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 619 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 620 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 621 | sp = new QSpanCollection::Span(row, column, rowSpan, columnSpan); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 622 | spans.addSpan(sp); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 623 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 624 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 625 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 626 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 627 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 628 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 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 | opt.features.setFlag(QStyleOptionViewItem::Alternate, alternateBase); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 755 | drawCell(painter, opt, index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 756 | region -= rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 757 | for (int r = span->top(); r <= span->bottom()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 758 | const int vr = visualRow(r); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 759 | if (vr < firstVisualRow
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 760 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 761 | for (int c = span->left(); c <= span->right()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 762 | const int vc = visualColumn(c); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 763 | if (vc < firstVisualColumn
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 764 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 765 | drawn->setBit((vr - firstVisualRow) * (lastVisualColumn - firstVisualColumn + 1) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 766 | + vc - firstVisualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 767 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 768 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 769 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 770 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 771 | painter->setClipRegion(region); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 772 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 773 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 774 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 775 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 776 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 777 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 778 | void QTableViewPrivate::_q_updateSpanInsertedRows(const QModelIndex &parent, int start, int end) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 779 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 780 | (void)parent; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 781 | spans.updateInsertedRows(start, end); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 782 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 783 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 784 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 785 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 786 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 787 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 788 | void QTableViewPrivate::_q_updateSpanInsertedColumns(const QModelIndex &parent, int start, int end) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 789 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 790 | (void)parent; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 791 | spans.updateInsertedColumns(start, end); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 792 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 793 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 794 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 795 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 796 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 797 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 798 | void QTableViewPrivate::_q_updateSpanRemovedRows(const QModelIndex &parent, int start, int end) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 799 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 800 | (void)parent; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 801 | spans.updateRemovedRows(start, end); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 802 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 803 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 804 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 805 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 806 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 807 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 808 | void QTableViewPrivate::_q_updateSpanRemovedColumns(const QModelIndex &parent, int start, int end) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 809 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 810 | (void)parent; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 811 | spans.updateRemovedColumns(start, end); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 812 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 813 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 814 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 815 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 816 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 817 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 818 | void QTableViewPrivate::drawCell(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 819 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 820 | QTableView * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 821 | QStyleOptionViewItem opt = option; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 822 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 823 | if (selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 824 | opt.state |= QStyle::State_Selected; never executed: opt.state |= QStyle::State_Selected; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 825 | if (index == hover
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 826 | opt.state |= QStyle::State_MouseOver; never executed: opt.state |= QStyle::State_MouseOver; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 827 | if (option.state & QStyle::State_Enabled
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 828 | QPalette::ColorGroup cg; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 829 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 830 | opt.state &= ~QStyle::State_Enabled; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 831 | cg = QPalette::Disabled; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 832 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 833 | cg = QPalette::Normal; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 834 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 835 | opt.palette.setCurrentColorGroup(cg); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 836 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 837 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 838 | if (index == q->currentIndex()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 839 | const bool focus = (q->hasFocus()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 840 | if (focus
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 841 | opt.state |= QStyle::State_HasFocus; never executed: opt.state |= QStyle::State_HasFocus; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 842 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 843 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 844 | q->style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, q); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 845 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 846 | q->itemDelegate(index)->paint(painter, opt, index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 847 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 848 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 849 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 850 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 851 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 852 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 853 | int QTableViewPrivate::widthHintForIndex(const QModelIndex &index, int hint, const QStyleOptionViewItem &option) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 854 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 855 | const QTableView * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 856 | QWidget *editor = editorForIndex(index).widget.data(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 857 | if (editor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 858 | hint = qMax(hint, editor->sizeHint().width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 859 | int min = editor->minimumSize().width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 860 | int max = editor->maximumSize().width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 861 | hint = qBound(min, hint, max); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 862 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 863 | hint = qMax(hint, q->itemDelegate(index)->sizeHint(option, index).width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 864 | return never executed: hint;return hint;never executed: return hint; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 865 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 866 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 867 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 868 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 869 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 870 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 871 | int QTableViewPrivate::heightHintForIndex(const QModelIndex &index, int hint, QStyleOptionViewItem &option) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 872 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 873 | const QTableView * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 874 | QWidget *editor = editorForIndex(index).widget.data(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 875 | if (editor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 876 | hint = qMax(hint, editor->sizeHint().height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 877 | int min = editor->minimumSize().height(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 878 | int max = editor->maximumSize().height(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 879 | hint = qBound(min, hint, max); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 880 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 881 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 882 | if (wrapItemText
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 883 | option.rect.setY(q->rowViewportPosition(index.row())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 884 | int height = q->rowHeight(index.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 885 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 886 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 887 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 888 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 889 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 890 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 891 | if (height == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 892 | height = 1; never executed: height = 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 893 | option.rect.setHeight(height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 894 | option.rect.setX(q->columnViewportPosition(index.column())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 895 | option.rect.setWidth(q->columnWidth(index.column())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 896 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 897 | hint = qMax(hint, q->itemDelegate(index)->sizeHint(option, index).height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 898 | return never executed: hint;return hint;never executed: return hint; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 899 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 900 | QTableView::QTableView(QWidget *parent) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 901 | : QAbstractItemView(*new QTableViewPrivate, parent) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 902 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 903 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 904 | d->init(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 905 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 906 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 907 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 908 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 909 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 910 | QTableView::QTableView(QTableViewPrivate &dd, QWidget *parent) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 911 | : QAbstractItemView(dd, parent) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 912 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 913 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 914 | d->init(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 915 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 916 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 917 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 918 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 919 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 920 | QTableView::~QTableView() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 921 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 922 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 923 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 924 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 925 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 926 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 927 | QSize QTableView::viewportSizeHint() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 928 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 929 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 930 | QSize result( (d->verticalHeader->isHidden() ? 0 : d->verticalHeader->width()) + d->horizontalHeader->length(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 931 | (d->horizontalHeader->isHidden() ? 0 : d->horizontalHeader->height()) + d->verticalHeader->length()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 932 | result += QSize(verticalScrollBar()->isVisible() ? verticalScrollBar()->width() : 0, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 933 | horizontalScrollBar()->isVisible() ? horizontalScrollBar()->height() : 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 934 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 935 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 936 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 937 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 938 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 939 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 940 | void QTableView::setModel(QAbstractItemModel *model) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 941 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 942 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 943 | if (model == d->model
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 944 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 945 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 946 | if (d->model
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 947 | disconnect(d->model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1121"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 948 | this, qFlagLocation("1""_q_updateSpanInsertedRows(QModelIndex,int,int)" "\0" __FILE__ ":" "1122")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 949 | disconnect(d->model, qFlagLocation("2""columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1123"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 950 | this, qFlagLocation("1""_q_updateSpanInsertedColumns(QModelIndex,int,int)" "\0" __FILE__ ":" "1124")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 951 | disconnect(d->model, qFlagLocation("2""rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1125"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 952 | this, qFlagLocation("1""_q_updateSpanRemovedRows(QModelIndex,int,int)" "\0" __FILE__ ":" "1126")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 953 | disconnect(d->model, qFlagLocation("2""columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1127"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 954 | this, qFlagLocation("1""_q_updateSpanRemovedColumns(QModelIndex,int,int)" "\0" __FILE__ ":" "1128")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 955 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 956 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 957 | disconnect(d->selectionModel, qFlagLocation("2""currentRowChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "1131"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 958 | d->model, qFlagLocation("1""submit()" "\0" __FILE__ ":" "1132")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 959 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 960 | if (model
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 961 | connect(model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1135"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 962 | this, qFlagLocation("1""_q_updateSpanInsertedRows(QModelIndex,int,int)" "\0" __FILE__ ":" "1136")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 963 | connect(model, qFlagLocation("2""columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1137"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 964 | this, qFlagLocation("1""_q_updateSpanInsertedColumns(QModelIndex,int,int)" "\0" __FILE__ ":" "1138")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 965 | connect(model, qFlagLocation("2""rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1139"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 966 | this, qFlagLocation("1""_q_updateSpanRemovedRows(QModelIndex,int,int)" "\0" __FILE__ ":" "1140")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 967 | connect(model, qFlagLocation("2""columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1141"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 968 | this, qFlagLocation("1""_q_updateSpanRemovedColumns(QModelIndex,int,int)" "\0" __FILE__ ":" "1142")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 969 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 970 | d->verticalHeader->setModel(model); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 971 | d->horizontalHeader->setModel(model); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 972 | QAbstractItemView::setModel(model); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 973 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 974 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 975 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 976 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 977 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 978 | void QTableView::setRootIndex(const QModelIndex &index) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 979 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 980 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 981 | if (index == d->root
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 982 | viewport()->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 983 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 984 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 985 | d->verticalHeader->setRootIndex(index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 986 | d->horizontalHeader->setRootIndex(index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 987 | QAbstractItemView::setRootIndex(index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 988 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 989 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 990 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 991 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 992 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 993 | void QTableView::doItemsLayout() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 994 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 995 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 996 | QAbstractItemView::doItemsLayout(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 997 | d->verticalHeader->d_func()->setScrollOffset(verticalScrollBar(), verticalScrollMode()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 998 | if (!d->verticalHeader->updatesEnabled()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 999 | d->verticalHeader->setUpdatesEnabled(true); never executed: d->verticalHeader->setUpdatesEnabled(true); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1000 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1001 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1002 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1003 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1004 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1005 | void QTableView::setSelectionModel(QItemSelectionModel *selectionModel) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1006 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1007 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1008 | ((!(selectionModel)) ? qt_assert("selectionModel",__FILE__,1182) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1009 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1010 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1011 | disconnect(d->selectionModel, qFlagLocation("2""currentRowChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "1185"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1012 | d->model, qFlagLocation("1""submit()" "\0" __FILE__ ":" "1186")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1013 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1014 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1015 | d->verticalHeader->setSelectionModel(selectionModel); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1016 | d->horizontalHeader->setSelectionModel(selectionModel); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1017 | QAbstractItemView::setSelectionModel(selectionModel); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1018 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1019 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1020 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1021 | connect(d->selectionModel, qFlagLocation("2""currentRowChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "1195"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1022 | d->model, qFlagLocation("1""submit()" "\0" __FILE__ ":" "1196")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1023 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1024 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1025 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1026 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1027 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1028 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1029 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1030 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1031 | QHeaderView *QTableView::horizontalHeader() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1032 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1033 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1034 | return never executed: d->horizontalHeader;return d->horizontalHeader;never executed: return d->horizontalHeader; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1035 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1036 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1037 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1038 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1039 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1040 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1041 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1042 | QHeaderView *QTableView::verticalHeader() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1043 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1044 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1045 | return never executed: d->verticalHeader;return d->verticalHeader;never executed: return d->verticalHeader; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1046 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1047 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1048 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1049 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1050 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1051 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1052 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1053 | void QTableView::setHorizontalHeader(QHeaderView *header) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1054 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1055 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1056 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1057 | if (!header
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1058 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1059 | if (d->horizontalHeader
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1060 | delete d->horizontalHeader; never executed: delete d->horizontalHeader; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1061 | d->horizontalHeader = header; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1062 | d->horizontalHeader->setParent(this); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1063 | d->horizontalHeader->d_func()->setAllowUserMoveOfSection0(true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1064 | if (!d->horizontalHeader->model()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1065 | d->horizontalHeader->setModel(d->model); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1066 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1067 | d->horizontalHeader->setSelectionModel(d->selectionModel); never executed: d->horizontalHeader->setSelectionModel(d->selectionModel); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1068 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1069 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1070 | connect(d->horizontalHeader,qFlagLocation("2""sectionResized(int,int,int)" "\0" __FILE__ ":" "1244"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1071 | this, qFlagLocation("1""columnResized(int,int,int)" "\0" __FILE__ ":" "1245")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1072 | connect(d->horizontalHeader, qFlagLocation("2""sectionMoved(int,int,int)" "\0" __FILE__ ":" "1246"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1073 | this, qFlagLocation("1""columnMoved(int,int,int)" "\0" __FILE__ ":" "1247")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1074 | connect(d->horizontalHeader, qFlagLocation("2""sectionCountChanged(int,int)" "\0" __FILE__ ":" "1248"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1075 | this, qFlagLocation("1""columnCountChanged(int,int)" "\0" __FILE__ ":" "1249")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1076 | connect(d->horizontalHeader, qFlagLocation("2""sectionPressed(int)" "\0" __FILE__ ":" "1250"), this, qFlagLocation("1""selectColumn(int)" "\0" __FILE__ ":" "1250")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1077 | connect(d->horizontalHeader, qFlagLocation("2""sectionEntered(int)" "\0" __FILE__ ":" "1251"), this, qFlagLocation("1""_q_selectColumn(int)" "\0" __FILE__ ":" "1251")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1078 | connect(d->horizontalHeader, qFlagLocation("2""sectionHandleDoubleClicked(int)" "\0" __FILE__ ":" "1252"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1079 | this, qFlagLocation("1""resizeColumnToContents(int)" "\0" __FILE__ ":" "1253")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1080 | connect(d->horizontalHeader, qFlagLocation("2""geometriesChanged()" "\0" __FILE__ ":" "1254"), this, qFlagLocation("1""updateGeometries()" "\0" __FILE__ ":" "1254")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1081 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1082 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1083 | setSortingEnabled(d->sortingEnabled); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1084 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1085 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1086 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1087 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1088 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1089 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1090 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1091 | void QTableView::setVerticalHeader(QHeaderView *header) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1092 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1093 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1094 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1095 | if (!header
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1096 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1097 | if (d->verticalHeader
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1098 | delete d->verticalHeader; never executed: delete d->verticalHeader; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1099 | d->verticalHeader = header; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1100 | d->verticalHeader->setParent(this); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1101 | d->verticalHeader->d_func()->setAllowUserMoveOfSection0(true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1102 | if (!d->verticalHeader->model()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1103 | d->verticalHeader->setModel(d->model); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1104 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1105 | d->verticalHeader->setSelectionModel(d->selectionModel); never executed: d->verticalHeader->setSelectionModel(d->selectionModel); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1106 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1107 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1108 | connect(d->verticalHeader, qFlagLocation("2""sectionResized(int,int,int)" "\0" __FILE__ ":" "1282"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1109 | this, qFlagLocation("1""rowResized(int,int,int)" "\0" __FILE__ ":" "1283")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1110 | connect(d->verticalHeader, qFlagLocation("2""sectionMoved(int,int,int)" "\0" __FILE__ ":" "1284"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1111 | this, qFlagLocation("1""rowMoved(int,int,int)" "\0" __FILE__ ":" "1285")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1112 | connect(d->verticalHeader, qFlagLocation("2""sectionCountChanged(int,int)" "\0" __FILE__ ":" "1286"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1113 | this, qFlagLocation("1""rowCountChanged(int,int)" "\0" __FILE__ ":" "1287")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1114 | connect(d->verticalHeader, qFlagLocation("2""sectionPressed(int)" "\0" __FILE__ ":" "1288"), this, qFlagLocation("1""selectRow(int)" "\0" __FILE__ ":" "1288")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1115 | connect(d->verticalHeader, qFlagLocation("2""sectionEntered(int)" "\0" __FILE__ ":" "1289"), this, qFlagLocation("1""_q_selectRow(int)" "\0" __FILE__ ":" "1289")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1116 | connect(d->verticalHeader, qFlagLocation("2""sectionHandleDoubleClicked(int)" "\0" __FILE__ ":" "1290"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1117 | this, qFlagLocation("1""resizeRowToContents(int)" "\0" __FILE__ ":" "1291")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1118 | connect(d->verticalHeader, qFlagLocation("2""geometriesChanged()" "\0" __FILE__ ":" "1292"), this, qFlagLocation("1""updateGeometries()" "\0" __FILE__ ":" "1292")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1119 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1120 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1121 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1122 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1123 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1124 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1125 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1126 | void QTableView::scrollContentsBy(int dx, int dy) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1127 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1128 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1129 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1130 | d->delayedAutoScroll.stop(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1131 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1132 | dx = isRightToLeft()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1133 | if (dx
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1134 | int oldOffset = d->horizontalHeader->offset(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1135 | d->horizontalHeader->d_func()->setScrollOffset(horizontalScrollBar(), horizontalScrollMode()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1136 | if (horizontalScrollMode() == QAbstractItemView::ScrollPerItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1137 | int newOffset = d->horizontalHeader->offset(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1138 | dx = isRightToLeft()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1139 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1140 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1141 | if (dy
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1142 | int oldOffset = d->verticalHeader->offset(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1143 | d->verticalHeader->d_func()->setScrollOffset(verticalScrollBar(), verticalScrollMode()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1144 | if (verticalScrollMode() == QAbstractItemView::ScrollPerItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1145 | int newOffset = d->verticalHeader->offset(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1146 | dy = oldOffset - newOffset; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1147 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1148 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1149 | d->scrollContentsBy(dx, dy); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1150 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1151 | if (d->showGrid
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1152 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1153 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1154 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1155 | if (dy > 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1156 | d->viewport->update(0, dy, d->viewport->width(), dy); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1157 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1158 | if (dx > 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1159 | d->viewport->update(dx, 0, dx, d->viewport->height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1160 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1161 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1162 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1163 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1164 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1165 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1166 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1167 | QStyleOptionViewItem QTableView::viewOptions() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1168 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1169 | QStyleOptionViewItem option = QAbstractItemView::viewOptions(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1170 | option.showDecorationSelected = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1171 | return never executed: option;return option;never executed: return option; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1172 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1173 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1174 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1175 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1176 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1177 | void QTableView::paintEvent(QPaintEvent *event) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1178 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1179 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1180 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1181 | QStyleOptionViewItem option = d->viewOptionsV1(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1182 | const QPoint offset = d->scrollDelayOffset; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1183 | const bool showGrid = d->showGrid; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1184 | const int gridSize = showGrid
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1185 | const int gridHint = style()->styleHint(QStyle::SH_Table_GridLineColor, &option, this); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1186 | const QColor gridColor = static_cast<QRgb>(gridHint); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1187 | const QPen gridPen = QPen(gridColor, 0, d->gridStyle); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1188 | const QHeaderView *verticalHeader = d->verticalHeader; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1189 | const QHeaderView *horizontalHeader = d->horizontalHeader; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1190 | const bool alternate = d->alternatingColors; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1191 | const bool rightToLeft = isRightToLeft(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1192 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1193 | QPainter painter(d->viewport); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1194 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1195 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1196 | if (horizontalHeader->count() == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1197 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1198 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1199 | uint x = horizontalHeader->length() - horizontalHeader->offset() - (rightToLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1200 | uint y = verticalHeader->length() - verticalHeader->offset() - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1201 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1202 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1203 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1204 | int firstVisualRow = qMax(verticalHeader->visualIndexAt(0),0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1205 | int lastVisualRow = verticalHeader->visualIndexAt(verticalHeader->viewport()->height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1206 | if (lastVisualRow == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1207 | lastVisualRow = d->model->rowCount(d->root) - 1; never executed: lastVisualRow = d->model->rowCount(d->root) - 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1208 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1209 | int firstVisualColumn = horizontalHeader->visualIndexAt(0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1210 | int lastVisualColumn = horizontalHeader->visualIndexAt(horizontalHeader->viewport()->width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1211 | if (rightToLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1212 | qSwap(firstVisualColumn, lastVisualColumn); never executed: qSwap(firstVisualColumn, lastVisualColumn); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1213 | if (firstVisualColumn == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1214 | firstVisualColumn = 0; never executed: firstVisualColumn = 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1215 | if (lastVisualColumn == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1216 | lastVisualColumn = horizontalHeader->count() - 1; never executed: lastVisualColumn = horizontalHeader->count() - 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1217 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1218 | QBitArray drawn((lastVisualRow - firstVisualRow + 1) * (lastVisualColumn - firstVisualColumn + 1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1219 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1220 | const QRegion region = event->region().translated(offset); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1221 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1222 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1223 | d->drawAndClipSpans(region, &painter, option, &drawn, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1224 | firstVisualRow, lastVisualRow, firstVisualColumn, lastVisualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1225 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1226 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1227 | const QVector<QRect> rects = region.rects(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1228 | for (auto dirtyArea : rects) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1229 | dirtyArea.setBottom(qMin(dirtyArea.bottom(), int(y))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1230 | if (rightToLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1231 | dirtyArea.setLeft(qMax(dirtyArea.left(), d->viewport->width() - int(x))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1232 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1233 | dirtyArea.setRight(qMin(dirtyArea.right(), int(x))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1234 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1235 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1236 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1237 | int left = horizontalHeader->visualIndexAt(dirtyArea.left()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1238 | int right = horizontalHeader->visualIndexAt(dirtyArea.right()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1239 | if (rightToLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1240 | qSwap(left, right); never executed: qSwap(left, right); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1241 | if (left == -1
never executed: left = 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1242 | if (right == -1
never executed: right = horizontalHeader->count() - 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1243 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1244 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1245 | int bottom = verticalHeader->visualIndexAt(dirtyArea.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1246 | if (bottom == -1
never executed: bottom = verticalHeader->count() - 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1247 | int top = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1248 | bool alternateBase = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1249 | if (alternate
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1250 | uint verticalOffset = verticalHeader->offset(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1251 | int row = verticalHeader->logicalIndex(top); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1252 | for (int y = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1253 | ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1254 | ++top) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1255 | row = verticalHeader->logicalIndex(top); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1256 | if (alternate
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1257 | alternateBase = !alternateBase; never executed: alternateBase = !alternateBase; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1258 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1259 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1260 | top = verticalHeader->visualIndexAt(dirtyArea.top()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1261 | alternateBase = (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1262 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1263 | if (top == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1264 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1265 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1266 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1267 | for (int visualRowIndex = top; visualRowIndex <= bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1268 | int row = verticalHeader->logicalIndex(visualRowIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1269 | if (verticalHeader->isSectionHidden(row)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1270 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1271 | int rowY = rowViewportPosition(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1272 | rowY += offset.y(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1273 | int rowh = rowHeight(row) - gridSize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1274 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1275 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1276 | for (int visualColumnIndex = left; visualColumnIndex <= right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1277 | int currentBit = (visualRowIndex - firstVisualRow) * (lastVisualColumn - firstVisualColumn + 1) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1278 | + visualColumnIndex - firstVisualColumn; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1279 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1280 | if (currentBit < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1281 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1282 | drawn.setBit(currentBit); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1283 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1284 | int col = horizontalHeader->logicalIndex(visualColumnIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1285 | if (horizontalHeader->isSectionHidden(col)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1286 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1287 | int colp = columnViewportPosition(col); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1288 | colp += offset.x(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1289 | int colw = columnWidth(col) - gridSize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1290 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1291 | const QModelIndex index = d->model->index(row, col, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1292 | if (index.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1293 | option.rect = QRect(colp + (showGrid && rightToLeft ? 1 : 0), rowY, colw, rowh); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1294 | if (alternate
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1295 | if (alternateBase
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1296 | option.features |= QStyleOptionViewItem::Alternate; never executed: option.features |= QStyleOptionViewItem::Alternate; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1297 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1298 | option.features &= ~QStyleOptionViewItem::Alternate; never executed: option.features &= ~QStyleOptionViewItem::Alternate; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1299 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1300 | d->drawCell(&painter, option, index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1301 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1302 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1303 | alternateBase = !alternateBase
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1304 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1305 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1306 | if (showGrid
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1307 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1308 | while (verticalHeader->isSectionHidden(verticalHeader->logicalIndex(bottom))
never executed: bottom;--bottom;never executed: --bottom; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1309 | QPen old = painter.pen(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1310 | painter.setPen(gridPen); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1311 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1312 | for (int visualIndex = top; visualIndex <= bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1313 | int row = verticalHeader->logicalIndex(visualIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1314 | if (verticalHeader->isSectionHidden(row)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1315 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1316 | int rowY = rowViewportPosition(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1317 | rowY += offset.y(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1318 | int rowh = rowHeight(row) - gridSize; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1319 | painter.drawLine(dirtyArea.left(), rowY + rowh, dirtyArea.right(), rowY + rowh); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1320 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1321 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1322 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1323 | for (int h = left; h <= right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1324 | int col = horizontalHeader->logicalIndex(h); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1325 | if (horizontalHeader->isSectionHidden(col)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1326 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1327 | int colp = columnViewportPosition(col); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1328 | colp += offset.x(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1329 | if (!rightToLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1330 | colp += columnWidth(col) - gridSize; never executed: colp += columnWidth(col) - gridSize; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1331 | painter.drawLine(colp, dirtyArea.top(), colp, dirtyArea.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1332 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1333 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1334 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1335 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1336 | if (horizontalHeader->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1337 | painter.drawLine(dirtyArea.left(), 0, dirtyArea.right(), 0); never executed: painter.drawLine(dirtyArea.left(), 0, dirtyArea.right(), 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1338 | if (verticalHeader->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1339 | painter.drawLine(0, dirtyArea.top(), 0, dirtyArea.bottom()); never executed: painter.drawLine(0, dirtyArea.top(), 0, dirtyArea.bottom()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1340 | painter.setPen(old); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1341 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1342 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1343 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1344 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1345 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1346 | d->paintDropIndicator(&painter); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1347 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1348 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1349 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1350 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1351 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1352 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1353 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1354 | QModelIndex QTableView::indexAt(const QPoint &pos) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1355 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1356 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1357 | d->executePostedLayout(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1358 | int r = rowAt(pos.y()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1359 | int c = columnAt(pos.x()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1360 | if (r >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1361 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1362 | QSpanCollection::Span span = d->span(r, c); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1363 | r = span.top(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1364 | c = span.left(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1365 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1366 | return never executed: 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 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1367 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1368 | return never executed: QModelIndex();return QModelIndex();never executed: return QModelIndex(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1369 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1370 | int QTableView::horizontalOffset() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1371 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1372 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1373 | return never executed: d->horizontalHeader->offset();return d->horizontalHeader->offset();never executed: return d->horizontalHeader->offset(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1374 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1375 | int QTableView::verticalOffset() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1376 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1377 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1378 | return never executed: d->verticalHeader->offset();return d->verticalHeader->offset();never executed: return d->verticalHeader->offset(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1379 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1380 | QModelIndex QTableView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1381 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1382 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1383 | (void)modifiers;; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1384 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1385 | int bottom = d->model->rowCount(d->root) - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1386 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1387 | while (bottom >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1388 | -- never executed: bottom;--bottom;never executed: --bottom; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1389 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1390 | int right = d->model->columnCount(d->root) - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1391 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1392 | while (right >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1393 | -- never executed: right;--right;never executed: --right; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1394 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1395 | if (bottom == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1396 | return never executed: QModelIndex();return QModelIndex();never executed: return QModelIndex(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1397 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1398 | QModelIndex current = currentIndex(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1399 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1400 | if (!current.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1401 | int row = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1402 | int column = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1403 | while (column < right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1404 | ++ never executed: column;++column;never executed: ++column; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1405 | while (isRowHidden(d->logicalRow(row))
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1406 | ++ never executed: row;++row;never executed: ++row; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1407 | d->visualCursor = QPoint(column, row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1408 | 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 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1409 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1410 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1411 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1412 | QPoint visualCurrent(d->visualColumn(current.column()), d->visualRow(current.row())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1413 | if (visualCurrent != d->visualCursor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1414 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1415 | QSpanCollection::Span span = d->span(current.row(), current.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1416 | if (span.top() > d->visualCursor.y()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1417 | || span.left() > d->visualCursor.x()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1418 | d->visualCursor = visualCurrent; never executed: d->visualCursor = visualCurrent; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1419 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1420 | d->visualCursor = visualCurrent; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1421 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1422 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1423 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1424 | int visualRow = d->visualCursor.y(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1425 | if (visualRow > bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1426 | visualRow = bottom; never executed: visualRow = bottom; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1427 | ((!(visualRow != -1)) ? qt_assert("visualRow != -1",__FILE__,1628) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1428 | int visualColumn = d->visualCursor.x(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1429 | if (visualColumn > right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1430 | visualColumn = right; never executed: visualColumn = right; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1431 | ((!(visualColumn != -1)) ? qt_assert("visualColumn != -1",__FILE__,1632) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1432 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1433 | if (isRightToLeft()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1434 | if (cursorAction == MoveLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1435 | cursorAction = MoveRight; never executed: cursorAction = MoveRight; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1436 | else if (cursorAction == MoveRight
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1437 | cursorAction = MoveLeft; never executed: cursorAction = MoveLeft; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1438 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1439 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1440 | switch (cursorAction) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1441 | case never executed: MoveUp:case MoveUp:never executed: {case MoveUp: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1442 | int originalRow = visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1443 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1444 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1445 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1446 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1447 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1448 | int r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1449 | int c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1450 | if (r != -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1451 | QSpanCollection::Span span = d->span(r, c); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1452 | if (span.width() > 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1453 | visualRow = d->visualRow(span.top()); never executed: visualRow = d->visualRow(span.top()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1454 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1455 | while (visualRow >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1456 | --visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1457 | r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1458 | c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1459 | if (r == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1460 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1461 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1462 | if (visualRow < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1463 | visualRow = originalRow; never executed: visualRow = originalRow; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1464 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1465 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1466 | case never executed: MoveDown:case MoveDown:never executed: {case MoveDown: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1467 | int originalRow = visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1468 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1469 | QSpanCollection::Span span = d->span(current.row(), current.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1470 | visualRow = d->visualRow(d->rowSpanEndLogical(span.top(), span.height())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1471 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1472 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1473 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1474 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1475 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1476 | int r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1477 | int c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1478 | if (r != -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1479 | QSpanCollection::Span span = d->span(r, c); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1480 | if (span.width() > 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1481 | visualRow = d->visualRow(d->rowSpanEndLogical(span.top(), span.height())); never executed: visualRow = d->visualRow(d->rowSpanEndLogical(span.top(), span.height())); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1482 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1483 | while (visualRow <= bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1484 | ++visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1485 | r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1486 | c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1487 | if (r == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1488 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1489 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1490 | if (visualRow > bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1491 | visualRow = originalRow; never executed: visualRow = originalRow; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1492 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1493 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1494 | case never executed: MovePrevious:case MovePrevious:never executed: case MovePrevious: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1495 | case never executed: MoveLeft:case MoveLeft:never executed: {case MoveLeft: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1496 | int originalRow = visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1497 | int originalColumn = visualColumn; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1498 | bool firstTime = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1499 | bool looped = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1500 | bool wrapped = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1501 | do { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1502 | int r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1503 | int c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1504 | if (firstTime
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1505 | firstTime = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1506 | QSpanCollection::Span span = d->span(r, c); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1507 | if (span.width() > 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1508 | visualColumn = d->visualColumn(span.left()); never executed: visualColumn = d->visualColumn(span.left()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1509 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1510 | while (visualColumn >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1511 | --visualColumn; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1512 | r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1513 | c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1514 | if (r == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1515 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1516 | if (wrapped
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1517 | looped = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1518 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1519 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1520 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1521 | if (cursorAction == MoveLeft
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1522 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1523 | visualColumn = right + 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1524 | if (visualRow == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1525 | wrapped = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1526 | visualRow = bottom; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1527 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1528 | --visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1529 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1530 | } while (!looped
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1531 | if (visualColumn < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1532 | visualColumn = originalColumn; never executed: visualColumn = originalColumn; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1533 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1534 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1535 | case never executed: MoveNext:case MoveNext:never executed: case MoveNext: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1536 | case never executed: MoveRight:case MoveRight:never executed: {case MoveRight: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1537 | int originalRow = visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1538 | int originalColumn = visualColumn; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1539 | bool firstTime = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1540 | bool looped = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1541 | bool wrapped = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1542 | do { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1543 | int r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1544 | int c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1545 | if (firstTime
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1546 | firstTime = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1547 | QSpanCollection::Span span = d->span(r, c); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1548 | if (span.width() > 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1549 | visualColumn = d->visualColumn(d->columnSpanEndLogical(span.left(), span.width())); never executed: visualColumn = d->visualColumn(d->columnSpanEndLogical(span.left(), span.width())); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1550 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1551 | while (visualColumn <= right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1552 | ++visualColumn; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1553 | r = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1554 | c = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1555 | if (r == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1556 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1557 | if (wrapped
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1558 | looped = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1559 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1560 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1561 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1562 | if (cursorAction == MoveRight
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1563 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1564 | visualColumn = -1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1565 | if (visualRow == bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1566 | wrapped = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1567 | visualRow = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1568 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1569 | ++visualRow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1570 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1571 | } while (!looped
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1572 | if (visualColumn > right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1573 | visualColumn = originalColumn; never executed: visualColumn = originalColumn; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1574 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1575 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1576 | case never executed: MoveHome:case MoveHome:never executed: case MoveHome: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1577 | visualColumn = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1578 | while (visualColumn < right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1579 | ++ never executed: visualColumn;++visualColumn;never executed: ++visualColumn; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1580 | if (modifiers & Qt::ControlModifier
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1581 | visualRow = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1582 | while (visualRow < bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1583 | ++ never executed: visualRow;++visualRow;never executed: ++visualRow; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1584 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1585 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1586 | case never executed: MoveEnd:case MoveEnd:never executed: case MoveEnd: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1587 | visualColumn = right; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1588 | if (modifiers & Qt::ControlModifier
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1589 | visualRow = bottom; never executed: visualRow = bottom; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1590 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1591 | case never executed: MovePageUp:case MovePageUp:never executed: {case MovePageUp: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1592 | int newRow = rowAt(visualRect(current).bottom() - d->viewport->height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1593 | if (newRow == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1594 | newRow = d->logicalRow(0); never executed: newRow = d->logicalRow(0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1595 | 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 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1596 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1597 | case never executed: MovePageDown:case MovePageDown:never executed: {case MovePageDown: | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1598 | int newRow = rowAt(visualRect(current).top() + d->viewport->height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1599 | if (newRow == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1600 | newRow = d->logicalRow(bottom); never executed: newRow = d->logicalRow(bottom); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1601 | 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 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1602 | }} | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1603 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1604 | d->visualCursor = QPoint(visualColumn, visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1605 | int logicalRow = d->logicalRow(visualRow); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1606 | int logicalColumn = d->logicalColumn(visualColumn); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1607 | if (!d->model->hasIndex(logicalRow, logicalColumn, d->root)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1608 | return never executed: QModelIndex();return QModelIndex();never executed: return QModelIndex(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1609 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1610 | QModelIndex result = d->model->index(logicalRow, logicalColumn, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1611 | if (!d->isRowHidden(logicalRow)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1612 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1613 | QSpanCollection::Span span = d->span(result.row(), result.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1614 | if (span.width() > 1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1615 | result = d->model->sibling(span.top(), span.left(), result); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1616 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1617 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1618 | return never executed: result;return result;never executed: return result; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1619 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1620 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1621 | return never executed: QModelIndex();return QModelIndex();never executed: return QModelIndex(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1622 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1623 | void QTableView::setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1624 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1625 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1626 | QModelIndex tl = indexAt(QPoint(isRightToLeft() ? qMax(rect.left(), rect.right()) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1627 | : qMin(rect.left(), rect.right()), qMin(rect.top(), rect.bottom()))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1628 | QModelIndex br = indexAt(QPoint(isRightToLeft() ? qMin(rect.left(), rect.right()) : | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1629 | qMax(rect.left(), rect.right()), qMax(rect.top(), rect.bottom()))); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1630 | if (!d->selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1631 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1632 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1633 | bool verticalMoved = verticalHeader()->sectionsMoved(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1634 | bool horizontalMoved = horizontalHeader()->sectionsMoved(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1635 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1636 | QItemSelection selection; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1637 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1638 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1639 | bool expanded; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1640 | int top = qMin(d->visualRow(tl.row()), d->visualRow(br.row())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1641 | int left = qMin(d->visualColumn(tl.column()), d->visualColumn(br.column())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1642 | int bottom = qMax(d->visualRow(tl.row()), d->visualRow(br.row())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1643 | int right = qMax(d->visualColumn(tl.column()), d->visualColumn(br.column())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1644 | do { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1645 | expanded = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1646 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(d->spans.spans)>::type> _container_((d->spans.spans)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QSpanCollection::Span *it = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1647 | const QSpanCollection::Span &span = *it; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1648 | int t = d->visualRow(span.top()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1649 | int l = d->visualColumn(span.left()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1650 | int b = d->visualRow(d->rowSpanEndLogical(span.top(), span.height())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1651 | int r = d->visualColumn(d->columnSpanEndLogical(span.left(), span.width())); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1652 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1653 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1654 | if (t < top
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1655 | top = t; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1656 | expanded = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1657 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1658 | if (l < left
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1659 | left = l; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1660 | expanded = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1661 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1662 | if (b > bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1663 | bottom = b; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1664 | expanded = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1665 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1666 | if (r > right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1667 | right = r; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1668 | expanded = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1669 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1670 | if (expanded
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1671 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1672 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1673 | } never executed: while (expandedend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1674 | selection.reserve((right - left + 1) * (bottom - top + 1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1675 | for (int horizontal = left; horizontal <= right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1676 | int column = d->logicalColumn(horizontal); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1677 | for (int vertical = top; vertical <= bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1678 | int row = d->logicalRow(vertical); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1679 | QModelIndex index = d->model->index(row, column, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1680 | selection.append(QItemSelectionRange(index)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1681 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1682 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1683 | } never executed: else if (verticalMovedend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1684 | int top = d->visualRow(tl.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1685 | int left = d->visualColumn(tl.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1686 | int bottom = d->visualRow(br.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1687 | int right = d->visualColumn(br.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1688 | selection.reserve((right - left + 1) * (bottom - top + 1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1689 | for (int horizontal = left; horizontal <= right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1690 | int column = d->logicalColumn(horizontal); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1691 | for (int vertical = top; vertical <= bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1692 | int row = d->logicalRow(vertical); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1693 | QModelIndex index = d->model->index(row, column, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1694 | selection.append(QItemSelectionRange(index)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1695 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1696 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1697 | } never executed: else if (horizontalMovedend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1698 | int left = d->visualColumn(tl.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1699 | int right = d->visualColumn(br.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1700 | selection.reserve(right - left + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1701 | for (int visual = left; visual <= right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1702 | int column = d->logicalColumn(visual); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1703 | QModelIndex topLeft = d->model->index(tl.row(), column, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1704 | QModelIndex bottomRight = d->model->index(br.row(), column, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1705 | selection.append(QItemSelectionRange(topLeft, bottomRight)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1706 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1707 | } never executed: else if (verticalMovedend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1708 | int top = d->visualRow(tl.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1709 | int bottom = d->visualRow(br.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1710 | selection.reserve(bottom - top + 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1711 | for (int visual = top; visual <= bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1712 | int row = d->logicalRow(visual); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1713 | QModelIndex topLeft = d->model->index(row, tl.column(), d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1714 | QModelIndex bottomRight = d->model->index(row, br.column(), d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1715 | selection.append(QItemSelectionRange(topLeft, bottomRight)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1716 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1717 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1718 | QItemSelectionRange range(tl, br); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1719 | if (!range.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1720 | selection.append(range); never executed: selection.append(range); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1721 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1722 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1723 | d->selectionModel->select(selection, command); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1724 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1725 | QRegion QTableView::visualRegionForSelection(const QItemSelection &selection) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1726 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1727 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1728 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1729 | if (selection.isEmpty()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1730 | return never executed: QRegion();return QRegion();never executed: return QRegion(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1731 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1732 | QRegion selectionRegion; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1733 | const QRect &viewportRect = d->viewport->rect(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1734 | bool verticalMoved = verticalHeader()->sectionsMoved(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1735 | bool horizontalMoved = horizontalHeader()->sectionsMoved(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1736 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1737 | if ((verticalMoved
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1738 | for (const auto &range : selection) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1739 | if (range.parent() != d->root
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1740 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1741 | for (int r = range.top(); r <= range.bottom()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1742 | for (int c = range.left(); c <= range.right()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1743 | const QRect &rangeRect = visualRect(d->model->index(r, c, d->root)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1744 | if (viewportRect.intersects(rangeRect)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1745 | selectionRegion += rangeRect; never executed: selectionRegion += rangeRect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1746 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1747 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1748 | } never executed: else if (horizontalMovedend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1749 | for (const auto &range : selection) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1750 | if (range.parent() != d->root
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1751 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1752 | int top = rowViewportPosition(range.top()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1753 | int bottom = rowViewportPosition(range.bottom()) + rowHeight(range.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1754 | if (top > bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1755 | qSwap<int>(top, bottom); never executed: qSwap<int>(top, bottom); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1756 | int height = bottom - top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1757 | for (int c = range.left(); c <= range.right()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1758 | const QRect rangeRect(columnViewportPosition(c), top, columnWidth(c), height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1759 | if (viewportRect.intersects(rangeRect)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1760 | selectionRegion += rangeRect; never executed: selectionRegion += rangeRect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1761 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1762 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1763 | } never executed: else if (verticalMovedend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1764 | for (const auto &range : selection) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1765 | if (range.parent() != d->root
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1766 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1767 | int left = columnViewportPosition(range.left()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1768 | int right = columnViewportPosition(range.right()) + columnWidth(range.right()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1769 | if (left > right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1770 | qSwap<int>(left, right); never executed: qSwap<int>(left, right); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1771 | int width = right - left; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1772 | for (int r = range.top(); r <= range.bottom()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1773 | const QRect rangeRect(left, rowViewportPosition(r), width, rowHeight(r)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1774 | if (viewportRect.intersects(rangeRect)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1775 | selectionRegion += rangeRect; never executed: selectionRegion += rangeRect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1776 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1777 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1778 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1779 | const int gridAdjust = showGrid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1780 | for (auto range : selection) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1781 | if (range.parent() != d->root
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1782 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1783 | d->trimHiddenSelections(&range); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1784 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1785 | const int rtop = rowViewportPosition(range.top()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1786 | const int rbottom = rowViewportPosition(range.bottom()) + rowHeight(range.bottom()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1787 | int rleft; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1788 | int rright; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1789 | if (isLeftToRight()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1790 | rleft = columnViewportPosition(range.left()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1791 | rright = columnViewportPosition(range.right()) + columnWidth(range.right()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1792 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1793 | rleft = columnViewportPosition(range.right()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1794 | rright = columnViewportPosition(range.left()) + columnWidth(range.left()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1795 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1796 | const QRect rangeRect(QPoint(rleft, rtop), QPoint(rright - 1 - gridAdjust, rbottom - 1 - gridAdjust)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1797 | if (viewportRect.intersects(rangeRect)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1798 | selectionRegion += rangeRect; never executed: selectionRegion += rangeRect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1799 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1800 | const auto spansInRect = d->spans.spansInRect(range.left(), range.top(), range.width(), range.height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1801 | for (QSpanCollection::Span *s : spansInRect) { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1802 | if (range.contains(s->top(), s->left(), range.parent())
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1803 | const QRect &visualSpanRect = d->visualSpanRect(*s); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1804 | if (viewportRect.intersects(visualSpanRect)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1805 | selectionRegion += visualSpanRect; never executed: selectionRegion += visualSpanRect; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1806 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1807 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1808 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1809 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1810 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1811 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1812 | return never executed: selectionRegion;return selectionRegion;never executed: return selectionRegion; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1813 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1814 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1815 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1816 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1817 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1818 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1819 | QModelIndexList QTableView::selectedIndexes() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1820 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1821 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1822 | QModelIndexList viewSelected; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1823 | QModelIndexList modelSelected; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1824 | if (d->selectionModel
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1825 | modelSelected = d->selectionModel->selectedIndexes(); never executed: modelSelected = d->selectionModel->selectedIndexes(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1826 | for (int i = 0; i < modelSelected.count()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1827 | QModelIndex index = modelSelected.at(i); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1828 | if (!isIndexHidden(index)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1829 | viewSelected.append(index); never executed: viewSelected.append(index); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1830 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1831 | return never executed: viewSelected;return viewSelected;never executed: return viewSelected; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1832 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1833 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1834 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1835 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1836 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1837 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1838 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1839 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1840 | void QTableView::rowCountChanged(int oldCount, int newCount ) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1841 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1842 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1843 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1844 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1845 | if (newCount < oldCount
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1846 | d->verticalHeader->setUpdatesEnabled(false); never executed: d->verticalHeader->setUpdatesEnabled(false); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1847 | d->doDelayedItemsLayout(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1848 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1849 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1850 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1851 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1852 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1853 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1854 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1855 | void QTableView::columnCountChanged(int, int) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1856 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1857 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1858 | updateGeometries(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1859 | if (horizontalScrollMode() == QAbstractItemView::ScrollPerItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1860 | d->horizontalHeader->setOffsetToSectionPosition(horizontalScrollBar()->value()); never executed: d->horizontalHeader->setOffsetToSectionPosition(horizontalScrollBar()->value()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1861 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1862 | d->horizontalHeader->setOffset(horizontalScrollBar()->value()); never executed: d->horizontalHeader->setOffset(horizontalScrollBar()->value()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1863 | d->viewport->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1864 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1865 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1866 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1867 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1868 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1869 | void QTableView::updateGeometries() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1870 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1871 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1872 | if (d->geometryRecursionBlock
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1873 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1874 | d->geometryRecursionBlock = true; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1875 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1876 | int width = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1877 | if (!d->verticalHeader->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1878 | width = qMax(d->verticalHeader->minimumWidth(), d->verticalHeader->sizeHint().width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1879 | width = qMin(width, d->verticalHeader->maximumWidth()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1880 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1881 | int height = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1882 | if (!d->horizontalHeader->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1883 | height = qMax(d->horizontalHeader->minimumHeight(), d->horizontalHeader->sizeHint().height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1884 | height = qMin(height, d->horizontalHeader->maximumHeight()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1885 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1886 | bool reverse = isRightToLeft(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1887 | if (reverse
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1888 | setViewportMargins(0, height, width, 0); never executed: setViewportMargins(0, height, width, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1889 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1890 | setViewportMargins(width, height, 0, 0); never executed: setViewportMargins(width, height, 0, 0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1891 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1892 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1893 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1894 | QRect vg = d->viewport->geometry(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1895 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1896 | int verticalLeft = reverse
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1897 | d->verticalHeader->setGeometry(verticalLeft, vg.top(), width, vg.height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1898 | if (d->verticalHeader->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1899 | QMetaObject::invokeMethod(d->verticalHeader, "updateGeometries"); never executed: QMetaObject::invokeMethod(d->verticalHeader, "updateGeometries"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1900 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1901 | int horizontalTop = vg.top() - height; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1902 | d->horizontalHeader->setGeometry(vg.left(), horizontalTop, vg.width(), height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1903 | if (d->horizontalHeader->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1904 | QMetaObject::invokeMethod(d->horizontalHeader, "updateGeometries"); never executed: QMetaObject::invokeMethod(d->horizontalHeader, "updateGeometries"); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1905 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1906 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1907 | if (d->horizontalHeader->isHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1908 | d->cornerWidget->setHidden(true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1909 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1910 | d->cornerWidget->setHidden(false); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1911 | d->cornerWidget->setGeometry(verticalLeft, horizontalTop, width, height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1912 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1913 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1914 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1915 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1916 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1917 | QSize vsize = d->viewport->size(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1918 | QSize max = maximumViewportSize(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1919 | uint horizontalLength = d->horizontalHeader->length(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1920 | uint verticalLength = d->verticalHeader->length(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1921 | if ((
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1922 | vsize = max; never executed: vsize = max; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1923 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1924 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1925 | const int columnCount = d->horizontalHeader->count(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1926 | const int viewportWidth = vsize.width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1927 | int columnsInViewport = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1928 | for (int width = 0, column = columnCount - 1; column >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1929 | int logical = d->horizontalHeader->logicalIndex(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1930 | if (!d->horizontalHeader->isSectionHidden(logical)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1931 | width += d->horizontalHeader->sectionSize(logical); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1932 | if (width > viewportWidth
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1933 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1934 | ++columnsInViewport; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1935 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1936 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1937 | columnsInViewport = qMax(columnsInViewport, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1938 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1939 | if (horizontalScrollMode() == QAbstractItemView::ScrollPerItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1940 | const int visibleColumns = columnCount - d->horizontalHeader->hiddenSectionCount(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1941 | horizontalScrollBar()->setRange(0, visibleColumns - columnsInViewport); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1942 | horizontalScrollBar()->setPageStep(columnsInViewport); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1943 | if (columnsInViewport >= visibleColumns
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1944 | d->horizontalHeader->setOffset(0); never executed: d->horizontalHeader->setOffset(0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1945 | horizontalScrollBar()->setSingleStep(1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1946 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1947 | horizontalScrollBar()->setPageStep(vsize.width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1948 | horizontalScrollBar()->setRange(0, horizontalLength - vsize.width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1949 | horizontalScrollBar()->d_func()->itemviewChangeSingleStep(qMax(vsize.width() / (columnsInViewport + 1), 2)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1950 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1951 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1952 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1953 | const int rowCount = d->verticalHeader->count(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1954 | const int viewportHeight = vsize.height(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1955 | int rowsInViewport = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1956 | for (int height = 0, row = rowCount - 1; row >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1957 | int logical = d->verticalHeader->logicalIndex(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1958 | if (!d->verticalHeader->isSectionHidden(logical)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1959 | height += d->verticalHeader->sectionSize(logical); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1960 | if (height > viewportHeight
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1961 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1962 | ++rowsInViewport; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1963 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1964 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1965 | rowsInViewport = qMax(rowsInViewport, 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1966 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1967 | if (verticalScrollMode() == QAbstractItemView::ScrollPerItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1968 | const int visibleRows = rowCount - d->verticalHeader->hiddenSectionCount(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1969 | verticalScrollBar()->setRange(0, visibleRows - rowsInViewport); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1970 | verticalScrollBar()->setPageStep(rowsInViewport); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1971 | if (rowsInViewport >= visibleRows
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1972 | d->verticalHeader->setOffset(0); never executed: d->verticalHeader->setOffset(0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1973 | verticalScrollBar()->setSingleStep(1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1974 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1975 | verticalScrollBar()->setPageStep(vsize.height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1976 | verticalScrollBar()->setRange(0, verticalLength - vsize.height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1977 | verticalScrollBar()->d_func()->itemviewChangeSingleStep(qMax(vsize.height() / (rowsInViewport + 1), 2)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1978 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1979 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1980 | d->geometryRecursionBlock = false; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1981 | QAbstractItemView::updateGeometries(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1982 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1983 | int QTableView::sizeHintForRow(int row) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1984 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1985 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1986 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1987 | if (!model()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1988 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1989 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1990 | ensurePolished(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1991 | const int maximumProcessCols = d->verticalHeader->resizeContentsPrecision(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1992 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1993 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1994 | int left = qMax(0, d->horizontalHeader->visualIndexAt(0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1995 | int right = d->horizontalHeader->visualIndexAt(d->viewport->width()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1996 | if (right == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1997 | right = d->model->columnCount(d->root) - 1; never executed: right = d->model->columnCount(d->root) - 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1998 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 1999 | QStyleOptionViewItem option = d->viewOptionsV1(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2000 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2001 | int hint = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2002 | QModelIndex index; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2003 | int columnsProcessed = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2004 | int column = left; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2005 | for (; column <= right
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2006 | int logicalColumn = d->horizontalHeader->logicalIndex(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2007 | if (d->horizontalHeader->isSectionHidden(logicalColumn)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2008 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2009 | index = d->model->index(row, logicalColumn, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2010 | hint = d->heightHintForIndex(index, hint, option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2011 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2012 | ++columnsProcessed; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2013 | if (columnsProcessed == maximumProcessCols
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2014 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2015 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2016 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2017 | int actualRight = d->model->columnCount(d->root) - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2018 | int idxLeft = left; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2019 | int idxRight = column - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2020 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2021 | if (maximumProcessCols == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2022 | columnsProcessed = 0; never executed: columnsProcessed = 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2023 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2024 | while (columnsProcessed != maximumProcessCols
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2025 | int logicalIdx = -1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2026 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2027 | if ((columnsProcessed % 2
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2028 | while (idxLeft > 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2029 | --idxLeft; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2030 | int logcol = d->horizontalHeader->logicalIndex(idxLeft); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2031 | if (d->horizontalHeader->isSectionHidden(logcol)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2032 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2033 | logicalIdx = logcol; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2034 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2035 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2036 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2037 | while (idxRight < actualRight
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2038 | ++idxRight; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2039 | int logcol = d->horizontalHeader->logicalIndex(idxRight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2040 | if (d->horizontalHeader->isSectionHidden(logcol)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2041 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2042 | logicalIdx = logcol; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2043 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2044 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2045 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2046 | if (logicalIdx < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2047 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2048 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2049 | index = d->model->index(row, logicalIdx, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2050 | hint = d->heightHintForIndex(index, hint, option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2051 | ++columnsProcessed; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2052 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2053 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2054 | return never executed: d->showGrid ? hint + 1 : hint;return d->showGrid ? hint + 1 : hint;never executed: return d->showGrid ? hint + 1 : hint; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2055 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2056 | int QTableView::sizeHintForColumn(int column) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2057 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2058 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2059 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2060 | if (!model()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2061 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2062 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2063 | ensurePolished(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2064 | const int maximumProcessRows = d->horizontalHeader->resizeContentsPrecision(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2065 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2066 | int top = qMax(0, d->verticalHeader->visualIndexAt(0)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2067 | int bottom = d->verticalHeader->visualIndexAt(d->viewport->height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2068 | if (!isVisible()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2069 | bottom = d->model->rowCount(d->root) - 1; never executed: bottom = d->model->rowCount(d->root) - 1; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2070 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2071 | QStyleOptionViewItem option = d->viewOptionsV1(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2072 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2073 | int hint = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2074 | int rowsProcessed = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2075 | QModelIndex index; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2076 | int row = top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2077 | for (; row <= bottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2078 | int logicalRow = d->verticalHeader->logicalIndex(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2079 | if (d->verticalHeader->isSectionHidden(logicalRow)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2080 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2081 | index = d->model->index(logicalRow, column, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2082 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2083 | hint = d->widthHintForIndex(index, hint, option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2084 | ++rowsProcessed; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2085 | if (rowsProcessed == maximumProcessRows
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2086 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2087 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2088 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2089 | int actualBottom = d->model->rowCount(d->root) - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2090 | int idxTop = top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2091 | int idxBottom = row - 1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2092 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2093 | if (maximumProcessRows == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2094 | rowsProcessed = 0; never executed: rowsProcessed = 0; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2095 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2096 | while (rowsProcessed != maximumProcessRows
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2097 | int logicalIdx = -1; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2098 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2099 | if ((rowsProcessed % 2
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2100 | while (idxTop > 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2101 | --idxTop; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2102 | int logrow = d->verticalHeader->logicalIndex(idxTop); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2103 | if (d->verticalHeader->isSectionHidden(logrow)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2104 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2105 | logicalIdx = logrow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2106 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2107 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2108 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2109 | while (idxBottom < actualBottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2110 | ++idxBottom; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2111 | int logrow = d->verticalHeader->logicalIndex(idxBottom); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2112 | if (d->verticalHeader->isSectionHidden(logrow)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2113 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2114 | logicalIdx = logrow; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2115 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2116 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2117 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2118 | if (logicalIdx < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2119 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2120 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2121 | index = d->model->index(logicalIdx, column, d->root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2122 | hint = d->widthHintForIndex(index, hint, option); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2123 | ++rowsProcessed; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2124 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2125 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2126 | return never executed: d->showGrid ? hint + 1 : hint;return d->showGrid ? hint + 1 : hint;never executed: return d->showGrid ? hint + 1 : hint; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2127 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2128 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2129 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2130 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2131 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2132 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2133 | int QTableView::rowViewportPosition(int row) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2134 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2135 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2136 | return never executed: d->verticalHeader->sectionViewportPosition(row);return d->verticalHeader->sectionViewportPosition(row);never executed: return d->verticalHeader->sectionViewportPosition(row); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2137 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2138 | int QTableView::rowAt(int y) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2139 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2140 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2141 | return never executed: d->verticalHeader->logicalIndexAt(y);return d->verticalHeader->logicalIndexAt(y);never executed: return d->verticalHeader->logicalIndexAt(y); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2142 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2143 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2144 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2145 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2146 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2147 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2148 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2149 | void QTableView::setRowHeight(int row, int height) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2150 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2151 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2152 | d->verticalHeader->resizeSection(row, height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2153 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2154 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2155 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2156 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2157 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2158 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2159 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2160 | int QTableView::rowHeight(int row) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2161 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2162 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2163 | return never executed: d->verticalHeader->sectionSize(row);return d->verticalHeader->sectionSize(row);never executed: return d->verticalHeader->sectionSize(row); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2164 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2165 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2166 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2167 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2168 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2169 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2170 | int QTableView::columnViewportPosition(int column) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2171 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2172 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2173 | return never executed: d->horizontalHeader->sectionViewportPosition(column);return d->horizontalHeader->sectionViewportPosition(column);never executed: return d->horizontalHeader->sectionViewportPosition(column); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2174 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2175 | int QTableView::columnAt(int x) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2176 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2177 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2178 | return never executed: d->horizontalHeader->logicalIndexAt(x);return d->horizontalHeader->logicalIndexAt(x);never executed: return d->horizontalHeader->logicalIndexAt(x); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2179 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2180 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2181 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2182 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2183 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2184 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2185 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2186 | void QTableView::setColumnWidth(int column, int width) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2187 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2188 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2189 | d->horizontalHeader->resizeSection(column, width); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2190 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2191 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2192 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2193 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2194 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2195 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2196 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2197 | int QTableView::columnWidth(int column) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2198 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2199 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2200 | return never executed: d->horizontalHeader->sectionSize(column);return d->horizontalHeader->sectionSize(column);never executed: return d->horizontalHeader->sectionSize(column); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2201 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2202 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2203 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2204 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2205 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2206 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2207 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2208 | bool QTableView::isRowHidden(int row) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2209 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2210 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2211 | return never executed: d->verticalHeader->isSectionHidden(row);return d->verticalHeader->isSectionHidden(row);never executed: return d->verticalHeader->isSectionHidden(row); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2212 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2213 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2214 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2215 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2216 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2217 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2218 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2219 | void QTableView::setRowHidden(int row, bool hide) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2220 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2221 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2222 | if (row < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2223 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2224 | d->verticalHeader->setSectionHidden(row, hide); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2225 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2226 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2227 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2228 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2229 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2230 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2231 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2232 | bool QTableView::isColumnHidden(int column) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2233 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2234 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2235 | return never executed: d->horizontalHeader->isSectionHidden(column);return d->horizontalHeader->isSectionHidden(column);never executed: return d->horizontalHeader->isSectionHidden(column); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2236 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2237 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2238 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2239 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2240 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2241 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2242 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2243 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2244 | void QTableView::setColumnHidden(int column, bool hide) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2245 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2246 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2247 | if (column < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2248 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2249 | d->horizontalHeader->setSectionHidden(column, hide); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2250 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2251 | void QTableView::setSortingEnabled(bool enable) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2252 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2253 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2254 | d->sortingEnabled = enable; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2255 | horizontalHeader()->setSortIndicatorShown(enable); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2256 | if (enable
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2257 | disconnect(d->horizontalHeader, qFlagLocation("2""sectionEntered(int)" "\0" __FILE__ ":" "2549"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2258 | this, qFlagLocation("1""_q_selectColumn(int)" "\0" __FILE__ ":" "2550")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2259 | disconnect(horizontalHeader(), qFlagLocation("2""sectionPressed(int)" "\0" __FILE__ ":" "2551"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2260 | this, qFlagLocation("1""selectColumn(int)" "\0" __FILE__ ":" "2552")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2261 | connect(horizontalHeader(), qFlagLocation("2""sortIndicatorChanged(int,Qt::SortOrder)" "\0" __FILE__ ":" "2553"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2262 | this, qFlagLocation("1""sortByColumn(int)" "\0" __FILE__ ":" "2554"), Qt::UniqueConnection); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2263 | sortByColumn(horizontalHeader()->sortIndicatorSection(), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2264 | horizontalHeader()->sortIndicatorOrder()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2265 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2266 | connect(d->horizontalHeader, qFlagLocation("2""sectionEntered(int)" "\0" __FILE__ ":" "2558"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2267 | this, qFlagLocation("1""_q_selectColumn(int)" "\0" __FILE__ ":" "2559"), Qt::UniqueConnection); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2268 | connect(horizontalHeader(), qFlagLocation("2""sectionPressed(int)" "\0" __FILE__ ":" "2560"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2269 | this, qFlagLocation("1""selectColumn(int)" "\0" __FILE__ ":" "2561"), Qt::UniqueConnection); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2270 | disconnect(horizontalHeader(), qFlagLocation("2""sortIndicatorChanged(int,Qt::SortOrder)" "\0" __FILE__ ":" "2562"), | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2271 | this, qFlagLocation("1""sortByColumn(int)" "\0" __FILE__ ":" "2563")); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2272 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2273 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2274 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2275 | bool QTableView::isSortingEnabled() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2276 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2277 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2278 | return never executed: d->sortingEnabled;return d->sortingEnabled;never executed: return d->sortingEnabled; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2279 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2280 | bool QTableView::showGrid() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2281 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2282 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2283 | return never executed: d->showGrid;return d->showGrid;never executed: return d->showGrid; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2284 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2285 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2286 | void QTableView::setShowGrid(bool show) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2287 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2288 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2289 | if (d->showGrid != show
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2290 | d->showGrid = show; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2291 | d->viewport->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2292 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2293 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2294 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2295 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2296 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2297 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2298 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2299 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2300 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2301 | Qt::PenStyle QTableView::gridStyle() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2302 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2303 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2304 | return never executed: d->gridStyle;return d->gridStyle;never executed: return d->gridStyle; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2305 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2306 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2307 | void QTableView::setGridStyle(Qt::PenStyle style) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2308 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2309 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2310 | if (d->gridStyle != style
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2311 | d->gridStyle = style; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2312 | d->viewport->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2313 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2314 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2315 | void QTableView::setWordWrap(bool on) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2316 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2317 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2318 | if (d->wrapItemText == on
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2319 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2320 | d->wrapItemText = on; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2321 | QMetaObject::invokeMethod(d->verticalHeader, "resizeSections"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2322 | QMetaObject::invokeMethod(d->horizontalHeader, "resizeSections"); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2323 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2324 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2325 | bool QTableView::wordWrap() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2326 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2327 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2328 | return never executed: d->wrapItemText;return d->wrapItemText;never executed: return d->wrapItemText; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2329 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2330 | void QTableView::setCornerButtonEnabled(bool enable) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2331 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2332 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2333 | d->cornerWidget->setEnabled(enable); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2334 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2335 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2336 | bool QTableView::isCornerButtonEnabled() const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2337 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2338 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2339 | return never executed: d->cornerWidget->isEnabled();return d->cornerWidget->isEnabled();never executed: return d->cornerWidget->isEnabled(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2340 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2341 | QRect QTableView::visualRect(const QModelIndex &index) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2342 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2343 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2344 | if (!d->isIndexValid(index)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2345 | || (!d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2346 | return never executed: QRect();return QRect();never executed: return QRect(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2347 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2348 | d->executePostedLayout(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2349 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2350 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2351 | QSpanCollection::Span span = d->span(index.row(), index.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2352 | return never executed: d->visualSpanRect(span);return d->visualSpanRect(span);never executed: return d->visualSpanRect(span); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2353 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2354 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2355 | int rowp = rowViewportPosition(index.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2356 | int rowh = rowHeight(index.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2357 | int colp = columnViewportPosition(index.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2358 | int colw = columnWidth(index.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2359 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2360 | const int i = showGrid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2361 | 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 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2362 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2363 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2364 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2365 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2366 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2367 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2368 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2369 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2370 | void QTableView::scrollTo(const QModelIndex &index, ScrollHint hint) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2371 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2372 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2373 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2374 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2375 | if (!d->isIndexValid(index)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2376 | || (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2377 | || isRowHidden(index.row())
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2378 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2379 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2380 | QSpanCollection::Span span; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2381 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2382 | span = d->span(index.row(), index.column()); never executed: span = d->span(index.row(), index.column()); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2383 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2384 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2385 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2386 | int viewportWidth = d->viewport->width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2387 | int horizontalOffset = d->horizontalHeader->offset(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2388 | int horizontalPosition = d->horizontalHeader->sectionPosition(index.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2389 | int horizontalIndex = d->horizontalHeader->visualIndex(index.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2390 | int cellWidth = d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2391 | ? d->columnSpanWidth(index.column(), span.width()) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2392 | : d->horizontalHeader->sectionSize(index.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2393 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2394 | if (horizontalScrollMode() == QAbstractItemView::ScrollPerItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2395 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2396 | bool positionAtLeft = (horizontalPosition - horizontalOffset < 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2397 | bool positionAtRight = (horizontalPosition - horizontalOffset + cellWidth > viewportWidth); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2398 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2399 | if (hint == PositionAtCenter
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2400 | int w = (hint == PositionAtCenter
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2401 | int x = cellWidth; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2402 | while (horizontalIndex > 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2403 | x += columnWidth(d->horizontalHeader->logicalIndex(horizontalIndex-1)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2404 | if (x > w
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2405 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2406 | --horizontalIndex; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2407 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2408 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2409 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2410 | if (positionAtRight
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2411 | int hiddenSections = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2412 | if (d->horizontalHeader->sectionsHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2413 | for (int s = horizontalIndex - 1; s >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2414 | int column = d->horizontalHeader->logicalIndex(s); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2415 | if (d->horizontalHeader->isSectionHidden(column)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2416 | ++ never executed: hiddenSections;++hiddenSections;never executed: ++hiddenSections; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2417 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2418 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2419 | horizontalScrollBar()->setValue(horizontalIndex - hiddenSections); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2420 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2421 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2422 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2423 | if (hint == PositionAtCenter
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2424 | horizontalScrollBar()->setValue(horizontalPosition - ((viewportWidth - cellWidth) / 2)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2425 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2426 | if (horizontalPosition - horizontalOffset < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2427 | horizontalScrollBar()->setValue(horizontalPosition); never executed: horizontalScrollBar()->setValue(horizontalPosition); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2428 | else if (horizontalPosition - horizontalOffset + cellWidth > viewportWidth
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2429 | horizontalScrollBar()->setValue(horizontalPosition - viewportWidth + cellWidth); never executed: horizontalScrollBar()->setValue(horizontalPosition - viewportWidth + cellWidth); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2430 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2431 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2432 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2433 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2434 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2435 | int viewportHeight = d->viewport->height(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2436 | int verticalOffset = d->verticalHeader->offset(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2437 | int verticalPosition = d->verticalHeader->sectionPosition(index.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2438 | int verticalIndex = d->verticalHeader->visualIndex(index.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2439 | int cellHeight = d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2440 | ? d->rowSpanHeight(index.row(), span.height()) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2441 | : d->verticalHeader->sectionSize(index.row()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2442 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2443 | if (verticalPosition - verticalOffset < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2444 | if (hint == EnsureVisible
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2445 | hint = PositionAtTop; never executed: hint = PositionAtTop; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2446 | } never executed: else if (verticalPosition - verticalOffset + cellHeight > viewportHeightend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2447 | if (hint == EnsureVisible
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2448 | hint = PositionAtBottom; never executed: hint = PositionAtBottom; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2449 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2450 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2451 | if (verticalScrollMode() == QAbstractItemView::ScrollPerItem
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2452 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2453 | if (hint == PositionAtBottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2454 | int h = (hint == PositionAtCenter
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2455 | int y = cellHeight; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2456 | while (verticalIndex > 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2457 | int row = d->verticalHeader->logicalIndex(verticalIndex - 1); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2458 | y += d->verticalHeader->sectionSize(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2459 | if (y > h
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2460 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2461 | --verticalIndex; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2462 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2463 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2464 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2465 | if (hint == PositionAtBottom
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2466 | int hiddenSections = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2467 | if (d->verticalHeader->sectionsHidden()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2468 | for (int s = verticalIndex - 1; s >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2469 | int row = d->verticalHeader->logicalIndex(s); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2470 | if (d->verticalHeader->isSectionHidden(row)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2471 | ++ never executed: hiddenSections;++hiddenSections;never executed: ++hiddenSections; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2472 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2473 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2474 | verticalScrollBar()->setValue(verticalIndex - hiddenSections); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2475 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2476 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2477 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2478 | if (hint == PositionAtTop
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2479 | verticalScrollBar()->setValue(verticalPosition); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2480 | } never executed: else if (hint == PositionAtBottomend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2481 | verticalScrollBar()->setValue(verticalPosition - viewportHeight + cellHeight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2482 | } never executed: else if (hint == PositionAtCenterend of block
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2483 | verticalScrollBar()->setValue(verticalPosition - ((viewportHeight - cellHeight) / 2)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2484 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2485 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2486 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2487 | update(index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2488 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2489 | void QTableView::rowResized(int row, int, int) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2490 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2491 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2492 | d->rowsToUpdate.append(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2493 | if (d->rowResizeTimerID == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2494 | d->rowResizeTimerID = startTimer(0); never executed: d->rowResizeTimerID = startTimer(0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2495 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2496 | void QTableView::columnResized(int column, int, int) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2497 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2498 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2499 | d->columnsToUpdate.append(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2500 | if (d->columnResizeTimerID == 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2501 | d->columnResizeTimerID = startTimer(0); never executed: d->columnResizeTimerID = startTimer(0); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2502 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2503 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2504 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2505 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2506 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2507 | void QTableView::timerEvent(QTimerEvent *event) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2508 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2509 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2510 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2511 | if (event->timerId() == d->columnResizeTimerID
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2512 | updateGeometries(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2513 | killTimer(d->columnResizeTimerID); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2514 | d->columnResizeTimerID = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2515 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2516 | QRect rect; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2517 | int viewportHeight = d->viewport->height(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2518 | int viewportWidth = d->viewport->width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2519 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2520 | rect = QRect(0, 0, viewportWidth, viewportHeight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2521 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2522 | for (int i = d->columnsToUpdate.size()-1; i >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2523 | int column = d->columnsToUpdate.at(i); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2524 | int x = columnViewportPosition(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2525 | if (isRightToLeft()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2526 | rect |= QRect(0, 0, x + columnWidth(column), viewportHeight); never executed: rect |= QRect(0, 0, x + columnWidth(column), viewportHeight); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2527 | else | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2528 | rect |= QRect(x, 0, viewportWidth - x, viewportHeight); never executed: rect |= QRect(x, 0, viewportWidth - x, viewportHeight); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2529 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2530 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2531 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2532 | d->viewport->update(rect.normalized()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2533 | d->columnsToUpdate.clear(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2534 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2535 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2536 | if (event->timerId() == d->rowResizeTimerID
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2537 | updateGeometries(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2538 | killTimer(d->rowResizeTimerID); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2539 | d->rowResizeTimerID = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2540 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2541 | int viewportHeight = d->viewport->height(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2542 | int viewportWidth = d->viewport->width(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2543 | int top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2544 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2545 | top = 0; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2546 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2547 | top = viewportHeight; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2548 | for (int i = d->rowsToUpdate.size()-1; i >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2549 | int y = rowViewportPosition(d->rowsToUpdate.at(i)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2550 | top = qMin(top, y); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2551 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2552 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2553 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2554 | d->viewport->update(QRect(0, top, viewportWidth, viewportHeight - top)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2555 | d->rowsToUpdate.clear(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2556 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2557 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2558 | QAbstractItemView::timerEvent(event); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2559 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2560 | void QTableView::rowMoved(int, int oldIndex, int newIndex) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2561 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2562 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2563 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2564 | updateGeometries(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2565 | int logicalOldIndex = d->verticalHeader->logicalIndex(oldIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2566 | int logicalNewIndex = d->verticalHeader->logicalIndex(newIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2567 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2568 | d->viewport->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2569 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2570 | int oldTop = rowViewportPosition(logicalOldIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2571 | int newTop = rowViewportPosition(logicalNewIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2572 | int oldBottom = oldTop + rowHeight(logicalOldIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2573 | int newBottom = newTop + rowHeight(logicalNewIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2574 | int top = qMin(oldTop, newTop); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2575 | int bottom = qMax(oldBottom, newBottom); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2576 | int height = bottom - top; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2577 | d->viewport->update(0, top, d->viewport->width(), height); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2578 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2579 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2580 | void QTableView::columnMoved(int, int oldIndex, int newIndex) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2581 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2582 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2583 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2584 | updateGeometries(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2585 | int logicalOldIndex = d->horizontalHeader->logicalIndex(oldIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2586 | int logicalNewIndex = d->horizontalHeader->logicalIndex(newIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2587 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2588 | d->viewport->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2589 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2590 | int oldLeft = columnViewportPosition(logicalOldIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2591 | int newLeft = columnViewportPosition(logicalNewIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2592 | int oldRight = oldLeft + columnWidth(logicalOldIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2593 | int newRight = newLeft + columnWidth(logicalNewIndex); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2594 | int left = qMin(oldLeft, newLeft); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2595 | int right = qMax(oldRight, newRight); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2596 | int width = right - left; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2597 | d->viewport->update(left, 0, width, d->viewport->height()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2598 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2599 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2600 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2601 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2602 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2603 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2604 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2605 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2606 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2607 | void QTableView::selectRow(int row) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2608 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2609 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2610 | d->selectRow(row, true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2611 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2612 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2613 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2614 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2615 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2616 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2617 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2618 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2619 | void QTableView::selectColumn(int column) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2620 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2621 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2622 | d->selectColumn(column, true); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2623 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2624 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2625 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2626 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2627 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2628 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2629 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2630 | void QTableView::hideRow(int row) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2631 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2632 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2633 | d->verticalHeader->hideSection(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2634 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2635 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2636 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2637 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2638 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2639 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2640 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2641 | void QTableView::hideColumn(int column) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2642 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2643 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2644 | d->horizontalHeader->hideSection(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2645 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2646 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2647 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2648 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2649 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2650 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2651 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2652 | void QTableView::showRow(int row) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2653 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2654 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2655 | d->verticalHeader->showSection(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2656 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2657 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2658 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2659 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2660 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2661 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2662 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2663 | void QTableView::showColumn(int column) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2664 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2665 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2666 | d->horizontalHeader->showSection(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2667 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2668 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2669 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2670 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2671 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2672 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2673 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2674 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2675 | void QTableView::resizeRowToContents(int row) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2676 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2677 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2678 | int content = sizeHintForRow(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2679 | int header = d->verticalHeader->sectionSizeHint(row); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2680 | d->verticalHeader->resizeSection(row, qMax(content, header)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2681 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2682 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2683 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2684 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2685 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2686 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2687 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2688 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2689 | void QTableView::resizeRowsToContents() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2690 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2691 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2692 | d->verticalHeader->resizeSections(QHeaderView::ResizeToContents); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2693 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2694 | void QTableView::resizeColumnToContents(int column) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2695 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2696 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2697 | int content = sizeHintForColumn(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2698 | int header = d->horizontalHeader->sectionSizeHint(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2699 | d->horizontalHeader->resizeSection(column, qMax(content, header)); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2700 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2701 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2702 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2703 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2704 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2705 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2706 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2707 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2708 | void QTableView::resizeColumnsToContents() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2709 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2710 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2711 | d->horizontalHeader->resizeSections(QHeaderView::ResizeToContents); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2712 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2713 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2714 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2715 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2716 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2717 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2718 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2719 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2720 | void QTableView::sortByColumn(int column) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2721 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2722 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2723 | if (column == -1
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2724 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2725 | d->model->sort(column, d->horizontalHeader->sortIndicatorOrder()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2726 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2727 | void QTableView::sortByColumn(int column, Qt::SortOrder order) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2728 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2729 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2730 | d->horizontalHeader->setSortIndicator(column, order); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2731 | sortByColumn(column); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2732 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2733 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2734 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2735 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2736 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2737 | void QTableView::verticalScrollbarAction(int action) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2738 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2739 | QAbstractItemView::verticalScrollbarAction(action); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2740 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2741 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2742 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2743 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2744 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2745 | void QTableView::horizontalScrollbarAction(int action) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2746 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2747 | QAbstractItemView::horizontalScrollbarAction(action); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2748 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2749 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2750 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2751 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2752 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2753 | bool QTableView::isIndexHidden(const QModelIndex &index) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2754 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2755 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2756 | ((!(d->isIndexValid(index))) ? qt_assert("d->isIndexValid(index)",__FILE__,3141) : qt_noop()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2757 | if (isRowHidden(index.row())
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2758 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2759 | if (d->hasSpans()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2760 | QSpanCollection::Span span = d->span(index.row(), index.column()); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2761 | return never executed: !((span.top() == index.row()) && (span.left() == index.column()));return !((span.top() == index.row()) && (span.left() == index.column()));never executed: return !((span.top() == index.row()) && (span.left() == index.column())); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2762 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2763 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2764 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2765 | void QTableView::setSpan(int row, int column, int rowSpan, int columnSpan) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2766 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2767 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2768 | if (row < 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2769 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2770 | d->setSpan(row, column, rowSpan, columnSpan); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2771 | d->viewport->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2772 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2773 | int QTableView::rowSpan(int row, int column) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2774 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2775 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2776 | return never executed: d->rowSpan(row, column);return d->rowSpan(row, column);never executed: return d->rowSpan(row, column); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2777 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2778 | int QTableView::columnSpan(int row, int column) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2779 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2780 | const QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2781 | return never executed: d->columnSpan(row, column);return d->columnSpan(row, column);never executed: return d->columnSpan(row, column); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2782 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2783 | void QTableView::clearSpans() | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2784 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2785 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2786 | d->spans.clear(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2787 | d->viewport->update(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2788 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2789 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2790 | void QTableViewPrivate::_q_selectRow(int row) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2791 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2792 | selectRow(row, false); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2793 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2794 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2795 | void QTableViewPrivate::_q_selectColumn(int column) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2796 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2797 | selectColumn(column, false); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2798 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2799 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2800 | void QTableViewPrivate::selectRow(int row, bool anchor) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2801 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2802 | QTableView * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2803 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2804 | if (q->selectionBehavior() == QTableView::SelectColumns
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2805 | || (q->selectionMode() == QTableView::SingleSelection
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2806 | && q->selectionBehavior() == QTableView::SelectItems
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2807 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2808 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2809 | if (row >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2810 | int column = horizontalHeader->logicalIndexAt(q->isRightToLeft() ? viewport->width() : 0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2811 | QModelIndex index = model->index(row, column, root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2812 | QItemSelectionModel::SelectionFlags command = q->selectionCommand(index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2813 | selectionModel->setCurrentIndex(index, QItemSelectionModel::NoUpdate); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2814 | if ((anchor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2815 | || (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2816 | rowSectionAnchor = row; never executed: rowSectionAnchor = row; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2817 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2818 | if (q->selectionMode() != QTableView::SingleSelection
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2819 | && command.testFlag(QItemSelectionModel::Toggle)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2820 | if (anchor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2821 | ctrlDragSelectionFlag = verticalHeader->selectionModel()->selectedRows().contains(index)
never executed: ctrlDragSelectionFlag = verticalHeader->selectionModel()->selectedRows().contains(index) ? QItemSelectionModel::Deselect : QItemSelectionModel::Select; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2822 | ? QItemSelectionModel::Deselect : QItemSelectionModel::Select; never executed: ctrlDragSelectionFlag = verticalHeader->selectionModel()->selectedRows().contains(index) ? QItemSelectionModel::Deselect : QItemSelectionModel::Select; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2823 | command &= ~QItemSelectionModel::Toggle; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2824 | command |= ctrlDragSelectionFlag; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2825 | if (!anchor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2826 | command |= QItemSelectionModel::Current; never executed: command |= QItemSelectionModel::Current; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2827 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2828 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2829 | QModelIndex upper = model->index(qMin(rowSectionAnchor, row), column, root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2830 | QModelIndex lower = model->index(qMax(rowSectionAnchor, row), column, root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2831 | if ((verticalHeader->sectionsMoved()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2832 | q->setSelection(q->visualRect(upper) | q->visualRect(lower), command | QItemSelectionModel::Rows); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2833 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2834 | selectionModel->select(QItemSelection(upper, lower), command | QItemSelectionModel::Rows); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2835 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2836 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2837 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2838 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2839 | void QTableViewPrivate::selectColumn(int column, bool anchor) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2840 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2841 | QTableView * const q = q_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2842 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2843 | if (q->selectionBehavior() == QTableView::SelectRows
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2844 | || (q->selectionMode() == QTableView::SingleSelection
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2845 | && q->selectionBehavior() == QTableView::SelectItems
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2846 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2847 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2848 | if (column >= 0
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2849 | int row = verticalHeader->logicalIndexAt(0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2850 | QModelIndex index = model->index(row, column, root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2851 | QItemSelectionModel::SelectionFlags command = q->selectionCommand(index); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2852 | selectionModel->setCurrentIndex(index, QItemSelectionModel::NoUpdate); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2853 | if ((anchor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2854 | || (
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2855 | columnSectionAnchor = column; never executed: columnSectionAnchor = column; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2856 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2857 | if (q->selectionMode() != QTableView::SingleSelection
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2858 | && command.testFlag(QItemSelectionModel::Toggle)
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2859 | if (anchor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2860 | ctrlDragSelectionFlag = horizontalHeader->selectionModel()->selectedColumns().contains(index)
never executed: ctrlDragSelectionFlag = horizontalHeader->selectionModel()->selectedColumns().contains(index) ? QItemSelectionModel::Deselect : QItemSelectionModel::Select; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2861 | ? QItemSelectionModel::Deselect : QItemSelectionModel::Select; never executed: ctrlDragSelectionFlag = horizontalHeader->selectionModel()->selectedColumns().contains(index) ? QItemSelectionModel::Deselect : QItemSelectionModel::Select; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2862 | command &= ~QItemSelectionModel::Toggle; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2863 | command |= ctrlDragSelectionFlag; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2864 | if (!anchor
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2865 | command |= QItemSelectionModel::Current; never executed: command |= QItemSelectionModel::Current; | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2866 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2867 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2868 | QModelIndex left = model->index(row, qMin(columnSectionAnchor, column), root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2869 | QModelIndex right = model->index(row, qMax(columnSectionAnchor, column), root); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2870 | if ((horizontalHeader->sectionsMoved()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2871 | q->setSelection(q->visualRect(left) | q->visualRect(right), command | QItemSelectionModel::Columns); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2872 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2873 | selectionModel->select(QItemSelection(left, right), command | QItemSelectionModel::Columns); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2874 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2875 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2876 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2877 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2878 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2879 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2880 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2881 | void QTableView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2882 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2883 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2884 | if (QAccessible::isActive()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2885 | if (current.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2886 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2887 | int entry = d->accessibleTable2Index(current); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2888 | QAccessibleEvent event(this, QAccessible::Focus); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2889 | event.setChild(entry); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2890 | QAccessible::updateAccessibility(&event); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2891 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2892 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2893 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2894 | QAbstractItemView::currentChanged(current, previous); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2895 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2896 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2897 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2898 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2899 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2900 | void QTableView::selectionChanged(const QItemSelection &selected, | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2901 | const QItemSelection &deselected) | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2902 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2903 | QTableViewPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2904 | (void)d; | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2905 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2906 | if (QAccessible::isActive()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2907 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2908 | QModelIndex sel = selected.indexes().value(0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2909 | if (sel.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2910 | int entry = d->accessibleTable2Index(sel); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2911 | QAccessibleEvent event(this, QAccessible::SelectionAdd); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2912 | event.setChild(entry); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2913 | QAccessible::updateAccessibility(&event); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2914 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2915 | QModelIndex desel = deselected.indexes().value(0); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2916 | if (desel.isValid()
| 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2917 | int entry = d->accessibleTable2Index(desel); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2918 | QAccessibleEvent event(this, QAccessible::SelectionRemove); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2919 | event.setChild(entry); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2920 | QAccessible::updateAccessibility(&event); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2921 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2922 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2923 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2924 | QAbstractItemView::selectionChanged(selected, deselected); | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2925 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2926 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2927 | int QTableView::visualIndex(const QModelIndex &index) const | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2928 | { | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2929 | return never executed: index.row();return index.row();never executed: return index.row(); | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2930 | } | - | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2931 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2932 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2933 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| 2934 | - | |||||||||||||||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |