qidentityproxymodel.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/itemmodels/qidentityproxymodel.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7class QIdentityProxyModelPrivate : public QAbstractProxyModelPrivate-
8{-
9 QIdentityProxyModelPrivate()-
10 {-
11-
12 }-
13-
14 inline QIdentityProxyModel* q_func() { return static_cast<QIdentityProxyModel *>(q_ptr); } inline const QIdentityProxyModel* q_func() const { return static_cast<const QIdentityProxyModel *>(q_ptr); } friend class QIdentityProxyModel;-
15-
16 QList<QPersistentModelIndex> layoutChangePersistentIndexes;-
17 QModelIndexList proxyIndexes;-
18-
19 void _q_sourceRowsAboutToBeInserted(const QModelIndex &parent, int start, int end);-
20 void _q_sourceRowsInserted(const QModelIndex &parent, int start, int end);-
21 void _q_sourceRowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);-
22 void _q_sourceRowsRemoved(const QModelIndex &parent, int start, int end);-
23 void _q_sourceRowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest);-
24 void _q_sourceRowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest);-
25-
26 void _q_sourceColumnsAboutToBeInserted(const QModelIndex &parent, int start, int end);-
27 void _q_sourceColumnsInserted(const QModelIndex &parent, int start, int end);-
28 void _q_sourceColumnsAboutToBeRemoved(const QModelIndex &parent, int start, int end);-
29 void _q_sourceColumnsRemoved(const QModelIndex &parent, int start, int end);-
30 void _q_sourceColumnsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest);-
31 void _q_sourceColumnsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest);-
32-
33 void _q_sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles);-
34 void _q_sourceHeaderDataChanged(Qt::Orientation orientation, int first, int last);-
35-
36 void _q_sourceLayoutAboutToBeChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint);-
37 void _q_sourceLayoutChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint);-
38 void _q_sourceModelAboutToBeReset();-
39 void _q_sourceModelReset();-
40-
41};-
42QIdentityProxyModel::QIdentityProxyModel(QObject* parent)-
43 : QAbstractProxyModel(*new QIdentityProxyModelPrivate, parent)-
44{-
45-
46}
executed 2 times by 1 test: end of block
Executed by:
  • tst_QIdentityProxyModel
2
47-
48-
49-
50-
51QIdentityProxyModel::QIdentityProxyModel(QIdentityProxyModelPrivate &dd, QObject* parent)-
52 : QAbstractProxyModel(dd, parent)-
53{-
54-
55}
never executed: end of block
0
56-
57-
58-
59-
60QIdentityProxyModel::~QIdentityProxyModel()-
61{-
62}-
63-
64-
65-
66-
67int QIdentityProxyModel::columnCount(const QModelIndex& parent) const-
68{-
69 ((!(parent.isValid() ? parent.model() == this : true)) ? qt_assert("parent.isValid() ? parent.model() == this : true",__FILE__,139) : qt_noop());-
70 const QIdentityProxyModelPrivate * const d = d_func();-
71 return
executed 31 times by 1 test: return d->model->columnCount(mapToSource(parent));
Executed by:
  • tst_QIdentityProxyModel
d->model->columnCount(mapToSource(parent));
executed 31 times by 1 test: return d->model->columnCount(mapToSource(parent));
Executed by:
  • tst_QIdentityProxyModel
31
72}-
73-
74-
75-
76-
77bool QIdentityProxyModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent)-
78{-
79 ((!(parent.isValid() ? parent.model() == this : true)) ? qt_assert("parent.isValid() ? parent.model() == this : true",__FILE__,149) : qt_noop());-
80 QIdentityProxyModelPrivate * const d = d_func();-
81 return
never executed: return d->model->dropMimeData(data, action, row, column, mapToSource(parent));
d->model->dropMimeData(data, action, row, column, mapToSource(parent));
never executed: return d->model->dropMimeData(data, action, row, column, mapToSource(parent));
0
82}-
83-
84-
85-
86-
87QModelIndex QIdentityProxyModel::index(int row, int column, const QModelIndex& parent) const-
88{-
89 ((!(parent.isValid() ? parent.model() == this : true)) ? qt_assert("parent.isValid() ? parent.model() == this : true",__FILE__,159) : qt_noop());-
90 const QIdentityProxyModelPrivate * const d = d_func();-
91 const QModelIndex sourceParent = mapToSource(parent);-
92 const QModelIndex sourceIndex = d->model->index(row, column, sourceParent);-
93 return
executed 1 time by 1 test: return mapFromSource(sourceIndex);
Executed by:
  • tst_QIdentityProxyModel
mapFromSource(sourceIndex);
executed 1 time by 1 test: return mapFromSource(sourceIndex);
Executed by:
  • tst_QIdentityProxyModel
1
94}-
95-
96-
97-
98-
99QModelIndex QIdentityProxyModel::sibling(int row, int column, const QModelIndex &idx) const-
100{-
101 const QIdentityProxyModelPrivate * const d = d_func();-
102 return
never executed: return mapFromSource(d->model->sibling(row, column, mapToSource(idx)));
mapFromSource(d->model->sibling(row, column, mapToSource(idx)));
never executed: return mapFromSource(d->model->sibling(row, column, mapToSource(idx)));
0
103}-
104-
105-
106-
107-
108bool QIdentityProxyModel::insertColumns(int column, int count, const QModelIndex& parent)-
109{-
110 ((!(parent.isValid() ? parent.model() == this : true)) ? qt_assert("parent.isValid() ? parent.model() == this : true",__FILE__,180) : qt_noop());-
111 QIdentityProxyModelPrivate * const d = d_func();-
112 return
never executed: return d->model->insertColumns(column, count, mapToSource(parent));
d->model->insertColumns(column, count, mapToSource(parent));
never executed: return d->model->insertColumns(column, count, mapToSource(parent));
0
113}-
114-
115-
116-
117-
118bool QIdentityProxyModel::insertRows(int row, int count, const QModelIndex& parent)-
119{-
120 ((!(parent.isValid() ? parent.model() == this : true)) ? qt_assert("parent.isValid() ? parent.model() == this : true",__FILE__,190) : qt_noop());-
121 QIdentityProxyModelPrivate * const d = d_func();-
122 return
never executed: return d->model->insertRows(row, count, mapToSource(parent));
d->model->insertRows(row, count, mapToSource(parent));
never executed: return d->model->insertRows(row, count, mapToSource(parent));
0
123}-
124-
125-
126-
127-
128QModelIndex QIdentityProxyModel::mapFromSource(const QModelIndex& sourceIndex) const-
129{-
130 const QIdentityProxyModelPrivate * const d = d_func();-
131 if (!d->model
!d->modelDescription
TRUEnever evaluated
FALSEevaluated 237 times by 1 test
Evaluated by:
  • tst_QIdentityProxyModel
|| !sourceIndex.isValid()
!sourceIndex.isValid()Description
TRUEevaluated 65 times by 1 test
Evaluated by:
  • tst_QIdentityProxyModel
FALSEevaluated 172 times by 1 test
Evaluated by:
  • tst_QIdentityProxyModel
)
0-237
132 return
executed 65 times by 1 test: return QModelIndex();
Executed by:
  • tst_QIdentityProxyModel
QModelIndex();
executed 65 times by 1 test: return QModelIndex();
Executed by:
  • tst_QIdentityProxyModel
65
133-
134 ((!(sourceIndex.model() == d->model)) ? qt_assert("sourceIndex.model() == d->model",__FILE__,204) : qt_noop());-
135 return
executed 172 times by 1 test: return createIndex(sourceIndex.row(), sourceIndex.column(), sourceIndex.internalPointer());
Executed by:
  • tst_QIdentityProxyModel
createIndex(sourceIndex.row(), sourceIndex.column(), sourceIndex.internalPointer());
executed 172 times by 1 test: return createIndex(sourceIndex.row(), sourceIndex.column(), sourceIndex.internalPointer());
Executed by:
  • tst_QIdentityProxyModel
172
136}-
137-
138-
139-
140-
141QItemSelection QIdentityProxyModel::mapSelectionFromSource(const QItemSelection& selection) const-
142{-
143 const QIdentityProxyModelPrivate * const d = d_func();-
144 QItemSelection proxySelection;-
145-
146 if (!d->model
!d->modelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
147 return
never executed: return proxySelection;
proxySelection;
never executed: return proxySelection;
0
148-
149 QItemSelection::const_iterator it = selection.constBegin();-
150 const QItemSelection::const_iterator end = selection.constEnd();-
151 proxySelection.reserve(selection.count());-
152 for ( ; it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
153 ((!(it->model() == d->model)) ? qt_assert("it->model() == d->model",__FILE__,223) : qt_noop());-
154 const QItemSelectionRange range(mapFromSource(it->topLeft()), mapFromSource(it->bottomRight()));-
155 proxySelection.append(range);-
156 }
never executed: end of block
0
157-
158 return
never executed: return proxySelection;
proxySelection;
never executed: return proxySelection;
0
159}-
160-
161-
162-
163-
164QItemSelection QIdentityProxyModel::mapSelectionToSource(const QItemSelection& selection) const-
165{-
166 const QIdentityProxyModelPrivate * const d = d_func();-
167 QItemSelection sourceSelection;-
168-
169 if (!d->model
!d->modelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
170 return
never executed: return sourceSelection;
sourceSelection;
never executed: return sourceSelection;
0
171-
172 QItemSelection::const_iterator it = selection.constBegin();-
173 const QItemSelection::const_iterator end = selection.constEnd();-
174 sourceSelection.reserve(selection.count());-
175 for ( ; it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it) {
0
176 ((!(it->model() == this)) ? qt_assert("it->model() == this",__FILE__,246) : qt_noop());-
177 const QItemSelectionRange range(mapToSource(it->topLeft()), mapToSource(it->bottomRight()));-
178 sourceSelection.append(range);-
179 }
never executed: end of block
0
180-
181 return
never executed: return sourceSelection;
sourceSelection;
never executed: return sourceSelection;
0
182}-
183-
184-
185-
186-
187QModelIndex QIdentityProxyModel::mapToSource(const QModelIndex& proxyIndex) const-
188{-
189 const QIdentityProxyModelPrivate * const d = d_func();-
190 if (!d->model
!d->modelDescription
TRUEnever evaluated
FALSEevaluated 678 times by 1 test
Evaluated by:
  • tst_QIdentityProxyModel
|| !proxyIndex.isValid()
!proxyIndex.isValid()Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_QIdentityProxyModel
FALSEevaluated 642 times by 1 test
Evaluated by:
  • tst_QIdentityProxyModel
)
0-678
191 return
executed 36 times by 1 test: return QModelIndex();
Executed by:
  • tst_QIdentityProxyModel
QModelIndex();
executed 36 times by 1 test: return QModelIndex();
Executed by:
  • tst_QIdentityProxyModel
36
192 ((!(proxyIndex.model() == this)) ? qt_assert("proxyIndex.model() == this",__FILE__,262) : qt_noop());-
193 return
executed 642 times by 1 test: return d->model->createIndex(proxyIndex.row(), proxyIndex.column(), proxyIndex.internalPointer());
Executed by:
  • tst_QIdentityProxyModel
d->model->createIndex(proxyIndex.row(), proxyIndex.column(), proxyIndex.internalPointer());
executed 642 times by 1 test: return d->model->createIndex(proxyIndex.row(), proxyIndex.column(), proxyIndex.internalPointer());
Executed by:
  • tst_QIdentityProxyModel
642
194}-
195-
196-
197-
198-
199QModelIndexList QIdentityProxyModel::match(const QModelIndex& start, int role, const QVariant& value, int hits, Qt::MatchFlags flags) const-
200{-
201 const QIdentityProxyModelPrivate * const d = d_func();-
202 ((!(start.isValid() ? start.model() == this : true)) ? qt_assert("start.isValid() ? start.model() == this : true",__FILE__,272) : qt_noop());-
203 if (!d->model
!d->modelDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
204 return
never executed: return QModelIndexList();
QModelIndexList();
never executed: return QModelIndexList();
0
205-
206 const QModelIndexList sourceList = d->model->match(mapToSource(start), role, value, hits, flags);-
207 QModelIndexList::const_iterator it = sourceList.constBegin();-
208 const QModelIndexList::const_iterator end = sourceList.constEnd();-
209 QModelIndexList proxyList;-
210 proxyList.reserve(sourceList.count());-
211 for ( ; it != end
it != endDescription
TRUEnever evaluated
FALSEnever evaluated
; ++it)
0
212 proxyList.append(mapFromSource(*it));
never executed: proxyList.append(mapFromSource(*it));
0
213 return
never executed: return proxyList;
proxyList;
never executed: return proxyList;
0
214}-
215-
216-
217-
218-
219QModelIndex QIdentityProxyModel::parent(const QModelIndex& child) const-
220{-
221 ((!(child.isValid() ? child.model() == this : true)) ? qt_assert("child.isValid() ? child.model() == this : true",__FILE__,291) : qt_noop());-
222 const QModelIndex sourceIndex = mapToSource(child);-
223 const QModelIndex sourceParent = sourceIndex.parent();-
224 return
executed 98 times by 1 test: return mapFromSource(sourceParent);
Executed by:
  • tst_QIdentityProxyModel
mapFromSource(sourceParent);
executed 98 times by 1 test: return mapFromSource(sourceParent);
Executed by:
  • tst_QIdentityProxyModel
98
225}-
226-
227-
228-
229-
230bool QIdentityProxyModel::removeColumns(int column, int count, const QModelIndex& parent)-
231{-
232 ((!(parent.isValid() ? parent.model() == this : true)) ? qt_assert("parent.isValid() ? parent.model() == this : true",__FILE__,302) : qt_noop());-
233 QIdentityProxyModelPrivate * const d = d_func();-
234 return
never executed: return d->model->removeColumns(column, count, mapToSource(parent));
d->model->removeColumns(column, count, mapToSource(parent));
never executed: return d->model->removeColumns(column, count, mapToSource(parent));
0
235}-
236-
237-
238-
239-
240bool QIdentityProxyModel::removeRows(int row, int count, const QModelIndex& parent)-
241{-
242 ((!(parent.isValid() ? parent.model() == this : true)) ? qt_assert("parent.isValid() ? parent.model() == this : true",__FILE__,312) : qt_noop());-
243 QIdentityProxyModelPrivate * const d = d_func();-
244 return
never executed: return d->model->removeRows(row, count, mapToSource(parent));
d->model->removeRows(row, count, mapToSource(parent));
never executed: return d->model->removeRows(row, count, mapToSource(parent));
0
245}-
246-
247-
248-
249-
250int QIdentityProxyModel::rowCount(const QModelIndex& parent) const-
251{-
252 ((!(parent.isValid() ? parent.model() == this : true)) ? qt_assert("parent.isValid() ? parent.model() == this : true",__FILE__,322) : qt_noop());-
253 const QIdentityProxyModelPrivate * const d = d_func();-
254 return
executed 127 times by 1 test: return d->model->rowCount(mapToSource(parent));
Executed by:
  • tst_QIdentityProxyModel
d->model->rowCount(mapToSource(parent));
executed 127 times by 1 test: return d->model->rowCount(mapToSource(parent));
Executed by:
  • tst_QIdentityProxyModel
127
255}-
256-
257-
258-
259-
260QVariant QIdentityProxyModel::headerData(int section, Qt::Orientation orientation, int role) const-
261{-
262 const QIdentityProxyModelPrivate * const d = d_func();-
263 return
never executed: return d->model->headerData(section, orientation, role);
d->model->headerData(section, orientation, role);
never executed: return d->model->headerData(section, orientation, role);
0
264}-
265-
266-
267-
268-
269void QIdentityProxyModel::setSourceModel(QAbstractItemModel* newSourceModel)-
270{-
271 beginResetModel();-
272-
273 if (sourceModel()
sourceModel()Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QIdentityProxyModel
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QIdentityProxyModel
) {
4-5
274 disconnect(sourceModel(), qFlagLocation("2""rowsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "344"),-
275 this, qFlagLocation("1""_q_sourceRowsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "345"));-
276 disconnect(sourceModel(), qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "346"),-
277 this, qFlagLocation("1""_q_sourceRowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "347"));-
278 disconnect(sourceModel(), qFlagLocation("2""rowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "348"),-
279 this, qFlagLocation("1""_q_sourceRowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "349"));-
280 disconnect(sourceModel(), qFlagLocation("2""rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "350"),-
281 this, qFlagLocation("1""_q_sourceRowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "351"));-
282 disconnect(sourceModel(), qFlagLocation("2""rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "352"),-
283 this, qFlagLocation("1""_q_sourceRowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "353"));-
284 disconnect(sourceModel(), qFlagLocation("2""rowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "354"),-
285 this, qFlagLocation("1""_q_sourceRowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "355"));-
286 disconnect(sourceModel(), qFlagLocation("2""columnsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "356"),-
287 this, qFlagLocation("1""_q_sourceColumnsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "357"));-
288 disconnect(sourceModel(), qFlagLocation("2""columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "358"),-
289 this, qFlagLocation("1""_q_sourceColumnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "359"));-
290 disconnect(sourceModel(), qFlagLocation("2""columnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "360"),-
291 this, qFlagLocation("1""_q_sourceColumnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "361"));-
292 disconnect(sourceModel(), qFlagLocation("2""columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "362"),-
293 this, qFlagLocation("1""_q_sourceColumnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "363"));-
294 disconnect(sourceModel(), qFlagLocation("2""columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "364"),-
295 this, qFlagLocation("1""_q_sourceColumnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "365"));-
296 disconnect(sourceModel(), qFlagLocation("2""columnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "366"),-
297 this, qFlagLocation("1""_q_sourceColumnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "367"));-
298 disconnect(sourceModel(), qFlagLocation("2""modelAboutToBeReset()" "\0" __FILE__ ":" "368"),-
299 this, qFlagLocation("1""_q_sourceModelAboutToBeReset()" "\0" __FILE__ ":" "369"));-
300 disconnect(sourceModel(), qFlagLocation("2""modelReset()" "\0" __FILE__ ":" "370"),-
301 this, qFlagLocation("1""_q_sourceModelReset()" "\0" __FILE__ ":" "371"));-
302 disconnect(sourceModel(), qFlagLocation("2""dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "372"),-
303 this, qFlagLocation("1""_q_sourceDataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "373"));-
304 disconnect(sourceModel(), qFlagLocation("2""headerDataChanged(Qt::Orientation,int,int)" "\0" __FILE__ ":" "374"),-
305 this, qFlagLocation("1""_q_sourceHeaderDataChanged(Qt::Orientation,int,int)" "\0" __FILE__ ":" "375"));-
306 disconnect(sourceModel(), qFlagLocation("2""layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "376"),-
307 this, qFlagLocation("1""_q_sourceLayoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "377"));-
308 disconnect(sourceModel(), qFlagLocation("2""layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "378"),-
309 this, qFlagLocation("1""_q_sourceLayoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "379"));-
310 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_QIdentityProxyModel
5
311-
312 QAbstractProxyModel::setSourceModel(newSourceModel);-
313-
314 if (sourceModel()
sourceModel()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QIdentityProxyModel
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QIdentityProxyModel
) {
3-6
315 connect(sourceModel(), qFlagLocation("2""rowsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "385"),-
316 qFlagLocation("1""_q_sourceRowsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "386"));-
317 connect(sourceModel(), qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "387"),-
318 qFlagLocation("1""_q_sourceRowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "388"));-
319 connect(sourceModel(), qFlagLocation("2""rowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "389"),-
320 qFlagLocation("1""_q_sourceRowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "390"));-
321 connect(sourceModel(), qFlagLocation("2""rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "391"),-
322 qFlagLocation("1""_q_sourceRowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "392"));-
323 connect(sourceModel(), qFlagLocation("2""rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "393"),-
324 qFlagLocation("1""_q_sourceRowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "394"));-
325 connect(sourceModel(), qFlagLocation("2""rowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "395"),-
326 qFlagLocation("1""_q_sourceRowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "396"));-
327 connect(sourceModel(), qFlagLocation("2""columnsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "397"),-
328 qFlagLocation("1""_q_sourceColumnsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "398"));-
329 connect(sourceModel(), qFlagLocation("2""columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "399"),-
330 qFlagLocation("1""_q_sourceColumnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "400"));-
331 connect(sourceModel(), qFlagLocation("2""columnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "401"),-
332 qFlagLocation("1""_q_sourceColumnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "402"));-
333 connect(sourceModel(), qFlagLocation("2""columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "403"),-
334 qFlagLocation("1""_q_sourceColumnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "404"));-
335 connect(sourceModel(), qFlagLocation("2""columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "405"),-
336 qFlagLocation("1""_q_sourceColumnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "406"));-
337 connect(sourceModel(), qFlagLocation("2""columnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "407"),-
338 qFlagLocation("1""_q_sourceColumnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "408"));-
339 connect(sourceModel(), qFlagLocation("2""modelAboutToBeReset()" "\0" __FILE__ ":" "409"),-
340 qFlagLocation("1""_q_sourceModelAboutToBeReset()" "\0" __FILE__ ":" "410"));-
341 connect(sourceModel(), qFlagLocation("2""modelReset()" "\0" __FILE__ ":" "411"),-
342 qFlagLocation("1""_q_sourceModelReset()" "\0" __FILE__ ":" "412"));-
343 connect(sourceModel(), qFlagLocation("2""dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "413"),-
344 qFlagLocation("1""_q_sourceDataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "414"));-
345 connect(sourceModel(), qFlagLocation("2""headerDataChanged(Qt::Orientation,int,int)" "\0" __FILE__ ":" "415"),-
346 qFlagLocation("1""_q_sourceHeaderDataChanged(Qt::Orientation,int,int)" "\0" __FILE__ ":" "416"));-
347 connect(sourceModel(), qFlagLocation("2""layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "417"),-
348 qFlagLocation("1""_q_sourceLayoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "418"));-
349 connect(sourceModel(), qFlagLocation("2""layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "419"),-
350 qFlagLocation("1""_q_sourceLayoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "420"));-
351 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_QIdentityProxyModel
6
352-
353 endResetModel();-
354}
executed 9 times by 1 test: end of block
Executed by:
  • tst_QIdentityProxyModel
9
355-
356void QIdentityProxyModelPrivate::_q_sourceColumnsAboutToBeInserted(const QModelIndex &parent, int start, int end)-
357{-
358 ((!(parent.isValid() ? parent.model() == model : true)) ? qt_assert("parent.isValid() ? parent.model() == model : true",__FILE__,428) : qt_noop());-
359 QIdentityProxyModel * const q = q_func();-
360 q->beginInsertColumns(q->mapFromSource(parent), start, end);-
361}
executed 6 times by 1 test: end of block
Executed by:
  • tst_QIdentityProxyModel
6
362-
363void QIdentityProxyModelPrivate::_q_sourceColumnsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest)-
364{-
365 ((!(sourceParent.isValid() ? sourceParent.model() == model : true)) ? qt_assert("sourceParent.isValid() ? sourceParent.model() == model : true",__FILE__,435) : qt_noop());-
366 ((!(destParent.isValid() ? destParent.model() == model : true)) ? qt_assert("destParent.isValid() ? destParent.model() == model : true",__FILE__,436) : qt_noop());-
367 QIdentityProxyModel * const q = q_func();-
368 q->beginMoveColumns(q->mapFromSource(sourceParent), sourceStart, sourceEnd, q->mapFromSource(destParent), dest);-
369}
never executed: end of block
0
370-
371void QIdentityProxyModelPrivate::_q_sourceColumnsAboutToBeRemoved(const QModelIndex &parent, int start, int end)-
372{-
373 ((!(parent.isValid() ? parent.model() == model : true)) ? qt_assert("parent.isValid() ? parent.model() == model : true",__FILE__,443) : qt_noop());-
374 QIdentityProxyModel * const q = q_func();-
375 q->beginRemoveColumns(q->mapFromSource(parent), start, end);-
376}
never executed: end of block
0
377-
378void QIdentityProxyModelPrivate::_q_sourceColumnsInserted(const QModelIndex &parent, int start, int end)-
379{-
380 ((!(parent.isValid() ? parent.model() == model : true)) ? qt_assert("parent.isValid() ? parent.model() == model : true",__FILE__,450) : qt_noop());-
381 QIdentityProxyModel * const q = q_func();-
382 (void)parent;-
383 (void)start;-
384 (void)end;-
385 q->endInsertColumns();-
386}
executed 6 times by 1 test: end of block
Executed by:
  • tst_QIdentityProxyModel
6
387-
388void QIdentityProxyModelPrivate::_q_sourceColumnsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest)-
389{-
390 ((!(sourceParent.isValid() ? sourceParent.model() == model : true)) ? qt_assert("sourceParent.isValid() ? sourceParent.model() == model : true",__FILE__,460) : qt_noop());-
391 ((!(destParent.isValid() ? destParent.model() == model : true)) ? qt_assert("destParent.isValid() ? destParent.model() == model : true",__FILE__,461) : qt_noop());-
392 QIdentityProxyModel * const q = q_func();-
393 (void)sourceParent;-
394 (void)sourceStart;-
395 (void)sourceEnd;-
396 (void)destParent;-
397 (void)dest;-
398 q->endMoveColumns();-
399}
never executed: end of block
0
400-
401void QIdentityProxyModelPrivate::_q_sourceColumnsRemoved(const QModelIndex &parent, int start, int end)-
402{-
403 ((!(parent.isValid() ? parent.model() == model : true)) ? qt_assert("parent.isValid() ? parent.model() == model : true",__FILE__,473) : qt_noop());-
404 QIdentityProxyModel * const q = q_func();-
405 (void)parent;-
406 (void)start;-
407 (void)end;-
408 q->endRemoveColumns();-
409}
never executed: end of block
0
410-
411void QIdentityProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)-
412{-
413 ((!(topLeft.isValid() ? topLeft.model() == model : true)) ? qt_assert("topLeft.isValid() ? topLeft.model() == model : true",__FILE__,483) : qt_noop());-
414 ((!(bottomRight.isValid() ? bottomRight.model() == model : true)) ? qt_assert("bottomRight.isValid() ? bottomRight.model() == model : true",__FILE__,484) : qt_noop());-
415 QIdentityProxyModel * const q = q_func();-
416 q->dataChanged(q->mapFromSource(topLeft), q->mapFromSource(bottomRight), roles);-
417}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QIdentityProxyModel
1
418-
419void QIdentityProxyModelPrivate::_q_sourceHeaderDataChanged(Qt::Orientation orientation, int first, int last)-
420{-
421 QIdentityProxyModel * const q = q_func();-
422 q->headerDataChanged(orientation, first, last);-
423}
never executed: end of block
0
424-
425void QIdentityProxyModelPrivate::_q_sourceLayoutAboutToBeChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint)-
426{-
427 QIdentityProxyModel * const q = q_func();-
428-
429 const auto proxyPersistentIndexes = q->persistentIndexList();-
430 for (const QPersistentModelIndex &proxyPersistentIndex : proxyPersistentIndexes) {-
431 proxyIndexes << proxyPersistentIndex;-
432 ((!(proxyPersistentIndex.isValid())) ? qt_assert("proxyPersistentIndex.isValid()",__FILE__,502) : qt_noop());-
433 const QPersistentModelIndex srcPersistentIndex = q->mapToSource(proxyPersistentIndex);-
434 ((!(srcPersistentIndex.isValid())) ? qt_assert("srcPersistentIndex.isValid()",__FILE__,504) : qt_noop());-
435 layoutChangePersistentIndexes << srcPersistentIndex;-
436 }
never executed: end of block
0
437-
438 QList<QPersistentModelIndex> parents;-
439 parents.reserve(sourceParents.size());-
440 for (const QPersistentModelIndex &parent : sourceParents) {-
441 if (!parent.isValid()
!parent.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
442 parents << QPersistentModelIndex();-
443 continue;
never executed: continue;
0
444 }-
445 const QModelIndex mappedParent = q->mapFromSource(parent);-
446 ((!(mappedParent.isValid())) ? qt_assert("mappedParent.isValid()",__FILE__,516) : qt_noop());-
447 parents << mappedParent;-
448 }
never executed: end of block
0
449-
450 q->layoutAboutToBeChanged(parents, hint);-
451}
never executed: end of block
0
452-
453void QIdentityProxyModelPrivate::_q_sourceLayoutChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint)-
454{-
455 QIdentityProxyModel * const q = q_func();-
456-
457 for (int i = 0; i < proxyIndexes.size()
i < proxyIndexes.size()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
458 q->changePersistentIndex(proxyIndexes.at(i), q->mapFromSource(layoutChangePersistentIndexes.at(i)));-
459 }
never executed: end of block
0
460-
461 layoutChangePersistentIndexes.clear();-
462 proxyIndexes.clear();-
463-
464 QList<QPersistentModelIndex> parents;-
465 parents.reserve(sourceParents.size());-
466 for (const QPersistentModelIndex &parent : sourceParents) {-
467 if (!parent.isValid()
!parent.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
468 parents << QPersistentModelIndex();-
469 continue;
never executed: continue;
0
470 }-
471 const QModelIndex mappedParent = q->mapFromSource(parent);-
472 ((!(mappedParent.isValid())) ? qt_assert("mappedParent.isValid()",__FILE__,542) : qt_noop());-
473 parents << mappedParent;-
474 }
never executed: end of block
0
475-
476 q->layoutChanged(parents, hint);-
477}
never executed: end of block
0
478-
479void QIdentityProxyModelPrivate::_q_sourceModelAboutToBeReset()-
480{-
481 QIdentityProxyModel * const q = q_func();-
482 q->beginResetModel();-
483}
executed 3 times by 1 test: end of block
Executed by:
  • tst_QIdentityProxyModel
3
484-
485void QIdentityProxyModelPrivate::_q_sourceModelReset()-
486{-
487 QIdentityProxyModel * const q = q_func();-
488 q->endResetModel();-
489}
executed 3 times by 1 test: end of block
Executed by:
  • tst_QIdentityProxyModel
3
490-
491void QIdentityProxyModelPrivate::_q_sourceRowsAboutToBeInserted(const QModelIndex &parent, int start, int end)-
492{-
493 ((!(parent.isValid() ? parent.model() == model : true)) ? qt_assert("parent.isValid() ? parent.model() == model : true",__FILE__,563) : qt_noop());-
494 QIdentityProxyModel * const q = q_func();-
495 q->beginInsertRows(q->mapFromSource(parent), start, end);-
496}
executed 5 times by 1 test: end of block
Executed by:
  • tst_QIdentityProxyModel
5
497-
498void QIdentityProxyModelPrivate::_q_sourceRowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest)-
499{-
500 ((!(sourceParent.isValid() ? sourceParent.model() == model : true)) ? qt_assert("sourceParent.isValid() ? sourceParent.model() == model : true",__FILE__,570) : qt_noop());-
501 ((!(destParent.isValid() ? destParent.model() == model : true)) ? qt_assert("destParent.isValid() ? destParent.model() == model : true",__FILE__,571) : qt_noop());-
502 QIdentityProxyModel * const q = q_func();-
503 q->beginMoveRows(q->mapFromSource(sourceParent), sourceStart, sourceEnd, q->mapFromSource(destParent), dest);-
504}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QIdentityProxyModel
1
505-
506void QIdentityProxyModelPrivate::_q_sourceRowsAboutToBeRemoved(const QModelIndex &parent, int start, int end)-
507{-
508 ((!(parent.isValid() ? parent.model() == model : true)) ? qt_assert("parent.isValid() ? parent.model() == model : true",__FILE__,578) : qt_noop());-
509 QIdentityProxyModel * const q = q_func();-
510 q->beginRemoveRows(q->mapFromSource(parent), start, end);-
511}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QIdentityProxyModel
1
512-
513void QIdentityProxyModelPrivate::_q_sourceRowsInserted(const QModelIndex &parent, int start, int end)-
514{-
515 ((!(parent.isValid() ? parent.model() == model : true)) ? qt_assert("parent.isValid() ? parent.model() == model : true",__FILE__,585) : qt_noop());-
516 QIdentityProxyModel * const q = q_func();-
517 (void)parent;-
518 (void)start;-
519 (void)end;-
520 q->endInsertRows();-
521}
executed 5 times by 1 test: end of block
Executed by:
  • tst_QIdentityProxyModel
5
522-
523void QIdentityProxyModelPrivate::_q_sourceRowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destParent, int dest)-
524{-
525 ((!(sourceParent.isValid() ? sourceParent.model() == model : true)) ? qt_assert("sourceParent.isValid() ? sourceParent.model() == model : true",__FILE__,595) : qt_noop());-
526 ((!(destParent.isValid() ? destParent.model() == model : true)) ? qt_assert("destParent.isValid() ? destParent.model() == model : true",__FILE__,596) : qt_noop());-
527 QIdentityProxyModel * const q = q_func();-
528 (void)sourceParent;-
529 (void)sourceStart;-
530 (void)sourceEnd;-
531 (void)destParent;-
532 (void)dest;-
533 q->endMoveRows();-
534}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QIdentityProxyModel
1
535-
536void QIdentityProxyModelPrivate::_q_sourceRowsRemoved(const QModelIndex &parent, int start, int end)-
537{-
538 ((!(parent.isValid() ? parent.model() == model : true)) ? qt_assert("parent.isValid() ? parent.model() == model : true",__FILE__,608) : qt_noop());-
539 QIdentityProxyModel * const q = q_func();-
540 (void)parent;-
541 (void)start;-
542 (void)end;-
543 q->endRemoveRows();-
544}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QIdentityProxyModel
1
545-
546-
547-
Switch to Source codePreprocessed file

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