OpenCoverage

qsortfilterproxymodel.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/itemmodels/qsortfilterproxymodel.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9typedef QVector<QPair<QModelIndex, QPersistentModelIndex> > QModelIndexPairList;-
10-
11static inline QSet<int> qVectorToSet(const QVector<int> &vector)-
12{-
13 QSet<int> set;-
14 set.reserve(vector.size());-
15 for(int i=0; i < vector.size()
i < vector.size()Description
TRUEevaluated 87 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 787 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
; ++i)
87-787
16 set
executed 87 times by 4 tests: set << vector.at(i);
Executed by:
  • tst_ModelTest
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
<< vector.at(i);
executed 87 times by 4 tests: set << vector.at(i);
Executed by:
  • tst_ModelTest
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
87
17 return
executed 787 times by 5 tests: return set;
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
set;
executed 787 times by 5 tests: return set;
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
787
18}-
19-
20class QSortFilterProxyModelLessThan-
21{-
22public:-
23 inline QSortFilterProxyModelLessThan(int column, const QModelIndex &parent,-
24 const QAbstractItemModel *source,-
25 const QSortFilterProxyModel *proxy)-
26 : sort_column(column), source_parent(parent), source_model(source), proxy_model(proxy) {}
executed 312 times by 7 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
312
27-
28 inline bool operator()(int r1, int r2) const-
29 {-
30 QModelIndex i1 = source_model->index(r1, sort_column, source_parent);-
31 QModelIndex i2 = source_model->index(r2, sort_column, source_parent);-
32 return
executed 87865 times by 6 tests: return proxy_model->lessThan(i1, i2);
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
proxy_model->lessThan(i1, i2);
executed 87865 times by 6 tests: return proxy_model->lessThan(i1, i2);
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
87865
33 }-
34-
35private:-
36 int sort_column;-
37 QModelIndex source_parent;-
38 const QAbstractItemModel *source_model;-
39 const QSortFilterProxyModel *proxy_model;-
40};-
41-
42class QSortFilterProxyModelGreaterThan-
43{-
44public:-
45 inline QSortFilterProxyModelGreaterThan(int column, const QModelIndex &parent,-
46 const QAbstractItemModel *source,-
47 const QSortFilterProxyModel *proxy)-
48 : sort_column(column), source_parent(parent),-
49 source_model(source), proxy_model(proxy) {}
executed 21 times by 4 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
21
50-
51 inline bool operator()(int r1, int r2) const-
52 {-
53 QModelIndex i1 = source_model->index(r1, sort_column, source_parent);-
54 QModelIndex i2 = source_model->index(r2, sort_column, source_parent);-
55 return
executed 177 times by 4 tests: return proxy_model->lessThan(i2, i1);
Executed by:
  • tst_QAbstractItemView
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
proxy_model->lessThan(i2, i1);
executed 177 times by 4 tests: return proxy_model->lessThan(i2, i1);
Executed by:
  • tst_QAbstractItemView
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
177
56 }-
57-
58private:-
59 int sort_column;-
60 QModelIndex source_parent;-
61 const QAbstractItemModel *source_model;-
62 const QSortFilterProxyModel *proxy_model;-
63};-
64-
65-
66-
67-
68-
69struct QRowsRemoval-
70{-
71 QRowsRemoval(const QModelIndex &parent_source, int start, int end) : parent_source(parent_source), start(start), end(end)-
72 {-
73 }
executed 47 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
47
74-
75 QRowsRemoval() : start(-1), end(-1)-
76 {-
77 }
executed 329 times by 13 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
329
78-
79 bool contains(QModelIndex parent, int row)-
80 {-
81 do {-
82 if (parent == parent_source
parent == parent_sourceDescription
TRUEevaluated 304 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
FALSEnever evaluated
)
0-304
83 return
executed 304 times by 2 tests: return row >= start && row <= end;
Executed by:
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
row >= start && row <= end;
executed 304 times by 2 tests: return row >= start && row <= end;
Executed by:
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
304
84 row = parent.row();-
85 parent = parent.parent();-
86 }
never executed: end of block
while (row >= 0
row >= 0Description
TRUEnever evaluated
FALSEnever evaluated
);
0
87 return
never executed: return false;
false;
never executed: return false;
0
88 }-
89private:-
90 QModelIndex parent_source;-
91 int start;-
92 int end;-
93};-
94-
95class QSortFilterProxyModelPrivate : public QAbstractProxyModelPrivate-
96{-
97 inline QSortFilterProxyModel* q_func() { return static_cast<QSortFilterProxyModel *>(q_ptr); } inline const QSortFilterProxyModel* q_func() const { return static_cast<const QSortFilterProxyModel *>(q_ptr); } friend class QSortFilterProxyModel;-
98-
99public:-
100 struct Mapping {-
101 QVector<int> source_rows;-
102 QVector<int> source_columns;-
103 QVector<int> proxy_rows;-
104 QVector<int> proxy_columns;-
105 QVector<QModelIndex> mapped_children;-
106 QHash<QModelIndex, Mapping *>::const_iterator map_iter;-
107 };-
108-
109 mutable QHash<QModelIndex, Mapping*> source_index_mapping;-
110-
111 int source_sort_column;-
112 int proxy_sort_column;-
113 Qt::SortOrder sort_order;-
114 Qt::CaseSensitivity sort_casesensitivity;-
115 int sort_role;-
116 bool sort_localeaware;-
117-
118 int filter_column;-
119 QRegExp filter_regexp;-
120 int filter_role;-
121-
122 bool dynamic_sortfilter;-
123 QRowsRemoval itemsBeingRemoved;-
124-
125 QModelIndexPairList saved_persistent_indexes;-
126-
127 QHash<QModelIndex, Mapping *>::const_iterator create_mapping(-
128 const QModelIndex &source_parent) const;-
129 QModelIndex proxy_to_source(const QModelIndex &proxyIndex) const;-
130 QModelIndex source_to_proxy(const QModelIndex &sourceIndex) const;-
131 bool can_create_mapping(const QModelIndex &source_parent) const;-
132-
133 void remove_from_mapping(const QModelIndex &source_parent);-
134-
135 inline QHash<QModelIndex, Mapping *>::const_iterator index_to_iterator(-
136 const QModelIndex &proxy_index) const-
137 {-
138 ((!(proxy_index.isValid())) ? qt_assert("proxy_index.isValid()",__FILE__,186) : qt_noop());-
139 ((!(proxy_index.model() == q_func())) ? qt_assert("proxy_index.model() == q_func()",__FILE__,187) : qt_noop());-
140 const void *p = proxy_index.internalPointer();-
141 ((!(p)) ? qt_assert("p",__FILE__,189) : qt_noop());-
142 QHash<QModelIndex, Mapping *>::const_iterator it =-
143 static_cast<const Mapping*>(p)->map_iter;-
144 ((!(it != source_index_mapping.constEnd())) ? qt_assert("it != source_index_mapping.constEnd()",__FILE__,192) : qt_noop());-
145 ((!(it.value())) ? qt_assert("it.value()",__FILE__,193) : qt_noop());-
146 return
executed 149789 times by 13 tests: return it;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
it;
executed 149789 times by 13 tests: return it;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
149789
147 }-
148-
149 inline QModelIndex create_index(int row, int column,-
150 QHash<QModelIndex, Mapping*>::const_iterator it) const-
151 {-
152 return
executed 118356 times by 13 tests: return q_func()->createIndex(row, column, *it);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
q_func()->createIndex(row, column, *it);
executed 118356 times by 13 tests: return q_func()->createIndex(row, column, *it);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
118356
153 }-
154-
155 void _q_sourceDataChanged(const QModelIndex &source_top_left,-
156 const QModelIndex &source_bottom_right,-
157 const QVector<int> &roles);-
158 void _q_sourceHeaderDataChanged(Qt::Orientation orientation, int start, int end);-
159-
160 void _q_sourceAboutToBeReset();-
161 void _q_sourceReset();-
162-
163 void _q_sourceLayoutAboutToBeChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint);-
164 void _q_sourceLayoutChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint);-
165-
166 void _q_sourceRowsAboutToBeInserted(const QModelIndex &source_parent,-
167 int start, int end);-
168 void _q_sourceRowsInserted(const QModelIndex &source_parent,-
169 int start, int end);-
170 void _q_sourceRowsAboutToBeRemoved(const QModelIndex &source_parent,-
171 int start, int end);-
172 void _q_sourceRowsRemoved(const QModelIndex &source_parent,-
173 int start, int end);-
174 void _q_sourceRowsAboutToBeMoved(const QModelIndex &sourceParent,-
175 int sourceStart, int sourceEnd,-
176 const QModelIndex &destParent, int dest);-
177 void _q_sourceRowsMoved(const QModelIndex &sourceParent,-
178 int sourceStart, int sourceEnd,-
179 const QModelIndex &destParent, int dest);-
180 void _q_sourceColumnsAboutToBeInserted(const QModelIndex &source_parent,-
181 int start, int end);-
182 void _q_sourceColumnsInserted(const QModelIndex &source_parent,-
183 int start, int end);-
184 void _q_sourceColumnsAboutToBeRemoved(const QModelIndex &source_parent,-
185 int start, int end);-
186 void _q_sourceColumnsRemoved(const QModelIndex &source_parent,-
187 int start, int end);-
188 void _q_sourceColumnsAboutToBeMoved(const QModelIndex &sourceParent,-
189 int sourceStart, int sourceEnd,-
190 const QModelIndex &destParent, int dest);-
191 void _q_sourceColumnsMoved(const QModelIndex &sourceParent,-
192 int sourceStart, int sourceEnd,-
193 const QModelIndex &destParent, int dest);-
194-
195 void _q_clearMapping();-
196-
197 void sort();-
198 bool update_source_sort_column();-
199 void sort_source_rows(QVector<int> &source_rows,-
200 const QModelIndex &source_parent) const;-
201 QVector<QPair<int, QVector<int > > > proxy_intervals_for_source_items_to_add(-
202 const QVector<int> &proxy_to_source, const QVector<int> &source_items,-
203 const QModelIndex &source_parent, Qt::Orientation orient) const;-
204 QVector<QPair<int, int > > proxy_intervals_for_source_items(-
205 const QVector<int> &source_to_proxy, const QVector<int> &source_items) const;-
206 void insert_source_items(-
207 QVector<int> &source_to_proxy, QVector<int> &proxy_to_source,-
208 const QVector<int> &source_items, const QModelIndex &source_parent,-
209 Qt::Orientation orient, bool emit_signal = true);-
210 void remove_source_items(-
211 QVector<int> &source_to_proxy, QVector<int> &proxy_to_source,-
212 const QVector<int> &source_items, const QModelIndex &source_parent,-
213 Qt::Orientation orient, bool emit_signal = true);-
214 void remove_proxy_interval(-
215 QVector<int> &source_to_proxy, QVector<int> &proxy_to_source,-
216 int proxy_start, int proxy_end, const QModelIndex &proxy_parent,-
217 Qt::Orientation orient, bool emit_signal = true);-
218 void build_source_to_proxy_mapping(-
219 const QVector<int> &proxy_to_source, QVector<int> &source_to_proxy) const;-
220 void source_items_inserted(const QModelIndex &source_parent,-
221 int start, int end, Qt::Orientation orient);-
222 void source_items_about_to_be_removed(const QModelIndex &source_parent,-
223 int start, int end, Qt::Orientation orient);-
224 void source_items_removed(const QModelIndex &source_parent,-
225 int start, int end, Qt::Orientation orient);-
226 void proxy_item_range(-
227 const QVector<int> &source_to_proxy, const QVector<int> &source_items,-
228 int &proxy_low, int &proxy_high) const;-
229-
230 QModelIndexPairList store_persistent_indexes() const;-
231 void update_persistent_indexes(const QModelIndexPairList &source_indexes);-
232-
233 void filter_about_to_be_changed(const QModelIndex &source_parent = QModelIndex());-
234 void filter_changed(const QModelIndex &source_parent = QModelIndex());-
235 QSet<int> handle_filter_changed(-
236 QVector<int> &source_to_proxy, QVector<int> &proxy_to_source,-
237 const QModelIndex &source_parent, Qt::Orientation orient);-
238-
239 void updateChildrenMapping(const QModelIndex &source_parent, Mapping *parent_mapping,-
240 Qt::Orientation orient, int start, int end, int delta_item_count, bool remove);-
241-
242 virtual void _q_sourceModelDestroyed() override;-
243};-
244-
245typedef QHash<QModelIndex, QSortFilterProxyModelPrivate::Mapping *> IndexMap;-
246-
247void QSortFilterProxyModelPrivate::_q_sourceModelDestroyed()-
248{-
249 QAbstractProxyModelPrivate::_q_sourceModelDestroyed();-
250 qDeleteAll(source_index_mapping);-
251 source_index_mapping.clear();-
252}
executed 18 times by 9 tests: end of block
Executed by:
  • tst_QAbstractItemModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QTreeView
  • tst_modeltest - unknown status
  • tst_qsortfilterproxymodel - unknown status
18
253-
254void QSortFilterProxyModelPrivate::remove_from_mapping(const QModelIndex &source_parent)-
255{-
256 if (Mapping *m = source_index_mapping.take(source_parent)
Mapping *m = s...source_parent)Description
TRUEevaluated 38 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEnever evaluated
) {
0-38
257 for (int i = 0; i < m->mapped_children.size()
i < m->mapped_children.size()Description
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 38 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
; ++i)
20-38
258 remove_from_mapping(m->mapped_children.at(i));
executed 20 times by 2 tests: remove_from_mapping(m->mapped_children.at(i));
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
20
259 delete m;-
260 }
executed 38 times by 2 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
38
261}
executed 38 times by 2 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
38
262-
263void QSortFilterProxyModelPrivate::_q_clearMapping()-
264{-
265-
266 QModelIndexPairList source_indexes = store_persistent_indexes();-
267-
268 qDeleteAll(source_index_mapping);-
269 source_index_mapping.clear();-
270 if (dynamic_sortfilter
dynamic_sortfilterDescription
TRUEevaluated 828 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
&& update_source_sort_column()
update_source_sort_column()Description
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_QSortFilterProxyModel
  • tst_QTreeView
FALSEevaluated 820 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
) {
6-828
271-
272 qDeleteAll(source_index_mapping);-
273 source_index_mapping.clear();-
274 }
executed 8 times by 2 tests: end of block
Executed by:
  • tst_QSortFilterProxyModel
  • tst_QTreeView
8
275-
276-
277 update_persistent_indexes(source_indexes);-
278}
executed 834 times by 13 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
834
279-
280IndexMap::const_iterator QSortFilterProxyModelPrivate::create_mapping(-
281 const QModelIndex &source_parent) const-
282{-
283 const QSortFilterProxyModel * const q = q_func();-
284-
285 IndexMap::const_iterator it = source_index_mapping.constFind(source_parent);-
286 if (it != source_index_mapping.constEnd()
it != source_i...ing.constEnd()Description
TRUEevaluated 150855 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 1248 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
)
1248-150855
287 return
executed 150855 times by 13 tests: return it;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
it;
executed 150855 times by 13 tests: return it;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
150855
288-
289 Mapping *m = new Mapping;-
290-
291 int source_rows = model->rowCount(source_parent);-
292 m->source_rows.reserve(source_rows);-
293 for (int i = 0; i < source_rows
i < source_rowsDescription
TRUEevaluated 11660 times by 12 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 1248 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
; ++i) {
1248-11660
294 if (q->filterAcceptsRow(i, source_parent)
q->filterAccep...source_parent)Description
TRUEevaluated 4998 times by 12 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 6662 times by 3 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
)
4998-6662
295 m->source_rows.append(i);
executed 4998 times by 12 tests: m->source_rows.append(i);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
4998
296 }
executed 11660 times by 12 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
11660
297 int source_cols = model->columnCount(source_parent);-
298 m->source_columns.reserve(source_cols);-
299 for (int i = 0; i < source_cols
i < source_colsDescription
TRUEevaluated 459 times by 12 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 1248 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
; ++i) {
459-1248
300 if (q->filterAcceptsColumn(i, source_parent)
q->filterAccep...source_parent)Description
TRUEevaluated 459 times by 12 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEnever evaluated
)
0-459
301 m->source_columns.append(i);
executed 459 times by 12 tests: m->source_columns.append(i);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
459
302 }
executed 459 times by 12 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
459
303-
304 sort_source_rows(m->source_rows, source_parent);-
305 m->proxy_rows.resize(source_rows);-
306 build_source_to_proxy_mapping(m->source_rows, m->proxy_rows);-
307 m->proxy_columns.resize(source_cols);-
308 build_source_to_proxy_mapping(m->source_columns, m->proxy_columns);-
309-
310 it = IndexMap::const_iterator(source_index_mapping.insert(source_parent, m));-
311 m->map_iter = it;-
312-
313 if (source_parent.isValid()
source_parent.isValid()Description
TRUEevaluated 812 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 436 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
) {
436-812
314 QModelIndex source_grand_parent = source_parent.parent();-
315 IndexMap::const_iterator it2 = create_mapping(source_grand_parent);-
316 ((!(it2 != source_index_mapping.constEnd())) ? qt_assert("it2 != source_index_mapping.constEnd()",__FILE__,364) : qt_noop());-
317 it2.value()->mapped_children.append(source_parent);-
318 }
executed 812 times by 6 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QSortFilterProxyModel
812
319-
320 ((!(it != source_index_mapping.constEnd())) ? qt_assert("it != source_index_mapping.constEnd()",__FILE__,368) : qt_noop());-
321 ((!(it.value())) ? qt_assert("it.value()",__FILE__,369) : qt_noop());-
322-
323 return
executed 1248 times by 13 tests: return it;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
it;
executed 1248 times by 13 tests: return it;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
1248
324}-
325-
326QModelIndex QSortFilterProxyModelPrivate::proxy_to_source(const QModelIndex &proxy_index) const-
327{-
328 if (!proxy_index.isValid()
!proxy_index.isValid()Description
TRUEevaluated 111403 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 111693 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
)
111403-111693
329 return
executed 111403 times by 13 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
QModelIndex();
executed 111403 times by 13 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
111403
330 if (proxy_index.model() != q_func()
proxy_index.mo...() != q_func()Description
TRUEnever evaluated
FALSEevaluated 111693 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
) {
0-111693
331 QMessageLogger(__FILE__, 379, __PRETTY_FUNCTION__).warning("QSortFilterProxyModel: index from wrong model passed to mapToSource");-
332 ((!(!"QSortFilterProxyModel: index from wrong model passed to mapToSource")) ? qt_assert("!\"QSortFilterProxyModel: index from wrong model passed to mapToSource\"",__FILE__,380) : qt_noop());-
333 return
never executed: return QModelIndex();
QModelIndex();
never executed: return QModelIndex();
0
334 }-
335 IndexMap::const_iterator it = index_to_iterator(proxy_index);-
336 Mapping *m = it.value();-
337 if ((
(proxy_index.r...e_rows.size())Description
TRUEnever evaluated
FALSEevaluated 111693 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
proxy_index.row() >= m->source_rows.size())
(proxy_index.r...e_rows.size())Description
TRUEnever evaluated
FALSEevaluated 111693 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
|| (
(proxy_index.c...olumns.size())Description
TRUEnever evaluated
FALSEevaluated 111693 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
proxy_index.column() >= m->source_columns.size())
(proxy_index.c...olumns.size())Description
TRUEnever evaluated
FALSEevaluated 111693 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
)
0-111693
338 return
never executed: return QModelIndex();
QModelIndex();
never executed: return QModelIndex();
0
339 int source_row = m->source_rows.at(proxy_index.row());-
340 int source_col = m->source_columns.at(proxy_index.column());-
341 return
executed 111693 times by 13 tests: return model->index(source_row, source_col, it.key());
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
model->index(source_row, source_col, it.key());
executed 111693 times by 13 tests: return model->index(source_row, source_col, it.key());
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
111693
342}-
343-
344QModelIndex QSortFilterProxyModelPrivate::source_to_proxy(const QModelIndex &source_index) const-
345{-
346 if (!source_index.isValid()
!source_index.isValid()Description
TRUEevaluated 16107 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 7964 times by 11 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
)
7964-16107
347 return
executed 16107 times by 13 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
QModelIndex();
executed 16107 times by 13 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
16107
348 if (source_index.model() != model
source_index.model() != modelDescription
TRUEnever evaluated
FALSEevaluated 7964 times by 11 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
) {
0-7964
349 QMessageLogger(__FILE__, 397, __PRETTY_FUNCTION__).warning("QSortFilterProxyModel: index from wrong model passed to mapFromSource");-
350 ((!(!"QSortFilterProxyModel: index from wrong model passed to mapFromSource")) ? qt_assert("!\"QSortFilterProxyModel: index from wrong model passed to mapFromSource\"",__FILE__,398) : qt_noop());-
351 return
never executed: return QModelIndex();
QModelIndex();
never executed: return QModelIndex();
0
352 }-
353 QModelIndex source_parent = source_index.parent();-
354 IndexMap::const_iterator it = create_mapping(source_parent);-
355 Mapping *m = it.value();-
356 if ((
(source_index....y_rows.size())Description
TRUEnever evaluated
FALSEevaluated 7964 times by 11 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
source_index.row() >= m->proxy_rows.size())
(source_index....y_rows.size())Description
TRUEnever evaluated
FALSEevaluated 7964 times by 11 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
|| (
(source_index....olumns.size())Description
TRUEnever evaluated
FALSEevaluated 7964 times by 11 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
source_index.column() >= m->proxy_columns.size())
(source_index....olumns.size())Description
TRUEnever evaluated
FALSEevaluated 7964 times by 11 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
)
0-7964
357 return
never executed: return QModelIndex();
QModelIndex();
never executed: return QModelIndex();
0
358 int proxy_row = m->proxy_rows.at(source_index.row());-
359 int proxy_column = m->proxy_columns.at(source_index.column());-
360 if (proxy_row == -1
proxy_row == -1Description
TRUEevaluated 40 times by 2 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEevaluated 7924 times by 11 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
|| proxy_column == -1
proxy_column == -1Description
TRUEnever evaluated
FALSEevaluated 7924 times by 11 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
)
0-7924
361 return
executed 40 times by 2 tests: return QModelIndex();
Executed by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
QModelIndex();
executed 40 times by 2 tests: return QModelIndex();
Executed by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
40
362 return
executed 7924 times by 11 tests: return create_index(proxy_row, proxy_column, it);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
create_index(proxy_row, proxy_column, it);
executed 7924 times by 11 tests: return create_index(proxy_row, proxy_column, it);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
7924
363}-
364-
365bool QSortFilterProxyModelPrivate::can_create_mapping(const QModelIndex &source_parent) const-
366{-
367 if (source_parent.isValid()
source_parent.isValid()Description
TRUEevaluated 1677 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 604 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
) {
604-1677
368 QModelIndex source_grand_parent = source_parent.parent();-
369 IndexMap::const_iterator it = source_index_mapping.constFind(source_grand_parent);-
370 if (it == source_index_mapping.constEnd()
it == source_i...ing.constEnd()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QFileDialog2
FALSEevaluated 1675 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
) {
2-1675
371-
372 return
executed 2 times by 1 test: return false;
Executed by:
  • tst_QFileDialog2
false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_QFileDialog2
2
373 }-
374 Mapping *gm = it.value();-
375 if (gm->proxy_rows.at(source_parent.row()) == -1
gm->proxy_rows...t.row()) == -1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 1671 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
||
4-1671
376 gm->proxy_columns.at(source_parent.column()) == -1
gm->proxy_colu...olumn()) == -1Description
TRUEnever evaluated
FALSEevaluated 1671 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
) {
0-1671
377-
378 return
executed 4 times by 1 test: return false;
Executed by:
  • tst_QSortFilterProxyModel
false;
executed 4 times by 1 test: return false;
Executed by:
  • tst_QSortFilterProxyModel
4
379 }-
380 }
executed 1671 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
1671
381 return
executed 2275 times by 7 tests: return true;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
true;
executed 2275 times by 7 tests: return true;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
2275
382}-
383-
384-
385-
386-
387-
388-
389void QSortFilterProxyModelPrivate::sort()-
390{-
391 QSortFilterProxyModel * const q = q_func();-
392 q->layoutAboutToBeChanged(QList<QPersistentModelIndex>(), QAbstractItemModel::VerticalSortHint);-
393 QModelIndexPairList source_indexes = store_persistent_indexes();-
394 IndexMap::const_iterator it = source_index_mapping.constBegin();-
395 for (; it != source_index_mapping.constEnd()
it != source_i...ing.constEnd()Description
TRUEevaluated 267 times by 10 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 261 times by 11 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
; ++it) {
261-267
396 QModelIndex source_parent = it.key();-
397 Mapping *m = it.value();-
398 sort_source_rows(m->source_rows, source_parent);-
399 build_source_to_proxy_mapping(m->source_rows, m->proxy_rows);-
400 }
executed 267 times by 10 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
267
401 update_persistent_indexes(source_indexes);-
402 q->layoutChanged(QList<QPersistentModelIndex>(), QAbstractItemModel::VerticalSortHint);-
403}
executed 261 times by 11 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
261
404-
405-
406-
407-
408-
409-
410-
411bool QSortFilterProxyModelPrivate::update_source_sort_column()-
412{-
413 int old_source_sort_column = source_sort_column;-
414-
415 if (proxy_sort_column == -1
proxy_sort_column == -1Description
TRUEevaluated 2659 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 149 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
) {
149-2659
416 source_sort_column = -1;-
417 }
executed 2659 times by 13 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
else {
2659
418-
419-
420-
421 Mapping *m = create_mapping(QModelIndex()).value();-
422 if (proxy_sort_column < m->source_columns.size()
proxy_sort_col...columns.size()Description
TRUEevaluated 136 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 13 times by 3 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
)
13-136
423 source_sort_column = m->source_columns.at(proxy_sort_column);
executed 136 times by 8 tests: source_sort_column = m->source_columns.at(proxy_sort_column);
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
136
424 else-
425 source_sort_column = -1;
executed 13 times by 3 tests: source_sort_column = -1;
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
13
426 }-
427-
428 return
executed 2808 times by 13 tests: return old_source_sort_column != source_sort_column;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
old_source_sort_column != source_sort_column;
executed 2808 times by 13 tests: return old_source_sort_column != source_sort_column;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
2808
429}-
430-
431-
432-
433-
434-
435-
436-
437void QSortFilterProxyModelPrivate::sort_source_rows(-
438 QVector<int> &source_rows, const QModelIndex &source_parent) const-
439{-
440 const QSortFilterProxyModel * const q = q_func();-
441 if (source_sort_column >= 0
source_sort_column >= 0Description
TRUEevaluated 333 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 2381 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
) {
333-2381
442 if (sort_order == Qt::AscendingOrder
sort_order == ...AscendingOrderDescription
TRUEevaluated 312 times by 7 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
FALSEevaluated 21 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
) {
21-312
443 QSortFilterProxyModelLessThan lt(source_sort_column, source_parent, model, q);-
444 std::stable_sort(source_rows.begin(), source_rows.end(), lt);-
445 }
executed 312 times by 7 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
else {
312
446 QSortFilterProxyModelGreaterThan gt(source_sort_column, source_parent, model, q);-
447 std::stable_sort(source_rows.begin(), source_rows.end(), gt);-
448 }
executed 21 times by 4 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
21
449 } else {-
450 std::stable_sort(source_rows.begin(), source_rows.end());-
451 }
executed 2381 times by 13 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
2381
452}-
453QVector<QPair<int, int > > QSortFilterProxyModelPrivate::proxy_intervals_for_source_items(-
454 const QVector<int> &source_to_proxy, const QVector<int> &source_items) const-
455{-
456 QVector<QPair<int, int> > proxy_intervals;-
457 if (source_items.isEmpty()
source_items.isEmpty()Description
TRUEevaluated 13 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 132 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
)
13-132
458 return
executed 13 times by 3 tests: return proxy_intervals;
Executed by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
proxy_intervals;
executed 13 times by 3 tests: return proxy_intervals;
Executed by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
13
459-
460 int source_items_index = 0;-
461 while (source_items_index < source_items.size()
source_items_i...e_items.size()Description
TRUEevaluated 152 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 132 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
) {
132-152
462 int first_proxy_item = source_to_proxy.at(source_items.at(source_items_index));-
463 ((!(first_proxy_item != -1)) ? qt_assert("first_proxy_item != -1",__FILE__,523) : qt_noop());-
464 int last_proxy_item = first_proxy_item;-
465 ++source_items_index;-
466-
467 while ((
(source_items_..._items.size())Description
TRUEevaluated 485 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 132 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
source_items_index < source_items.size())
(source_items_..._items.size())Description
TRUEevaluated 485 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 132 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
132-485
468 && (
(source_to_pro...roxy_item + 1)Description
TRUEevaluated 465 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
source_to_proxy.at(source_items.at(source_items_index)) == last_proxy_item + 1)
(source_to_pro...roxy_item + 1)Description
TRUEevaluated 465 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
) {
20-465
469 ++last_proxy_item;-
470 ++source_items_index;-
471 }
executed 465 times by 3 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
465
472-
473 proxy_intervals.append(QPair<int, int>(first_proxy_item, last_proxy_item));-
474 }
executed 152 times by 6 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
152
475 std::stable_sort(proxy_intervals.begin(), proxy_intervals.end());-
476 return
executed 132 times by 6 tests: return proxy_intervals;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
proxy_intervals;
executed 132 times by 6 tests: return proxy_intervals;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
132
477}-
478void QSortFilterProxyModelPrivate::remove_source_items(-
479 QVector<int> &source_to_proxy, QVector<int> &proxy_to_source,-
480 const QVector<int> &source_items, const QModelIndex &source_parent,-
481 Qt::Orientation orient, bool emit_signal)-
482{-
483 QSortFilterProxyModel * const q = q_func();-
484 QModelIndex proxy_parent = q->mapFromSource(source_parent);-
485 if (!proxy_parent.isValid()
!proxy_parent.isValid()Description
TRUEevaluated 87 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 58 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
&& source_parent.isValid()
source_parent.isValid()Description
TRUEnever evaluated
FALSEevaluated 87 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
)
0-87
486 return;
never executed: return;
0
487-
488 QVector<QPair<int, int> > proxy_intervals;-
489 proxy_intervals = proxy_intervals_for_source_items(source_to_proxy, source_items);-
490-
491 for (int i = proxy_intervals.size()-1; i >= 0
i >= 0Description
TRUEevaluated 152 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 145 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
; --i) {
145-152
492 QPair<int, int> interval = proxy_intervals.at(i);-
493 int proxy_start = interval.first;-
494 int proxy_end = interval.second;-
495 remove_proxy_interval(source_to_proxy, proxy_to_source, proxy_start, proxy_end,-
496 proxy_parent, orient, emit_signal);-
497 }
executed 152 times by 6 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
152
498}
executed 145 times by 6 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
145
499void QSortFilterProxyModelPrivate::remove_proxy_interval(-
500 QVector<int> &source_to_proxy, QVector<int> &proxy_to_source, int proxy_start, int proxy_end,-
501 const QModelIndex &proxy_parent, Qt::Orientation orient, bool emit_signal)-
502{-
503 QSortFilterProxyModel * const q = q_func();-
504 if (emit_signal
emit_signalDescription
TRUEevaluated 139 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QSortFilterProxyModel
) {
13-139
505 if (orient == Qt::Vertical
orient == Qt::VerticalDescription
TRUEevaluated 104 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 35 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
35-104
506 q->beginRemoveRows(proxy_parent, proxy_start, proxy_end);
executed 104 times by 6 tests: q->beginRemoveRows(proxy_parent, proxy_start, proxy_end);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
104
507 else-
508 q->beginRemoveColumns(proxy_parent, proxy_start, proxy_end);
executed 35 times by 3 tests: q->beginRemoveColumns(proxy_parent, proxy_start, proxy_end);
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
35
509 }-
510-
511-
512 proxy_to_source.remove(proxy_start, proxy_end - proxy_start + 1);-
513-
514 build_source_to_proxy_mapping(proxy_to_source, source_to_proxy);-
515-
516 if (emit_signal
emit_signalDescription
TRUEevaluated 139 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QSortFilterProxyModel
) {
13-139
517 if (orient == Qt::Vertical
orient == Qt::VerticalDescription
TRUEevaluated 104 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 35 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
35-104
518 q->endRemoveRows();
executed 104 times by 6 tests: q->endRemoveRows();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
104
519 else-
520 q->endRemoveColumns();
executed 35 times by 3 tests: q->endRemoveColumns();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
35
521 }-
522}
executed 152 times by 6 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
152
523QVector<QPair<int, QVector<int > > > QSortFilterProxyModelPrivate::proxy_intervals_for_source_items_to_add(-
524 const QVector<int> &proxy_to_source, const QVector<int> &source_items,-
525 const QModelIndex &source_parent, Qt::Orientation orient) const-
526{-
527 const QSortFilterProxyModel * const q = q_func();-
528 QVector<QPair<int, QVector<int> > > proxy_intervals;-
529 if (source_items.isEmpty()
source_items.isEmpty()Description
TRUEevaluated 38 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 2304 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
)
38-2304
530 return
executed 38 times by 4 tests: return proxy_intervals;
Executed by:
  • tst_ModelTest
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
proxy_intervals;
executed 38 times by 4 tests: return proxy_intervals;
Executed by:
  • tst_ModelTest
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
38
531-
532 int proxy_low = 0;-
533 int proxy_item = 0;-
534 int source_items_index = 0;-
535 QVector<int> source_items_in_interval;-
536 bool compare = (orient == Qt::Vertical
orient == Qt::VerticalDescription
TRUEevaluated 1161 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 1143 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
&& source_sort_column >= 0
source_sort_column >= 0Description
TRUEevaluated 27 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEevaluated 1134 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
&& dynamic_sortfilter
dynamic_sortfilterDescription
TRUEevaluated 26 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
);
1-1161
537 while (source_items_index < source_items.size()
source_items_i...e_items.size()Description
TRUEevaluated 2317 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 2304 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
) {
2304-2317
538 source_items_in_interval.clear();-
539 int first_new_source_item = source_items.at(source_items_index);-
540 source_items_in_interval.append(first_new_source_item);-
541 ++source_items_index;-
542-
543-
544 int proxy_high = proxy_to_source.size() - 1;-
545 QModelIndex i1 = compare
compareDescription
TRUEevaluated 30 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEevaluated 2287 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
? model->index(first_new_source_item, source_sort_column, source_parent) : QModelIndex();
30-2287
546 while (proxy_low <= proxy_high
proxy_low <= proxy_highDescription
TRUEevaluated 1193 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 2317 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
) {
1193-2317
547 proxy_item = (proxy_low + proxy_high) / 2;-
548 if (compare
compareDescription
TRUEevaluated 58 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEevaluated 1135 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
) {
58-1135
549 QModelIndex i2 = model->index(proxy_to_source.at(proxy_item), source_sort_column, source_parent);-
550 if ((
(sort_order ==...scendingOrder)Description
TRUEevaluated 52 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
sort_order == Qt::AscendingOrder)
(sort_order ==...scendingOrder)Description
TRUEevaluated 52 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
? q->lessThan(i1, i2) : q->lessThan(i2, i1)
(sort_order ==...ssThan(i2, i1)Description
TRUEevaluated 19 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEevaluated 39 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
)
6-52
551 proxy_high = proxy_item - 1;
executed 19 times by 3 tests: proxy_high = proxy_item - 1;
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
19
552 else-
553 proxy_low = proxy_item + 1;
executed 39 times by 3 tests: proxy_low = proxy_item + 1;
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
39
554 } else {-
555 if (first_new_source_item < proxy_to_source.at(proxy_item)
first_new_sour...at(proxy_item)Description
TRUEevaluated 883 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 252 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
)
252-883
556 proxy_high = proxy_item - 1;
executed 883 times by 5 tests: proxy_high = proxy_item - 1;
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
883
557 else-
558 proxy_low = proxy_item + 1;
executed 252 times by 7 tests: proxy_low = proxy_item + 1;
Executed by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
252
559 }-
560 }-
561 proxy_item = proxy_low;-
562-
563-
564 if (proxy_item >= proxy_to_source.size()
proxy_item >= ..._source.size()Description
TRUEevaluated 2062 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 255 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
) {
255-2062
565 for ( ; source_items_index < source_items.size()
source_items_i...e_items.size()Description
TRUEevaluated 55128 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 2062 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
; ++source_items_index)
2062-55128
566 source_items_in_interval.append(source_items.at(source_items_index));
executed 55128 times by 6 tests: source_items_in_interval.append(source_items.at(source_items_index));
Executed by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
55128
567 }
executed 2062 times by 7 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
else {
2062
568 i1 = compare
compareDescription
TRUEevaluated 14 times by 3 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEevaluated 241 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
? model->index(proxy_to_source.at(proxy_item), source_sort_column, source_parent) : QModelIndex();
14-241
569 for ( ; source_items_index < source_items.size()
source_items_i...e_items.size()Description
TRUEevaluated 4845 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 242 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
; ++source_items_index) {
242-4845
570 int new_source_item = source_items.at(source_items_index);-
571 if (compare
compareDescription
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEevaluated 4827 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
) {
18-4827
572 QModelIndex i2 = model->index(new_source_item, source_sort_column, source_parent);-
573 if ((
(sort_order ==...scendingOrder)Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEnever evaluated
(sort_order ==...ssThan(i2, i1)Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_QFileDialog2
(sort_order ==...scendingOrder)Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEnever evaluated
sort_order == Qt::AscendingOrder)
(sort_order ==...ssThan(i2, i1)Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_QFileDialog2
(sort_order ==...scendingOrder)Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEnever evaluated
? q->lessThan(i1, i2) : q->lessThan(i2, i1)
(sort_order ==...ssThan(i2, i1)Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_QFileDialog2
)
0-18
574 break;
executed 4 times by 2 tests: break;
Executed by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
4
575 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_QFileDialog2
else {
14
576 if (proxy_to_source.at(proxy_item) < new_source_item
proxy_to_sourc...ew_source_itemDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 4818 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
9-4818
577 break;
executed 9 times by 2 tests: break;
Executed by:
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
9
578 }
executed 4818 times by 3 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
4818
579 source_items_in_interval.append(new_source_item);-
580 }
executed 4832 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
4832
581 }
executed 255 times by 7 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
255
582-
583-
584 proxy_intervals.append(QPair<int, QVector<int> >(proxy_item, source_items_in_interval));-
585 }
executed 2317 times by 9 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
2317
586 return
executed 2304 times by 9 tests: return proxy_intervals;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
proxy_intervals;
executed 2304 times by 9 tests: return proxy_intervals;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
2304
587}-
588void QSortFilterProxyModelPrivate::insert_source_items(-
589 QVector<int> &source_to_proxy, QVector<int> &proxy_to_source,-
590 const QVector<int> &source_items, const QModelIndex &source_parent,-
591 Qt::Orientation orient, bool emit_signal)-
592{-
593 QSortFilterProxyModel * const q = q_func();-
594 QModelIndex proxy_parent = q->mapFromSource(source_parent);-
595 if (!proxy_parent.isValid()
!proxy_parent.isValid()Description
TRUEevaluated 659 times by 8 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 1683 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
&& source_parent.isValid()
source_parent.isValid()Description
TRUEnever evaluated
FALSEevaluated 659 times by 8 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
)
0-1683
596 return;
never executed: return;
0
597-
598 QVector<QPair<int, QVector<int> > > proxy_intervals;-
599 proxy_intervals = proxy_intervals_for_source_items_to_add(-
600 proxy_to_source, source_items, source_parent, orient);-
601-
602 for (int i = proxy_intervals.size()-1; i >= 0
i >= 0Description
TRUEevaluated 2317 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 2342 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
; --i) {
2317-2342
603 QPair<int, QVector<int> > interval = proxy_intervals.at(i);-
604 int proxy_start = interval.first;-
605 QVector<int> source_items = interval.second;-
606 int proxy_end = proxy_start + source_items.size() - 1;-
607-
608 if (emit_signal
emit_signalDescription
TRUEevaluated 2304 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QSortFilterProxyModel
) {
13-2304
609 if (orient == Qt::Vertical
orient == Qt::VerticalDescription
TRUEevaluated 1161 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 1143 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
1143-1161
610 q->beginInsertRows(proxy_parent, proxy_start, proxy_end);
executed 1161 times by 9 tests: q->beginInsertRows(proxy_parent, proxy_start, proxy_end);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
1161
611 else-
612 q->beginInsertColumns(proxy_parent, proxy_start, proxy_end);
executed 1143 times by 4 tests: q->beginInsertColumns(proxy_parent, proxy_start, proxy_end);
Executed by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
1143
613 }-
614-
615 for (int i = 0; i < source_items.size()
i < source_items.size()Description
TRUEevaluated 62277 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 2317 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
; ++i)
2317-62277
616 proxy_to_source.insert(proxy_start + i, source_items.at(i));
executed 62277 times by 9 tests: proxy_to_source.insert(proxy_start + i, source_items.at(i));
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
62277
617-
618 build_source_to_proxy_mapping(proxy_to_source, source_to_proxy);-
619-
620 if (emit_signal
emit_signalDescription
TRUEevaluated 2304 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QSortFilterProxyModel
) {
13-2304
621 if (orient == Qt::Vertical
orient == Qt::VerticalDescription
TRUEevaluated 1161 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 1143 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
1143-1161
622 q->endInsertRows();
executed 1161 times by 9 tests: q->endInsertRows();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
1161
623 else-
624 q->endInsertColumns();
executed 1143 times by 4 tests: q->endInsertColumns();
Executed by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
1143
625 }-
626 }
executed 2317 times by 9 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
2317
627}
executed 2342 times by 9 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
2342
628void QSortFilterProxyModelPrivate::source_items_inserted(-
629 const QModelIndex &source_parent, int start, int end, Qt::Orientation orient)-
630{-
631 QSortFilterProxyModel * const q = q_func();-
632 if ((
(start < 0)Description
TRUEnever evaluated
FALSEevaluated 2278 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
start < 0)
(start < 0)Description
TRUEnever evaluated
FALSEevaluated 2278 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
|| (
(end < 0)Description
TRUEnever evaluated
FALSEevaluated 2278 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
end < 0)
(end < 0)Description
TRUEnever evaluated
FALSEevaluated 2278 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
)
0-2278
633 return;
never executed: return;
0
634 IndexMap::const_iterator it = source_index_mapping.constFind(source_parent);-
635 if (it == source_index_mapping.constEnd()
it == source_i...ing.constEnd()Description
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEevaluated 2275 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
) {
3-2275
636 if (!can_create_mapping(source_parent)
!can_create_ma...source_parent)Description
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEnever evaluated
)
0-3
637 return;
executed 3 times by 2 tests: return;
Executed by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
3
638 it = create_mapping(source_parent);-
639 Mapping *m = it.value();-
640 QModelIndex proxy_parent = q->mapFromSource(source_parent);-
641 if (m->source_rows.count() > 0
m->source_rows.count() > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
642 q->beginInsertRows(proxy_parent, 0, m->source_rows.count() - 1);-
643 q->endInsertRows();-
644 }
never executed: end of block
0
645 if (m->source_columns.count() > 0
m->source_columns.count() > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
646 q->beginInsertColumns(proxy_parent, 0, m->source_columns.count() - 1);-
647 q->endInsertColumns();-
648 }
never executed: end of block
0
649 return;
never executed: return;
0
650 }-
651-
652 Mapping *m = it.value();-
653 QVector<int> &source_to_proxy = (
(orient == Qt::Vertical)Description
TRUEevaluated 1132 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 1143 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
orient == Qt::Vertical)
(orient == Qt::Vertical)Description
TRUEevaluated 1132 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 1143 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
? m->proxy_rows : m->proxy_columns;
1132-1143
654 QVector<int> &proxy_to_source = (
(orient == Qt::Vertical)Description
TRUEevaluated 1132 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 1143 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
orient == Qt::Vertical)
(orient == Qt::Vertical)Description
TRUEevaluated 1132 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 1143 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
? m->source_rows : m->source_columns;
1132-1143
655-
656 int delta_item_count = end - start + 1;-
657 int old_item_count = source_to_proxy.size();-
658-
659 updateChildrenMapping(source_parent, m, orient, start, end, delta_item_count, false);-
660-
661-
662 if (start < 0
start < 0Description
TRUEnever evaluated
FALSEevaluated 2275 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
|| start > source_to_proxy.size()
start > source_to_proxy.size()Description
TRUEnever evaluated
FALSEevaluated 2275 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
) {
0-2275
663 QMessageLogger(__FILE__, 775, __PRETTY_FUNCTION__).warning("QSortFilterProxyModel: invalid inserted rows reported by source model");-
664 remove_from_mapping(source_parent);-
665 return;
never executed: return;
0
666 }-
667 source_to_proxy.insert(start, delta_item_count, -1);-
668-
669 if (start < old_item_count
start < old_item_countDescription
TRUEevaluated 234 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 2041 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
) {
234-2041
670-
671 int proxy_count = proxy_to_source.size();-
672 for (int proxy_item = 0; proxy_item < proxy_count
proxy_item < proxy_countDescription
TRUEevaluated 6708 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 234 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
; ++proxy_item) {
234-6708
673 int source_item = proxy_to_source.at(proxy_item);-
674 if (source_item >= start
source_item >= startDescription
TRUEevaluated 6141 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 567 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
567-6141
675 proxy_to_source.replace(proxy_item, source_item + delta_item_count);
executed 6141 times by 4 tests: proxy_to_source.replace(proxy_item, source_item + delta_item_count);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
6141
676 }
executed 6708 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
6708
677 build_source_to_proxy_mapping(proxy_to_source, source_to_proxy);-
678 }
executed 234 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
234
679-
680-
681 QVector<int> source_items;-
682 for (int i = start; i <= end
i <= endDescription
TRUEevaluated 62229 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 2275 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
; ++i) {
2275-62229
683 if ((
(orient == Qt::Vertical)Description
TRUEevaluated 36326 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 25903 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
orient == Qt::Vertical)
(orient == Qt::Vertical)Description
TRUEevaluated 36326 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 25903 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
(orient == Qt:...source_parent)Description
TRUEevaluated 62219 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
10-62219
684 ? q->filterAcceptsRow(i, source_parent)
(orient == Qt:...source_parent)Description
TRUEevaluated 62219 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
10-62219
685 : q->filterAcceptsColumn(i, source_parent)
(orient == Qt:...source_parent)Description
TRUEevaluated 62219 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
) {
10-62219
686 source_items.append(i);-
687 }
executed 62219 times by 7 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
62219
688 }
executed 62229 times by 7 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
62229
689-
690 if (model->rowCount(source_parent) == delta_item_count
model->rowCoun...lta_item_countDescription
TRUEevaluated 1766 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 509 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
) {
509-1766
691-
692-
693-
694-
695 QVector<int> &orthogonal_proxy_to_source = (
(orient == Qt::Horizontal)Description
TRUEevaluated 836 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 930 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
orient == Qt::Horizontal)
(orient == Qt::Horizontal)Description
TRUEevaluated 836 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 930 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
? m->source_rows : m->source_columns;
836-930
696 QVector<int> &orthogonal_source_to_proxy = (
(orient == Qt::Horizontal)Description
TRUEevaluated 836 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 930 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
orient == Qt::Horizontal)
(orient == Qt::Horizontal)Description
TRUEevaluated 836 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 930 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
? m->proxy_rows : m->proxy_columns;
836-930
697-
698 if (orthogonal_source_to_proxy.isEmpty()
orthogonal_sou...roxy.isEmpty()Description
TRUEevaluated 843 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 923 times by 4 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
) {
843-923
699 const int ortho_end = (
(orient == Qt::Horizontal)Description
TRUEnever evaluated
FALSEevaluated 843 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
orient == Qt::Horizontal)
(orient == Qt::Horizontal)Description
TRUEnever evaluated
FALSEevaluated 843 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
? model->rowCount(source_parent) : model->columnCount(source_parent);
0-843
700-
701 orthogonal_source_to_proxy.resize(ortho_end);-
702-
703 for (int ortho_item = 0; ortho_item < ortho_end
ortho_item < ortho_endDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_ModelTest
  • tst_QSortFilterProxyModel
FALSEevaluated 843 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
; ++ortho_item) {
12-843
704 if ((
(orient == Qt::Horizontal)Description
TRUEnever evaluated
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_ModelTest
  • tst_QSortFilterProxyModel
(orient == Qt:...source_parent)Description
TRUEevaluated 11 times by 2 tests
Evaluated by:
  • tst_ModelTest
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
(orient == Qt::Horizontal)Description
TRUEnever evaluated
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_ModelTest
  • tst_QSortFilterProxyModel
orient == Qt::Horizontal)
(orient == Qt:...source_parent)Description
TRUEevaluated 11 times by 2 tests
Evaluated by:
  • tst_ModelTest
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
(orient == Qt::Horizontal)Description
TRUEnever evaluated
FALSEevaluated 12 times by 2 tests
Evaluated by:
  • tst_ModelTest
  • tst_QSortFilterProxyModel
? q->filterAcceptsRow(ortho_item, source_parent)
(orient == Qt:...source_parent)Description
TRUEevaluated 11 times by 2 tests
Evaluated by:
  • tst_ModelTest
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
0-12
705 : q->filterAcceptsColumn(ortho_item, source_parent)
(orient == Qt:...source_parent)Description
TRUEevaluated 11 times by 2 tests
Evaluated by:
  • tst_ModelTest
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
) {
1-11
706 orthogonal_proxy_to_source.append(ortho_item);-
707 }
executed 11 times by 2 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QSortFilterProxyModel
11
708 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QSortFilterProxyModel
12
709 if (orient == Qt::Horizontal
orient == Qt::HorizontalDescription
TRUEnever evaluated
FALSEevaluated 843 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
) {
0-843
710-
711 sort_source_rows(orthogonal_proxy_to_source, source_parent);-
712 }
never executed: end of block
0
713 build_source_to_proxy_mapping(orthogonal_proxy_to_source, orthogonal_source_to_proxy);-
714 }
executed 843 times by 3 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
843
715 }
executed 1766 times by 5 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
1766
716-
717-
718 if (orient == Qt::Vertical
orient == Qt::VerticalDescription
TRUEevaluated 1132 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 1143 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
1132-1143
719 sort_source_rows(source_items, source_parent);
executed 1132 times by 7 tests: sort_source_rows(source_items, source_parent);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
1132
720 insert_source_items(source_to_proxy, proxy_to_source, source_items, source_parent, orient);-
721}
executed 2275 times by 7 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
2275
722-
723-
724-
725-
726-
727-
728-
729void QSortFilterProxyModelPrivate::source_items_about_to_be_removed(-
730 const QModelIndex &source_parent, int start, int end, Qt::Orientation orient)-
731{-
732 if ((
(start < 0)Description
TRUEnever evaluated
FALSEevaluated 82 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
start < 0)
(start < 0)Description
TRUEnever evaluated
FALSEevaluated 82 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
|| (
(end < 0)Description
TRUEnever evaluated
FALSEevaluated 82 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
end < 0)
(end < 0)Description
TRUEnever evaluated
FALSEevaluated 82 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
0-82
733 return;
never executed: return;
0
734 IndexMap::const_iterator it = source_index_mapping.constFind(source_parent);-
735 if (it == source_index_mapping.constEnd()
it == source_i...ing.constEnd()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 80 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
) {
2-80
736-
737 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_QSortFilterProxyModel
2
738 }-
739-
740 Mapping *m = it.value();-
741 QVector<int> &source_to_proxy = (
(orient == Qt::Vertical)Description
TRUEevaluated 45 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 35 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
orient == Qt::Vertical)
(orient == Qt::Vertical)Description
TRUEevaluated 45 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 35 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
? m->proxy_rows : m->proxy_columns;
35-45
742 QVector<int> &proxy_to_source = (
(orient == Qt::Vertical)Description
TRUEevaluated 45 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 35 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
orient == Qt::Vertical)
(orient == Qt::Vertical)Description
TRUEevaluated 45 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 35 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
? m->source_rows : m->source_columns;
35-45
743-
744-
745 QVector<int> source_items_to_remove;-
746 int proxy_count = proxy_to_source.size();-
747 for (int proxy_item = 0; proxy_item < proxy_count
proxy_item < proxy_countDescription
TRUEevaluated 2066 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 80 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
; ++proxy_item) {
80-2066
748 int source_item = proxy_to_source.at(proxy_item);-
749 if ((
(source_item >= start)Description
TRUEevaluated 1455 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 611 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
source_item >= start)
(source_item >= start)Description
TRUEevaluated 1455 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 611 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
&& (
(source_item <= end)Description
TRUEevaluated 517 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 938 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
source_item <= end)
(source_item <= end)Description
TRUEevaluated 517 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 938 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
517-1455
750 source_items_to_remove.append(source_item);
executed 517 times by 4 tests: source_items_to_remove.append(source_item);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
517
751 }
executed 2066 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
2066
752-
753 remove_source_items(source_to_proxy, proxy_to_source, source_items_to_remove,-
754 source_parent, orient);-
755}
executed 80 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
80
756-
757-
758-
759-
760-
761-
762void QSortFilterProxyModelPrivate::source_items_removed(-
763 const QModelIndex &source_parent, int start, int end, Qt::Orientation orient)-
764{-
765 if ((
(start < 0)Description
TRUEnever evaluated
FALSEevaluated 82 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
start < 0)
(start < 0)Description
TRUEnever evaluated
FALSEevaluated 82 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
|| (
(end < 0)Description
TRUEnever evaluated
FALSEevaluated 82 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
end < 0)
(end < 0)Description
TRUEnever evaluated
FALSEevaluated 82 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
0-82
766 return;
never executed: return;
0
767 IndexMap::const_iterator it = source_index_mapping.constFind(source_parent);-
768 if (it == source_index_mapping.constEnd()
it == source_i...ing.constEnd()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 80 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
) {
2-80
769-
770 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_QSortFilterProxyModel
2
771 }-
772-
773 Mapping *m = it.value();-
774 QVector<int> &source_to_proxy = (
(orient == Qt::Vertical)Description
TRUEevaluated 45 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 35 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
orient == Qt::Vertical)
(orient == Qt::Vertical)Description
TRUEevaluated 45 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 35 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
? m->proxy_rows : m->proxy_columns;
35-45
775 QVector<int> &proxy_to_source = (
(orient == Qt::Vertical)Description
TRUEevaluated 45 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 35 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
orient == Qt::Vertical)
(orient == Qt::Vertical)Description
TRUEevaluated 45 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 35 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
? m->source_rows : m->source_columns;
35-45
776-
777 if (end >= source_to_proxy.size()
end >= source_to_proxy.size()Description
TRUEnever evaluated
FALSEevaluated 80 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
0-80
778 end = source_to_proxy.size() - 1;
never executed: end = source_to_proxy.size() - 1;
0
779-
780-
781 int delta_item_count = end - start + 1;-
782 source_to_proxy.remove(start, delta_item_count);-
783-
784 int proxy_count = proxy_to_source.size();-
785 if (proxy_count > source_to_proxy.size()
proxy_count > ...o_proxy.size()Description
TRUEnever evaluated
FALSEevaluated 80 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
) {
0-80
786-
787 QMessageLogger(__FILE__, 899, __PRETTY_FUNCTION__).warning("QSortFilterProxyModel: inconsistent changes reported by source model");-
788 QSortFilterProxyModel * const q = q_func();-
789 q->beginResetModel();-
790 remove_from_mapping(source_parent);-
791 q->endResetModel();-
792 return;
never executed: return;
0
793 }-
794-
795-
796 for (int proxy_item = 0; proxy_item < proxy_count
proxy_item < proxy_countDescription
TRUEevaluated 1549 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 80 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
; ++proxy_item) {
80-1549
797 int source_item = proxy_to_source.at(proxy_item);-
798 if (source_item >= start
source_item >= startDescription
TRUEevaluated 938 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 611 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
) {
611-938
799 ((!(source_item - delta_item_count >= 0)) ? qt_assert("source_item - delta_item_count >= 0",__FILE__,911) : qt_noop());-
800 proxy_to_source.replace(proxy_item, source_item - delta_item_count);-
801 }
executed 938 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
938
802 }
executed 1549 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
1549
803 build_source_to_proxy_mapping(proxy_to_source, source_to_proxy);-
804-
805 updateChildrenMapping(source_parent, m, orient, start, end, delta_item_count, true);-
806-
807}
executed 80 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
80
808-
809-
810-
811-
812-
813-
814void QSortFilterProxyModelPrivate::updateChildrenMapping(const QModelIndex &source_parent, Mapping *parent_mapping,-
815 Qt::Orientation orient, int start, int end, int delta_item_count, bool remove)-
816{-
817-
818 QVector<QPair<QModelIndex, Mapping*> > moved_source_index_mappings;-
819 QVector<QModelIndex>::iterator it2 = parent_mapping->mapped_children.begin();-
820 for ( ; it2 != parent_mapping->mapped_children.end()
it2 != parent_...children.end()Description
TRUEevaluated 330 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 2355 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
;) {
330-2355
821 const QModelIndex source_child_index = *it2;-
822 const int pos = (
(orient == Qt::Vertical)Description
TRUEevaluated 179 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 151 times by 2 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
orient == Qt::Vertical)
(orient == Qt::Vertical)Description
TRUEevaluated 179 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 151 times by 2 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
151-179
823 ? source_child_index.row()-
824 : source_child_index.column();-
825 if (pos < start
pos < startDescription
TRUEevaluated 80 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 250 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
) {
80-250
826-
827 ++it2;-
828 }
executed 80 times by 3 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
else if (remove
removeDescription
TRUEevaluated 30 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 220 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
&& pos <= end
pos <= endDescription
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_QItemModel
) {
14-220
829-
830 it2 = parent_mapping->mapped_children.erase(it2);-
831 remove_from_mapping(source_child_index);-
832 }
executed 14 times by 2 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
else {
14
833-
834 QModelIndex new_index;-
835 const int newpos = remove
removeDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 220 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
? pos - delta_item_count : pos + delta_item_count;
16-220
836 if (orient == Qt::Vertical
orient == Qt::VerticalDescription
TRUEevaluated 121 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 115 times by 1 test
Evaluated by:
  • tst_QItemModel
) {
115-121
837 new_index = model->index(newpos,-
838 source_child_index.column(),-
839 source_parent);-
840 }
executed 121 times by 2 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
else {
121
841 new_index = model->index(source_child_index.row(),-
842 newpos,-
843 source_parent);-
844 }
executed 115 times by 1 test: end of block
Executed by:
  • tst_QItemModel
115
845 *it2 = new_index;-
846 ++it2;-
847-
848-
849 Mapping *cm = source_index_mapping.take(source_child_index);-
850 ((!(cm)) ? qt_assert("cm",__FILE__,962) : qt_noop());-
851-
852 moved_source_index_mappings.append(QPair<QModelIndex, Mapping*>(new_index, cm));-
853 }
executed 236 times by 2 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
236
854 }-
855-
856-
857 QVector<QPair<QModelIndex, Mapping*> >::iterator it = moved_source_index_mappings.begin();-
858 for (; it != moved_source_index_mappings.end()
it != moved_so...mappings.end()Description
TRUEevaluated 236 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 2355 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
; ++it) {
236-2355
859-
860-
861-
862-
863 (*it).second->map_iter = source_index_mapping.insert((*it).first, (*it).second);-
864-
865 }
executed 236 times by 2 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
236
866}
executed 2355 times by 7 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
2355
867-
868-
869-
870-
871void QSortFilterProxyModelPrivate::proxy_item_range(-
872 const QVector<int> &source_to_proxy, const QVector<int> &source_items,-
873 int &proxy_low, int &proxy_high) const-
874{-
875 proxy_low = 2147483647;-
876 proxy_high = (-2147483647 - 1);-
877 for (int i = 0; i < source_items.count()
i < source_items.count()Description
TRUEevaluated 6552 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
FALSEevaluated 6552 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
; ++i) {
6552
878 int proxy_item = source_to_proxy.at(source_items.at(i));-
879 ((!(proxy_item != -1)) ? qt_assert("proxy_item != -1",__FILE__,991) : qt_noop());-
880 if (proxy_item < proxy_low
proxy_item < proxy_lowDescription
TRUEevaluated 6552 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
FALSEnever evaluated
)
0-6552
881 proxy_low = proxy_item;
executed 6552 times by 4 tests: proxy_low = proxy_item;
Executed by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
6552
882 if (proxy_item > proxy_high
proxy_item > proxy_highDescription
TRUEevaluated 6552 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
FALSEnever evaluated
)
0-6552
883 proxy_high = proxy_item;
executed 6552 times by 4 tests: proxy_high = proxy_item;
Executed by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
6552
884 }
executed 6552 times by 4 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
6552
885}
executed 6552 times by 4 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
6552
886-
887-
888-
889-
890void QSortFilterProxyModelPrivate::build_source_to_proxy_mapping(-
891 const QVector<int> &proxy_to_source, QVector<int> &source_to_proxy) const-
892{-
893 source_to_proxy.fill(-1);-
894 int proxy_count = proxy_to_source.size();-
895 for (int i = 0; i < proxy_count
i < proxy_countDescription
TRUEevaluated 111218 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 6389 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
; ++i)
6389-111218
896 source_to_proxy[proxy_to_source.at(i)] = i;
executed 111218 times by 13 tests: source_to_proxy[proxy_to_source.at(i)] = i;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
111218
897}
executed 6389 times by 13 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
6389
898-
899-
900-
901-
902-
903-
904-
905QModelIndexPairList QSortFilterProxyModelPrivate::store_persistent_indexes() const-
906{-
907 const QSortFilterProxyModel * const q = q_func();-
908 QModelIndexPairList source_indexes;-
909 source_indexes.reserve(persistent.indexes.count());-
910 for (QPersistentModelIndexData *data : qAsConst(persistent.indexes)) {-
911 QModelIndex proxy_index = data->index;-
912 QModelIndex source_index = q->mapToSource(proxy_index);-
913 source_indexes.append(qMakePair(proxy_index, QPersistentModelIndex(source_index)));-
914 }
executed 402 times by 10 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
402
915 return
executed 1118 times by 13 tests: return source_indexes;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
source_indexes;
executed 1118 times by 13 tests: return source_indexes;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
1118
916}-
917-
918-
919-
920-
921-
922-
923-
924void QSortFilterProxyModelPrivate::update_persistent_indexes(-
925 const QModelIndexPairList &source_indexes)-
926{-
927 QSortFilterProxyModel * const q = q_func();-
928 QModelIndexList from, to;-
929 const int numSourceIndexes = source_indexes.count();-
930 from.reserve(numSourceIndexes);-
931 to.reserve(numSourceIndexes);-
932 for (int i = 0; i < numSourceIndexes
i < numSourceIndexesDescription
TRUEevaluated 402 times by 10 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 1123 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
; ++i) {
402-1123
933 QModelIndex source_index = source_indexes.at(i).second;-
934 QModelIndex old_proxy_index = source_indexes.at(i).first;-
935 create_mapping(source_index.parent());-
936 QModelIndex proxy_index = q->mapFromSource(source_index);-
937 from << old_proxy_index;-
938 to << proxy_index;-
939 }
executed 402 times by 10 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
402
940 q->changePersistentIndexList(from, to);-
941}
executed 1123 times by 13 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
1123
942-
943-
944-
945-
946-
947-
948-
949void QSortFilterProxyModelPrivate::filter_about_to_be_changed(const QModelIndex &source_parent)-
950{-
951 if (!filter_regexp.pattern().isEmpty()
!filter_regexp...rn().isEmpty()Description
TRUEevaluated 25 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 204 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
&&
25-204
952 source_index_mapping.constFind(source_parent) == source_index_mapping.constEnd()
source_index_m...ing.constEnd()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 24 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
)
1-24
953 create_mapping(source_parent);
executed 1 time by 1 test: create_mapping(source_parent);
Executed by:
  • tst_QSortFilterProxyModel
1
954}
executed 229 times by 5 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
229
955void QSortFilterProxyModelPrivate::filter_changed(const QModelIndex &source_parent)-
956{-
957 IndexMap::const_iterator it = source_index_mapping.constFind(source_parent);-
958 if (it == source_index_mapping.constEnd()
it == source_i...ing.constEnd()Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 393 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
)
14-393
959 return;
executed 14 times by 1 test: return;
Executed by:
  • tst_QSortFilterProxyModel
14
960 Mapping *m = it.value();-
961 QSet<int> rows_removed = handle_filter_changed(m->proxy_rows, m->source_rows, source_parent, Qt::Vertical);-
962 QSet<int> columns_removed = handle_filter_changed(m->proxy_columns, m->source_columns, source_parent, Qt::Horizontal);-
963-
964-
965-
966-
967-
968 const QVector<QModelIndex> mappedChildren = m->mapped_children;-
969 QVector<int> indexesToRemove;-
970 for (int i = 0; i < mappedChildren.size()
i < mappedChildren.size()Description
TRUEevaluated 178 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 393 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
; ++i) {
178-393
971 const QModelIndex source_child_index = mappedChildren.at(i);-
972 if (rows_removed.contains(source_child_index.row())
rows_removed.c...d_index.row())Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 175 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
|| columns_removed.contains(source_child_index.column())
columns_remove...ndex.column())Description
TRUEnever evaluated
FALSEevaluated 175 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
) {
0-175
973 indexesToRemove.push_back(i);-
974 remove_from_mapping(source_child_index);-
975 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
else {
3
976 filter_changed(source_child_index);-
977 }
executed 175 times by 3 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
175
978 }-
979 QVector<int>::const_iterator removeIt = indexesToRemove.constEnd();-
980 const QVector<int>::const_iterator removeBegin = indexesToRemove.constBegin();-
981-
982-
983-
984-
985-
986-
987 while (removeIt != removeBegin
removeIt != removeBeginDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 393 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
) {
3-393
988 --removeIt;-
989 m->mapped_children.remove(*removeIt);-
990 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
3
991}
executed 393 times by 5 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
393
992-
993-
994-
995-
996-
997QSet<int> QSortFilterProxyModelPrivate::handle_filter_changed(-
998 QVector<int> &source_to_proxy, QVector<int> &proxy_to_source,-
999 const QModelIndex &source_parent, Qt::Orientation orient)-
1000{-
1001 QSortFilterProxyModel * const q = q_func();-
1002-
1003 QVector<int> source_items_remove;-
1004 for (int i = 0; i < proxy_to_source.count()
i < proxy_to_source.count()Description
TRUEevaluated 21737 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 786 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
; ++i) {
786-21737
1005 const int source_item = proxy_to_source.at(i);-
1006 if ((
(orient == Qt::Vertical)Description
TRUEevaluated 15912 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 5825 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
orient == Qt::Vertical)
(orient == Qt::Vertical)Description
TRUEevaluated 15912 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 5825 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
(orient == Qt:...source_parent)Description
TRUEevaluated 86 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 21651 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
86-21651
1007 ? !q->filterAcceptsRow(source_item, source_parent)
(orient == Qt:...source_parent)Description
TRUEevaluated 86 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 21651 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
86-21651
1008 : !q->filterAcceptsColumn(source_item, source_parent)
(orient == Qt:...source_parent)Description
TRUEevaluated 86 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 21651 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
) {
86-21651
1009-
1010 source_items_remove.append(source_item);-
1011 }
executed 86 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
86
1012 }
executed 21737 times by 5 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
21737
1013-
1014 QVector<int> source_items_insert;-
1015 int source_count = source_to_proxy.size();-
1016 for (int source_item = 0; source_item < source_count
source_item < source_countDescription
TRUEevaluated 21795 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 786 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
; ++source_item) {
786-21795
1017 if (source_to_proxy.at(source_item) == -1
source_to_prox...ce_item) == -1Description
TRUEevaluated 58 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 21737 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
) {
58-21737
1018 if ((
(orient == Qt::Vertical)Description
TRUEevaluated 58 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEnever evaluated
(orient == Qt:...source_parent)Description
TRUEevaluated 42 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
(orient == Qt::Vertical)Description
TRUEevaluated 58 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEnever evaluated
orient == Qt::Vertical)
(orient == Qt:...source_parent)Description
TRUEevaluated 42 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
(orient == Qt::Vertical)Description
TRUEevaluated 58 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEnever evaluated
0-58
1019 ? q->filterAcceptsRow(source_item, source_parent)
(orient == Qt:...source_parent)Description
TRUEevaluated 42 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
16-42
1020 : q->filterAcceptsColumn(source_item, source_parent)
(orient == Qt:...source_parent)Description
TRUEevaluated 42 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 16 times by 2 tests
Evaluated by:
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
) {
16-42
1021-
1022 source_items_insert.append(source_item);-
1023 }
executed 42 times by 3 tests: end of block
Executed by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
42
1024 }
executed 58 times by 3 tests: end of block
Executed by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
58
1025 }
executed 21795 times by 5 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
21795
1026 if (!source_items_remove.isEmpty()
!source_items_remove.isEmpty()Description
TRUEevaluated 38 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 748 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
|| !source_items_insert.isEmpty()
!source_items_insert.isEmpty()Description
TRUEevaluated 13 times by 3 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEevaluated 735 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
) {
13-748
1027-
1028 remove_source_items(source_to_proxy, proxy_to_source,-
1029 source_items_remove, source_parent, orient);-
1030 if (orient == Qt::Vertical
orient == Qt::VerticalDescription
TRUEevaluated 51 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
FALSEnever evaluated
)
0-51
1031 sort_source_rows(source_items_insert, source_parent);
executed 51 times by 4 tests: sort_source_rows(source_items_insert, source_parent);
Executed by:
  • tst_ModelTest
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
51
1032 insert_source_items(source_to_proxy, proxy_to_source,-
1033 source_items_insert, source_parent, orient);-
1034 }
executed 51 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
51
1035 return
executed 786 times by 5 tests: return qVectorToSet(source_items_remove);
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
qVectorToSet(source_items_remove);
executed 786 times by 5 tests: return qVectorToSet(source_items_remove);
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
786
1036}-
1037-
1038void QSortFilterProxyModelPrivate::_q_sourceDataChanged(const QModelIndex &source_top_left,-
1039 const QModelIndex &source_bottom_right,-
1040 const QVector<int> &roles)-
1041{-
1042 QSortFilterProxyModel * const q = q_func();-
1043 if (!source_top_left.isValid()
!source_top_left.isValid()Description
TRUEnever evaluated
FALSEevaluated 6863 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
|| !source_bottom_right.isValid()
!source_bottom_right.isValid()Description
TRUEnever evaluated
FALSEevaluated 6863 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
)
0-6863
1044 return;
never executed: return;
0
1045 QModelIndex source_parent = source_top_left.parent();-
1046 IndexMap::const_iterator it = source_index_mapping.constFind(source_parent);-
1047 if (it == source_index_mapping.constEnd()
it == source_i...ing.constEnd()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 6857 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
) {
6-6857
1048-
1049 return;
executed 6 times by 1 test: return;
Executed by:
  • tst_QSortFilterProxyModel
6
1050 }-
1051 Mapping *m = it.value();-
1052-
1053-
1054 QVector<int> source_rows_remove;-
1055 QVector<int> source_rows_insert;-
1056 QVector<int> source_rows_change;-
1057 QVector<int> source_rows_resort;-
1058 int end = qMin(source_bottom_right.row(), m->proxy_rows.count() - 1);-
1059 for (int source_row = source_top_left.row(); source_row <= end
source_row <= endDescription
TRUEevaluated 6857 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
FALSEevaluated 6857 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
; ++source_row) {
6857
1060 if (dynamic_sortfilter
dynamic_sortfilterDescription
TRUEevaluated 6850 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
) {
7-6850
1061 if (m->proxy_rows.at(source_row) != -1
m->proxy_rows....rce_row) != -1Description
TRUEevaluated 6546 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
FALSEevaluated 304 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
) {
304-6546
1062 if (!q->filterAcceptsRow(source_row, source_parent)
!q->filterAcce...source_parent)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 6545 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
) {
1-6545
1063-
1064 source_rows_remove.append(source_row);-
1065 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
else if (source_sort_column >= source_top_left.column()
source_sort_co..._left.column()Description
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QSortFilterProxyModel
FALSEevaluated 6532 times by 3 tests
Evaluated by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
&& source_sort_column <= source_bottom_right.column()
source_sort_co...right.column()Description
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QSortFilterProxyModel
FALSEnever evaluated
) {
0-6532
1066-
1067 source_rows_resort.append(source_row);-
1068 }
executed 13 times by 2 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QSortFilterProxyModel
else {
13
1069-
1070 source_rows_change.append(source_row);-
1071 }
executed 6532 times by 3 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
6532
1072 } else {-
1073 if (!itemsBeingRemoved.contains(source_parent, source_row)
!itemsBeingRem...t, source_row)Description
TRUEevaluated 304 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
FALSEnever evaluated
&& q->filterAcceptsRow(source_row, source_parent)
q->filterAccep...source_parent)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 301 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
) {
0-304
1074-
1075 source_rows_insert.append(source_row);-
1076 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
3
1077 }
executed 304 times by 2 tests: end of block
Executed by:
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
304
1078 } else {-
1079 if (m->proxy_rows.at(source_row) != -1
m->proxy_rows....rce_row) != -1Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEnever evaluated
)
0-7
1080 source_rows_change.append(source_row);
executed 7 times by 1 test: source_rows_change.append(source_row);
Executed by:
  • tst_QSortFilterProxyModel
7
1081 }
executed 7 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
7
1082 }-
1083-
1084 if (!source_rows_remove.isEmpty()
!source_rows_remove.isEmpty()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 6856 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
) {
1-6856
1085 remove_source_items(m->proxy_rows, m->source_rows,-
1086 source_rows_remove, source_parent, Qt::Vertical);-
1087 QSet<int> source_rows_remove_set = qVectorToSet(source_rows_remove);-
1088 QVector<QModelIndex>::iterator childIt = m->mapped_children.end();-
1089 while (childIt != m->mapped_children.begin()
childIt != m->...ildren.begin()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
) {
1
1090 --childIt;-
1091 const QModelIndex source_child_index = *childIt;-
1092 if (source_rows_remove_set.contains(source_child_index.row())
source_rows_re...d_index.row())Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEnever evaluated
) {
0-1
1093 childIt = m->mapped_children.erase(childIt);-
1094 remove_from_mapping(source_child_index);-
1095 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
1
1096 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
1
1097 }
executed 1 time by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
1
1098-
1099 if (!source_rows_resort.isEmpty()
!source_rows_resort.isEmpty()Description
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QSortFilterProxyModel
FALSEevaluated 6844 times by 3 tests
Evaluated by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
) {
13-6844
1100-
1101 QList<QPersistentModelIndex> parents;-
1102 parents << q->mapFromSource(source_parent);-
1103 q->layoutAboutToBeChanged(parents, QAbstractItemModel::VerticalSortHint);-
1104 QModelIndexPairList source_indexes = store_persistent_indexes();-
1105 remove_source_items(m->proxy_rows, m->source_rows, source_rows_resort,-
1106 source_parent, Qt::Vertical, false);-
1107 sort_source_rows(source_rows_resort, source_parent);-
1108 insert_source_items(m->proxy_rows, m->source_rows, source_rows_resort,-
1109 source_parent, Qt::Vertical, false);-
1110 update_persistent_indexes(source_indexes);-
1111 q->layoutChanged(parents, QAbstractItemModel::VerticalSortHint);-
1112-
1113 source_rows_change += source_rows_resort;-
1114 }
executed 13 times by 2 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QSortFilterProxyModel
13
1115-
1116 if (!source_rows_change.isEmpty()
!source_rows_change.isEmpty()Description
TRUEevaluated 6552 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
FALSEevaluated 305 times by 2 tests
Evaluated by:
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
) {
305-6552
1117-
1118 int proxy_start_row;-
1119 int proxy_end_row;-
1120 proxy_item_range(m->proxy_rows, source_rows_change,-
1121 proxy_start_row, proxy_end_row);-
1122-
1123 if (proxy_end_row >= 0
proxy_end_row >= 0Description
TRUEevaluated 6552 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
FALSEnever evaluated
) {
0-6552
1124-
1125 int source_left_column = source_top_left.column();-
1126 while (source_left_column < source_bottom_right.column()
source_left_co...right.column()Description
TRUEnever evaluated
FALSEevaluated 6552 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
0-6552
1127 && m->proxy_columns.at(source_left_column) == -1
m->proxy_colum..._column) == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1128 ++
never executed: ++source_left_column;
source_left_column;
never executed: ++source_left_column;
0
1129 const QModelIndex proxy_top_left = create_index(-
1130 proxy_start_row, m->proxy_columns.at(source_left_column), it);-
1131 int source_right_column = source_bottom_right.column();-
1132 while (source_right_column > source_top_left.column()
source_right_c..._left.column()Description
TRUEnever evaluated
FALSEevaluated 6552 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
0-6552
1133 && m->proxy_columns.at(source_right_column) == -1
m->proxy_colum..._column) == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1134 --
never executed: --source_right_column;
source_right_column;
never executed: --source_right_column;
0
1135 const QModelIndex proxy_bottom_right = create_index(-
1136 proxy_end_row, m->proxy_columns.at(source_right_column), it);-
1137 q->dataChanged(proxy_top_left, proxy_bottom_right, roles);-
1138 }
executed 6552 times by 4 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
6552
1139 }
executed 6552 times by 4 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
6552
1140-
1141 if (!source_rows_insert.isEmpty()
!source_rows_insert.isEmpty()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 6854 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
) {
3-6854
1142 sort_source_rows(source_rows_insert, source_parent);-
1143 insert_source_items(m->proxy_rows, m->source_rows,-
1144 source_rows_insert, source_parent, Qt::Vertical);-
1145 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
3
1146}
executed 6857 times by 4 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
6857
1147-
1148void QSortFilterProxyModelPrivate::_q_sourceHeaderDataChanged(Qt::Orientation orientation,-
1149 int start, int end)-
1150{-
1151 ((!(start <= end)) ? qt_assert("start <= end",__FILE__,1271) : qt_noop());-
1152-
1153 QSortFilterProxyModel * const q = q_func();-
1154 Mapping *m = create_mapping(QModelIndex()).value();-
1155-
1156 const QVector<int> &source_to_proxy = (
(orientation == Qt::Vertical)Description
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 120 times by 3 tests
Evaluated by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
orientation == Qt::Vertical)
(orientation == Qt::Vertical)Description
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 120 times by 3 tests
Evaluated by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
? m->proxy_rows : m->proxy_columns;
9-120
1157-
1158 QVector<int> proxy_positions;-
1159 proxy_positions.reserve(end - start + 1);-
1160 {-
1161 ((!(source_to_proxy.size() > end)) ? qt_assert("source_to_proxy.size() > end",__FILE__,1281) : qt_noop());-
1162 QVector<int>::const_iterator it = source_to_proxy.constBegin() + start;-
1163 const QVector<int>::const_iterator endIt = source_to_proxy.constBegin() + end + 1;-
1164 for ( ; it != endIt
it != endItDescription
TRUEevaluated 138 times by 3 tests
Evaluated by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
FALSEevaluated 129 times by 3 tests
Evaluated by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
; ++it) {
129-138
1165 if (*
*it != -1Description
TRUEevaluated 122 times by 3 tests
Evaluated by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
it != -1
*it != -1Description
TRUEevaluated 122 times by 3 tests
Evaluated by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
)
16-122
1166 proxy_positions.push_back(*it);
executed 122 times by 3 tests: proxy_positions.push_back(*it);
Executed by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
122
1167 }
executed 138 times by 3 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
138
1168 }-
1169-
1170 std::sort(proxy_positions.begin(), proxy_positions.end());-
1171-
1172 int last_index = 0;-
1173 const int numItems = proxy_positions.size();-
1174 while (last_index < numItems
last_index < numItemsDescription
TRUEevaluated 113 times by 3 tests
Evaluated by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
FALSEevaluated 129 times by 3 tests
Evaluated by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
) {
113-129
1175 const int proxyStart = proxy_positions.at(last_index);-
1176 int proxyEnd = proxyStart;-
1177 ++last_index;-
1178 for (int i = last_index; i < numItems
i < numItemsDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 113 times by 3 tests
Evaluated by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
; ++i) {
9-113
1179 if (proxy_positions.at(i) == proxyEnd + 1
proxy_position...= proxyEnd + 1Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEnever evaluated
) {
0-9
1180 ++last_index;-
1181 ++proxyEnd;-
1182 }
executed 9 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
else {
9
1183 break;
never executed: break;
0
1184 }-
1185 }-
1186 q->headerDataChanged(orientation, proxyStart, proxyEnd);-
1187 }
executed 113 times by 3 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
113
1188}
executed 129 times by 3 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
129
1189-
1190void QSortFilterProxyModelPrivate::_q_sourceAboutToBeReset()-
1191{-
1192 QSortFilterProxyModel * const q = q_func();-
1193 q->beginResetModel();-
1194}
executed 126 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
126
1195-
1196void QSortFilterProxyModelPrivate::_q_sourceReset()-
1197{-
1198 QSortFilterProxyModel * const q = q_func();-
1199 invalidatePersistentIndexes();-
1200 _q_clearMapping();-
1201-
1202 q->endResetModel();-
1203 update_source_sort_column();-
1204 if (dynamic_sortfilter
dynamic_sortfilterDescription
TRUEevaluated 126 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEnever evaluated
)
0-126
1205 sort();
executed 126 times by 4 tests: sort();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
126
1206}
executed 126 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
126
1207-
1208void QSortFilterProxyModelPrivate::_q_sourceLayoutAboutToBeChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint)-
1209{-
1210 QSortFilterProxyModel * const q = q_func();-
1211 (void)hint;;-
1212 saved_persistent_indexes.clear();-
1213-
1214 QList<QPersistentModelIndex> parents;-
1215 for (const QPersistentModelIndex &parent : sourceParents) {-
1216 if (!parent.isValid()
!parent.isValid()Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QSortFilterProxyModel
  • tst_QTreeView
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
) {
4-5
1217 parents << QPersistentModelIndex();-
1218 continue;
executed 4 times by 2 tests: continue;
Executed by:
  • tst_QSortFilterProxyModel
  • tst_QTreeView
4
1219 }-
1220 const QModelIndex mappedParent = q->mapFromSource(parent);-
1221-
1222 if (mappedParent.isValid()
mappedParent.isValid()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
)
2-3
1223 parents << mappedParent;
executed 2 times by 1 test: parents << mappedParent;
Executed by:
  • tst_QSortFilterProxyModel
2
1224 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
5
1225-
1226-
1227 if (!sourceParents.isEmpty()
!sourceParents.isEmpty()Description
TRUEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QSortFilterProxyModel
  • tst_QTreeView
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
&& parents.isEmpty()
parents.isEmpty()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QSortFilterProxyModel
  • tst_QTreeView
)
1-7
1228 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_QSortFilterProxyModel
1
1229-
1230 q->layoutAboutToBeChanged(parents);-
1231 if (persistent.indexes.isEmpty()
persistent.indexes.isEmpty()Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QSortFilterProxyModel
  • tst_QTreeView
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
)
4-6
1232 return;
executed 4 times by 2 tests: return;
Executed by:
  • tst_QSortFilterProxyModel
  • tst_QTreeView
4
1233-
1234 saved_persistent_indexes = store_persistent_indexes();-
1235}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
6
1236-
1237void QSortFilterProxyModelPrivate::_q_sourceLayoutChanged(const QList<QPersistentModelIndex> &sourceParents, QAbstractItemModel::LayoutChangeHint hint)-
1238{-
1239 QSortFilterProxyModel * const q = q_func();-
1240 (void)hint;;-
1241-
1242-
1243-
1244 qDeleteAll(source_index_mapping);-
1245 source_index_mapping.clear();-
1246-
1247 update_persistent_indexes(saved_persistent_indexes);-
1248 saved_persistent_indexes.clear();-
1249-
1250 if (dynamic_sortfilter
dynamic_sortfilterDescription
TRUEevaluated 11 times by 3 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
  • tst_QTreeView
FALSEnever evaluated
&& update_source_sort_column()
update_source_sort_column()Description
TRUEnever evaluated
FALSEevaluated 11 times by 3 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
  • tst_QTreeView
) {
0-11
1251-
1252 qDeleteAll(source_index_mapping);-
1253 source_index_mapping.clear();-
1254 }
never executed: end of block
0
1255-
1256 QList<QPersistentModelIndex> parents;-
1257 for (const QPersistentModelIndex &parent : sourceParents) {-
1258 if (!parent.isValid()
!parent.isValid()Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QSortFilterProxyModel
  • tst_QTreeView
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
) {
4-5
1259 parents << QPersistentModelIndex();-
1260 continue;
executed 4 times by 2 tests: continue;
Executed by:
  • tst_QSortFilterProxyModel
  • tst_QTreeView
4
1261 }-
1262 const QModelIndex mappedParent = q->mapFromSource(parent);-
1263 if (mappedParent.isValid()
mappedParent.isValid()Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
)
2-3
1264 parents << mappedParent;
executed 2 times by 1 test: parents << mappedParent;
Executed by:
  • tst_QSortFilterProxyModel
2
1265 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
5
1266-
1267 if (!sourceParents.isEmpty()
!sourceParents.isEmpty()Description
TRUEevaluated 7 times by 2 tests
Evaluated by:
  • tst_QSortFilterProxyModel
  • tst_QTreeView
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
&& parents.isEmpty()
parents.isEmpty()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_QSortFilterProxyModel
  • tst_QTreeView
)
1-7
1268 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_QSortFilterProxyModel
1
1269-
1270 q->layoutChanged(parents);-
1271}
executed 10 times by 3 tests: end of block
Executed by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
  • tst_QTreeView
10
1272-
1273void QSortFilterProxyModelPrivate::_q_sourceRowsAboutToBeInserted(-
1274 const QModelIndex &source_parent, int start, int end)-
1275{-
1276 (void)start;;-
1277 (void)end;;-
1278-
1279-
1280 if (can_create_mapping(source_parent)
can_create_map...source_parent)Description
TRUEevaluated 1132 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
FALSEevaluated 2 times by 2 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
)
2-1132
1281 create_mapping(source_parent);
executed 1132 times by 7 tests: create_mapping(source_parent);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
1132
1282}
executed 1134 times by 7 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
1134
1283-
1284void QSortFilterProxyModelPrivate::_q_sourceRowsInserted(-
1285 const QModelIndex &source_parent, int start, int end)-
1286{-
1287 source_items_inserted(source_parent, start, end, Qt::Vertical);-
1288 if (update_source_sort_column()
update_source_sort_column()Description
TRUEnever evaluated
FALSEevaluated 1134 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
&& dynamic_sortfilter
dynamic_sortfilterDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-1134
1289 sort();
never executed: sort();
0
1290}
executed 1134 times by 7 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
1134
1291-
1292void QSortFilterProxyModelPrivate::_q_sourceRowsAboutToBeRemoved(-
1293 const QModelIndex &source_parent, int start, int end)-
1294{-
1295 itemsBeingRemoved = QRowsRemoval(source_parent, start, end);-
1296 source_items_about_to_be_removed(source_parent, start, end,-
1297 Qt::Vertical);-
1298}
executed 47 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
47
1299-
1300void QSortFilterProxyModelPrivate::_q_sourceRowsRemoved(-
1301 const QModelIndex &source_parent, int start, int end)-
1302{-
1303 itemsBeingRemoved = QRowsRemoval();-
1304 source_items_removed(source_parent, start, end, Qt::Vertical);-
1305}
executed 47 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
47
1306-
1307void QSortFilterProxyModelPrivate::_q_sourceRowsAboutToBeMoved(-
1308 const QModelIndex &sourceParent, int , int , const QModelIndex &destParent, int )-
1309{-
1310 QSortFilterProxyModel * const q = q_func();-
1311-
1312-
1313-
1314-
1315-
1316-
1317 saved_persistent_indexes.clear();-
1318-
1319 QList<QPersistentModelIndex> parents;-
1320 parents << q->mapFromSource(sourceParent);-
1321 if (sourceParent != destParent
sourceParent != destParentDescription
TRUEevaluated 4 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QSortFilterProxyModel
FALSEnever evaluated
)
0-4
1322 parents << q->mapFromSource(destParent);
executed 4 times by 3 tests: parents << q->mapFromSource(destParent);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QSortFilterProxyModel
4
1323 q->layoutAboutToBeChanged(parents);-
1324 if (persistent.indexes.isEmpty()
persistent.indexes.isEmpty()Description
TRUEnever evaluated
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QSortFilterProxyModel
)
0-4
1325 return;
never executed: return;
0
1326 saved_persistent_indexes = store_persistent_indexes();-
1327}
executed 4 times by 3 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QSortFilterProxyModel
4
1328-
1329void QSortFilterProxyModelPrivate::_q_sourceRowsMoved(-
1330 const QModelIndex &sourceParent, int , int , const QModelIndex &destParent, int )-
1331{-
1332 QSortFilterProxyModel * const q = q_func();-
1333-
1334-
1335-
1336 qDeleteAll(source_index_mapping);-
1337 source_index_mapping.clear();-
1338-
1339 update_persistent_indexes(saved_persistent_indexes);-
1340 saved_persistent_indexes.clear();-
1341-
1342 if (dynamic_sortfilter
dynamic_sortfilterDescription
TRUEevaluated 4 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QSortFilterProxyModel
FALSEnever evaluated
&& update_source_sort_column()
update_source_sort_column()Description
TRUEnever evaluated
FALSEevaluated 4 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QSortFilterProxyModel
) {
0-4
1343-
1344 qDeleteAll(source_index_mapping);-
1345 source_index_mapping.clear();-
1346 }
never executed: end of block
0
1347-
1348 QList<QPersistentModelIndex> parents;-
1349 parents << q->mapFromSource(sourceParent);-
1350 if (sourceParent != destParent
sourceParent != destParentDescription
TRUEevaluated 4 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QSortFilterProxyModel
FALSEnever evaluated
)
0-4
1351 parents << q->mapFromSource(destParent);
executed 4 times by 3 tests: parents << q->mapFromSource(destParent);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QSortFilterProxyModel
4
1352 q->layoutChanged(parents);-
1353}
executed 4 times by 3 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QSortFilterProxyModel
4
1354-
1355void QSortFilterProxyModelPrivate::_q_sourceColumnsAboutToBeInserted(-
1356 const QModelIndex &source_parent, int start, int end)-
1357{-
1358 (void)start;;-
1359 (void)end;;-
1360-
1361-
1362 if (can_create_mapping(source_parent)
can_create_map...source_parent)Description
TRUEevaluated 1143 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
)
1-1143
1363 create_mapping(source_parent);
executed 1143 times by 4 tests: create_mapping(source_parent);
Executed by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
1143
1364}
executed 1144 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
1144
1365-
1366void QSortFilterProxyModelPrivate::_q_sourceColumnsInserted(-
1367 const QModelIndex &source_parent, int start, int end)-
1368{-
1369 const QSortFilterProxyModel * const q = q_func();-
1370 source_items_inserted(source_parent, start, end, Qt::Horizontal);-
1371-
1372 if (source_parent.isValid()
source_parent.isValid()Description
TRUEevaluated 826 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 318 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
318-826
1373 return;
executed 826 times by 3 tests: return;
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
826
1374 if (source_sort_column == -1
source_sort_column == -1Description
TRUEevaluated 315 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
) {
3-315
1375-
1376 if (update_source_sort_column()
update_source_sort_column()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 314 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
&& dynamic_sortfilter
dynamic_sortfilterDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEnever evaluated
)
0-314
1377 sort();
executed 1 time by 1 test: sort();
Executed by:
  • tst_QSortFilterProxyModel
1
1378 }
executed 315 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
else {
315
1379 if (start <= source_sort_column
start <= source_sort_columnDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
)
1-2
1380 source_sort_column += end - start + 1;
executed 1 time by 1 test: source_sort_column += end - start + 1;
Executed by:
  • tst_QSortFilterProxyModel
1
1381-
1382 proxy_sort_column = q->mapFromSource(model->index(0,source_sort_column, source_parent)).column();-
1383 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
3
1384}-
1385-
1386void QSortFilterProxyModelPrivate::_q_sourceColumnsAboutToBeRemoved(-
1387 const QModelIndex &source_parent, int start, int end)-
1388{-
1389 source_items_about_to_be_removed(source_parent, start, end,-
1390 Qt::Horizontal);-
1391}
executed 35 times by 3 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
35
1392-
1393void QSortFilterProxyModelPrivate::_q_sourceColumnsRemoved(-
1394 const QModelIndex &source_parent, int start, int end)-
1395{-
1396 const QSortFilterProxyModel * const q = q_func();-
1397 source_items_removed(source_parent, start, end, Qt::Horizontal);-
1398-
1399 if (source_parent.isValid()
source_parent.isValid()Description
TRUEevaluated 22 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 13 times by 2 tests
Evaluated by:
  • tst_ModelTest
  • tst_QSortFilterProxyModel
)
13-22
1400 return;
executed 22 times by 2 tests: return;
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
22
1401 if (start <= source_sort_column
start <= source_sort_columnDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 11 times by 2 tests
Evaluated by:
  • tst_ModelTest
  • tst_QSortFilterProxyModel
) {
2-11
1402 if (end < source_sort_column
end < source_sort_columnDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
)
1
1403 source_sort_column -= end - start + 1;
executed 1 time by 1 test: source_sort_column -= end - start + 1;
Executed by:
  • tst_QSortFilterProxyModel
1
1404 else-
1405 source_sort_column = -1;
executed 1 time by 1 test: source_sort_column = -1;
Executed by:
  • tst_QSortFilterProxyModel
1
1406 }-
1407-
1408 proxy_sort_column = q->mapFromSource(model->index(0,source_sort_column, source_parent)).column();-
1409}
executed 13 times by 2 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QSortFilterProxyModel
13
1410-
1411void QSortFilterProxyModelPrivate::_q_sourceColumnsAboutToBeMoved(-
1412 const QModelIndex &sourceParent, int , int , const QModelIndex &destParent, int )-
1413{-
1414 QSortFilterProxyModel * const q = q_func();-
1415-
1416 saved_persistent_indexes.clear();-
1417-
1418 QList<QPersistentModelIndex> parents;-
1419 parents << q->mapFromSource(sourceParent);-
1420 if (sourceParent != destParent
sourceParent != destParentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1421 parents << q->mapFromSource(destParent);
never executed: parents << q->mapFromSource(destParent);
0
1422 q->layoutAboutToBeChanged(parents);-
1423-
1424 if (persistent.indexes.isEmpty()
persistent.indexes.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1425 return;
never executed: return;
0
1426 saved_persistent_indexes = store_persistent_indexes();-
1427}
never executed: end of block
0
1428-
1429void QSortFilterProxyModelPrivate::_q_sourceColumnsMoved(-
1430 const QModelIndex &sourceParent, int , int , const QModelIndex &destParent, int )-
1431{-
1432 QSortFilterProxyModel * const q = q_func();-
1433-
1434 qDeleteAll(source_index_mapping);-
1435 source_index_mapping.clear();-
1436-
1437 update_persistent_indexes(saved_persistent_indexes);-
1438 saved_persistent_indexes.clear();-
1439-
1440 if (dynamic_sortfilter
dynamic_sortfilterDescription
TRUEnever evaluated
FALSEnever evaluated
&& update_source_sort_column()
update_source_sort_column()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1441 qDeleteAll(source_index_mapping);-
1442 source_index_mapping.clear();-
1443 }
never executed: end of block
0
1444-
1445 QList<QPersistentModelIndex> parents;-
1446 parents << q->mapFromSource(sourceParent);-
1447 if (sourceParent != destParent
sourceParent != destParentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1448 parents << q->mapFromSource(destParent);
never executed: parents << q->mapFromSource(destParent);
0
1449 q->layoutChanged(parents);-
1450}
never executed: end of block
0
1451QSortFilterProxyModel::QSortFilterProxyModel(QObject *parent)-
1452 : QAbstractProxyModel(*new QSortFilterProxyModelPrivate, parent)-
1453{-
1454 QSortFilterProxyModelPrivate * const d = d_func();-
1455 d->proxy_sort_column = d->source_sort_column = -1;-
1456 d->sort_order = Qt::AscendingOrder;-
1457 d->sort_casesensitivity = Qt::CaseSensitive;-
1458 d->sort_role = Qt::DisplayRole;-
1459 d->sort_localeaware = false;-
1460 d->filter_column = 0;-
1461 d->filter_role = Qt::DisplayRole;-
1462 d->dynamic_sortfilter = true;-
1463 connect(this, qFlagLocation("2""modelReset()" "\0" __FILE__ ":" "1741"), this, qFlagLocation("1""_q_clearMapping()" "\0" __FILE__ ":" "1741"));-
1464}
executed 282 times by 13 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
282
1465-
1466-
1467-
1468-
1469QSortFilterProxyModel::~QSortFilterProxyModel()-
1470{-
1471 QSortFilterProxyModelPrivate * const d = d_func();-
1472 qDeleteAll(d->source_index_mapping);-
1473 d->source_index_mapping.clear();-
1474}
executed 278 times by 15 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
  • tst_modeltest - unknown status
  • tst_qabstractitemmodel - unknown status
  • tst_qsortfilterproxymodel - unknown status
278
1475-
1476-
1477-
1478-
1479void QSortFilterProxyModel::setSourceModel(QAbstractItemModel *sourceModel)-
1480{-
1481 QSortFilterProxyModelPrivate * const d = d_func();-
1482-
1483 beginResetModel();-
1484-
1485 disconnect(d->model, qFlagLocation("2""dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "1763"),-
1486 this, qFlagLocation("1""_q_sourceDataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "1764"));-
1487-
1488 disconnect(d->model, qFlagLocation("2""headerDataChanged(Qt::Orientation,int,int)" "\0" __FILE__ ":" "1766"),-
1489 this, qFlagLocation("1""_q_sourceHeaderDataChanged(Qt::Orientation,int,int)" "\0" __FILE__ ":" "1767"));-
1490-
1491 disconnect(d->model, qFlagLocation("2""rowsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1769"),-
1492 this, qFlagLocation("1""_q_sourceRowsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1770"));-
1493-
1494 disconnect(d->model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1772"),-
1495 this, qFlagLocation("1""_q_sourceRowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1773"));-
1496-
1497 disconnect(d->model, qFlagLocation("2""columnsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1775"),-
1498 this, qFlagLocation("1""_q_sourceColumnsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1776"));-
1499-
1500 disconnect(d->model, qFlagLocation("2""columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1778"),-
1501 this, qFlagLocation("1""_q_sourceColumnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1779"));-
1502-
1503 disconnect(d->model, qFlagLocation("2""rowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1781"),-
1504 this, qFlagLocation("1""_q_sourceRowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1782"));-
1505-
1506 disconnect(d->model, qFlagLocation("2""rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1784"),-
1507 this, qFlagLocation("1""_q_sourceRowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1785"));-
1508-
1509 disconnect(d->model, qFlagLocation("2""columnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1787"),-
1510 this, qFlagLocation("1""_q_sourceColumnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1788"));-
1511-
1512 disconnect(d->model, qFlagLocation("2""columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1790"),-
1513 this, qFlagLocation("1""_q_sourceColumnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1791"));-
1514-
1515 disconnect(d->model, qFlagLocation("2""rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1793"),-
1516 this, qFlagLocation("1""_q_sourceRowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1794"));-
1517-
1518 disconnect(d->model, qFlagLocation("2""rowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1796"),-
1519 this, qFlagLocation("1""_q_sourceRowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1797"));-
1520-
1521 disconnect(d->model, qFlagLocation("2""columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1799"),-
1522 this, qFlagLocation("1""_q_sourceColumnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1800"));-
1523-
1524 disconnect(d->model, qFlagLocation("2""columnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1802"),-
1525 this, qFlagLocation("1""_q_sourceColumnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1803"));-
1526-
1527 disconnect(d->model, qFlagLocation("2""layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "1805"),-
1528 this, qFlagLocation("1""_q_sourceLayoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "1806"));-
1529-
1530 disconnect(d->model, qFlagLocation("2""layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "1808"),-
1531 this, qFlagLocation("1""_q_sourceLayoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "1809"));-
1532-
1533 disconnect(d->model, qFlagLocation("2""modelAboutToBeReset()" "\0" __FILE__ ":" "1811"), this, qFlagLocation("1""_q_sourceAboutToBeReset()" "\0" __FILE__ ":" "1811"));-
1534 disconnect(d->model, qFlagLocation("2""modelReset()" "\0" __FILE__ ":" "1812"), this, qFlagLocation("1""_q_sourceReset()" "\0" __FILE__ ":" "1812"));-
1535-
1536 QAbstractProxyModel::setSourceModel(sourceModel);-
1537-
1538 connect(d->model, qFlagLocation("2""dataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "1816"),-
1539 this, qFlagLocation("1""_q_sourceDataChanged(QModelIndex,QModelIndex,QVector<int>)" "\0" __FILE__ ":" "1817"));-
1540-
1541 connect(d->model, qFlagLocation("2""headerDataChanged(Qt::Orientation,int,int)" "\0" __FILE__ ":" "1819"),-
1542 this, qFlagLocation("1""_q_sourceHeaderDataChanged(Qt::Orientation,int,int)" "\0" __FILE__ ":" "1820"));-
1543-
1544 connect(d->model, qFlagLocation("2""rowsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1822"),-
1545 this, qFlagLocation("1""_q_sourceRowsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1823"));-
1546-
1547 connect(d->model, qFlagLocation("2""rowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1825"),-
1548 this, qFlagLocation("1""_q_sourceRowsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1826"));-
1549-
1550 connect(d->model, qFlagLocation("2""columnsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1828"),-
1551 this, qFlagLocation("1""_q_sourceColumnsAboutToBeInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1829"));-
1552-
1553 connect(d->model, qFlagLocation("2""columnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1831"),-
1554 this, qFlagLocation("1""_q_sourceColumnsInserted(QModelIndex,int,int)" "\0" __FILE__ ":" "1832"));-
1555-
1556 connect(d->model, qFlagLocation("2""rowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1834"),-
1557 this, qFlagLocation("1""_q_sourceRowsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1835"));-
1558-
1559 connect(d->model, qFlagLocation("2""rowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1837"),-
1560 this, qFlagLocation("1""_q_sourceRowsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1838"));-
1561-
1562 connect(d->model, qFlagLocation("2""columnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1840"),-
1563 this, qFlagLocation("1""_q_sourceColumnsAboutToBeRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1841"));-
1564-
1565 connect(d->model, qFlagLocation("2""columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1843"),-
1566 this, qFlagLocation("1""_q_sourceColumnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1844"));-
1567-
1568 connect(d->model, qFlagLocation("2""rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1846"),-
1569 this, qFlagLocation("1""_q_sourceRowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1847"));-
1570-
1571 connect(d->model, qFlagLocation("2""rowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1849"),-
1572 this, qFlagLocation("1""_q_sourceRowsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1850"));-
1573-
1574 connect(d->model, qFlagLocation("2""columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1852"),-
1575 this, qFlagLocation("1""_q_sourceColumnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1853"));-
1576-
1577 connect(d->model, qFlagLocation("2""columnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1855"),-
1578 this, qFlagLocation("1""_q_sourceColumnsMoved(QModelIndex,int,int,QModelIndex,int)" "\0" __FILE__ ":" "1856"));-
1579-
1580 connect(d->model, qFlagLocation("2""layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "1858"),-
1581 this, qFlagLocation("1""_q_sourceLayoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "1859"));-
1582-
1583 connect(d->model, qFlagLocation("2""layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "1861"),-
1584 this, qFlagLocation("1""_q_sourceLayoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)" "\0" __FILE__ ":" "1862"));-
1585-
1586 connect(d->model, qFlagLocation("2""modelAboutToBeReset()" "\0" __FILE__ ":" "1864"), this, qFlagLocation("1""_q_sourceAboutToBeReset()" "\0" __FILE__ ":" "1864"));-
1587 connect(d->model, qFlagLocation("2""modelReset()" "\0" __FILE__ ":" "1865"), this, qFlagLocation("1""_q_sourceReset()" "\0" __FILE__ ":" "1865"));-
1588-
1589 d->_q_clearMapping();-
1590 endResetModel();-
1591 if (d->update_source_sort_column()
d->update_source_sort_column()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 287 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
&& d->dynamic_sortfilter
d->dynamic_sortfilterDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
)
0-287
1592 d->sort();
never executed: d->sort();
0
1593}
executed 288 times by 13 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
288
1594-
1595-
1596-
1597-
1598QModelIndex QSortFilterProxyModel::index(int row, int column, const QModelIndex &parent) const-
1599{-
1600 const QSortFilterProxyModelPrivate * const d = d_func();-
1601 if (row < 0
row < 0Description
TRUEevaluated 166 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 81018 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
|| column < 0
column < 0Description
TRUEevaluated 409 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 80609 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
)
166-81018
1602 return
executed 575 times by 3 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
QModelIndex();
executed 575 times by 3 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
575
1603-
1604 QModelIndex source_parent = mapToSource(parent);-
1605 IndexMap::const_iterator it = d->create_mapping(source_parent);-
1606 if (it.value()->source_rows.count() <= row
it.value()->so...count() <= rowDescription
TRUEevaluated 230 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
FALSEevaluated 80379 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
|| it.value()->source_columns.count() <= column
it.value()->so...nt() <= columnDescription
TRUEevaluated 60 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 80319 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
)
60-80379
1607 return
executed 290 times by 7 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
QModelIndex();
executed 290 times by 7 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
290
1608-
1609 return
executed 80319 times by 13 tests: return d->create_index(row, column, it);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
d->create_index(row, column, it);
executed 80319 times by 13 tests: return d->create_index(row, column, it);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
80319
1610}-
1611-
1612-
1613-
1614-
1615QModelIndex QSortFilterProxyModel::parent(const QModelIndex &child) const-
1616{-
1617 const QSortFilterProxyModelPrivate * const d = d_func();-
1618 if (!d->indexValid(child)
!d->indexValid(child)Description
TRUEevaluated 144 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 21087 times by 12 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
)
144-21087
1619 return
executed 144 times by 3 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
QModelIndex();
executed 144 times by 3 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
144
1620 IndexMap::const_iterator it = d->index_to_iterator(child);-
1621 ((!(it != d->source_index_mapping.constEnd())) ? qt_assert("it != d->source_index_mapping.constEnd()",__FILE__,1899) : qt_noop());-
1622 QModelIndex source_parent = it.key();-
1623 QModelIndex proxy_parent = mapFromSource(source_parent);-
1624 return
executed 21087 times by 12 tests: return proxy_parent;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
proxy_parent;
executed 21087 times by 12 tests: return proxy_parent;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
21087
1625}-
1626-
1627-
1628-
1629-
1630QModelIndex QSortFilterProxyModel::sibling(int row, int column, const QModelIndex &idx) const-
1631{-
1632 const QSortFilterProxyModelPrivate * const d = d_func();-
1633 if (!d->indexValid(idx)
!d->indexValid(idx)Description
TRUEevaluated 48 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 17009 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
)
48-17009
1634 return
executed 48 times by 3 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
QModelIndex();
executed 48 times by 3 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
48
1635-
1636 const IndexMap::const_iterator it = d->index_to_iterator(idx);-
1637 if (it.value()->source_rows.count() <= row
it.value()->so...count() <= rowDescription
TRUEnever evaluated
FALSEevaluated 17009 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
|| it.value()->source_columns.count() <= column
it.value()->so...nt() <= columnDescription
TRUEnever evaluated
FALSEevaluated 17009 times by 7 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
)
0-17009
1638 return
never executed: return QModelIndex();
QModelIndex();
never executed: return QModelIndex();
0
1639-
1640 return
executed 17009 times by 7 tests: return d->create_index(row, column, it);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
d->create_index(row, column, it);
executed 17009 times by 7 tests: return d->create_index(row, column, it);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
17009
1641}-
1642-
1643-
1644-
1645-
1646int QSortFilterProxyModel::rowCount(const QModelIndex &parent) const-
1647{-
1648 const QSortFilterProxyModelPrivate * const d = d_func();-
1649 QModelIndex source_parent = mapToSource(parent);-
1650 if (parent.isValid()
parent.isValid()Description
TRUEevaluated 6749 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 38782 times by 12 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
&& !source_parent.isValid()
!source_parent.isValid()Description
TRUEnever evaluated
FALSEevaluated 6749 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
0-38782
1651 return
never executed: return 0;
0;
never executed: return 0;
0
1652 IndexMap::const_iterator it = d->create_mapping(source_parent);-
1653 return
executed 45531 times by 12 tests: return it.value()->source_rows.count();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
it.value()->source_rows.count();
executed 45531 times by 12 tests: return it.value()->source_rows.count();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
45531
1654}-
1655-
1656-
1657-
1658-
1659int QSortFilterProxyModel::columnCount(const QModelIndex &parent) const-
1660{-
1661 const QSortFilterProxyModelPrivate * const d = d_func();-
1662 QModelIndex source_parent = mapToSource(parent);-
1663 if (parent.isValid()
parent.isValid()Description
TRUEevaluated 6465 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 4480 times by 12 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
&& !source_parent.isValid()
!source_parent.isValid()Description
TRUEnever evaluated
FALSEevaluated 6465 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
0-6465
1664 return
never executed: return 0;
0;
never executed: return 0;
0
1665 IndexMap::const_iterator it = d->create_mapping(source_parent);-
1666 return
executed 10945 times by 12 tests: return it.value()->source_columns.count();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
it.value()->source_columns.count();
executed 10945 times by 12 tests: return it.value()->source_columns.count();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
10945
1667}-
1668-
1669-
1670-
1671-
1672bool QSortFilterProxyModel::hasChildren(const QModelIndex &parent) const-
1673{-
1674 const QSortFilterProxyModelPrivate * const d = d_func();-
1675 QModelIndex source_parent = mapToSource(parent);-
1676 if (parent.isValid()
parent.isValid()Description
TRUEevaluated 8698 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
FALSEevaluated 327 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
&& !source_parent.isValid()
!source_parent.isValid()Description
TRUEnever evaluated
FALSEevaluated 8698 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
)
0-8698
1677 return
never executed: return false;
false;
never executed: return false;
0
1678 if (!d->model->hasChildren(source_parent)
!d->model->has...source_parent)Description
TRUEevaluated 8377 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
FALSEevaluated 648 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
)
648-8377
1679 return
executed 8377 times by 5 tests: return false;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
false;
executed 8377 times by 5 tests: return false;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
8377
1680-
1681 if (d->model->canFetchMore(source_parent)
d->model->canF...source_parent)Description
TRUEevaluated 47 times by 2 tests
Evaluated by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
FALSEevaluated 601 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
)
47-601
1682 return
executed 47 times by 2 tests: return true;
Executed by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
true;
executed 47 times by 2 tests: return true;
Executed by:
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
47
1683-
1684 QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value();-
1685 return
executed 601 times by 6 tests: return m->source_rows.count() != 0 && m->source_columns.count() != 0;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
m->source_rows.count() != 0 && m->source_columns.count() != 0;
executed 601 times by 6 tests: return m->source_rows.count() != 0 && m->source_columns.count() != 0;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
601
1686}-
1687-
1688-
1689-
1690-
1691QVariant QSortFilterProxyModel::data(const QModelIndex &index, int role) const-
1692{-
1693 const QSortFilterProxyModelPrivate * const d = d_func();-
1694 QModelIndex source_index = mapToSource(index);-
1695 if (index.isValid()
index.isValid()Description
TRUEevaluated 51873 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 12404 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
&& !source_index.isValid()
!source_index.isValid()Description
TRUEnever evaluated
FALSEevaluated 51873 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
)
0-51873
1696 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
1697 return
executed 64277 times by 9 tests: return d->model->data(source_index, role);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
d->model->data(source_index, role);
executed 64277 times by 9 tests: return d->model->data(source_index, role);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
64277
1698}-
1699-
1700-
1701-
1702-
1703bool QSortFilterProxyModel::setData(const QModelIndex &index, const QVariant &value, int role)-
1704{-
1705 QSortFilterProxyModelPrivate * const d = d_func();-
1706 QModelIndex source_index = mapToSource(index);-
1707 if (index.isValid()
index.isValid()Description
TRUEevaluated 6065 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 91 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
&& !source_index.isValid()
!source_index.isValid()Description
TRUEnever evaluated
FALSEevaluated 6065 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
0-6065
1708 return
never executed: return false;
false;
never executed: return false;
0
1709 return
executed 6156 times by 3 tests: return d->model->setData(source_index, value, role);
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
d->model->setData(source_index, value, role);
executed 6156 times by 3 tests: return d->model->setData(source_index, value, role);
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
6156
1710}-
1711-
1712-
1713-
1714-
1715QVariant QSortFilterProxyModel::headerData(int section, Qt::Orientation orientation, int role) const-
1716{-
1717 const QSortFilterProxyModelPrivate * const d = d_func();-
1718 IndexMap::const_iterator it = d->create_mapping(QModelIndex());-
1719 if (it.value()->source_rows.count() * it.value()->source_columns.count() > 0
it.value()->so...ns.count() > 0Description
TRUEevaluated 2273 times by 8 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 149 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
149-2273
1720 return
executed 2273 times by 8 tests: return QAbstractProxyModel::headerData(section, orientation, role);
Executed by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
QAbstractProxyModel::headerData(section, orientation, role);
executed 2273 times by 8 tests: return QAbstractProxyModel::headerData(section, orientation, role);
Executed by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
2273
1721 int source_section;-
1722 if (orientation == Qt::Vertical
orientation == Qt::VerticalDescription
TRUEnever evaluated
FALSEevaluated 149 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
) {
0-149
1723 if (section < 0
section < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| section >= it.value()->source_rows.count()
section >= it....e_rows.count()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1724 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
1725 source_section = it.value()->source_rows.at(section);-
1726 }
never executed: end of block
else {
0
1727 if (section < 0
section < 0Description
TRUEnever evaluated
FALSEevaluated 149 times by 4 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
|| section >= it.value()->source_columns.count()
section >= it....olumns.count()Description
TRUEevaluated 5 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 144 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
)
0-149
1728 return
executed 5 times by 3 tests: return QVariant();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
QVariant();
executed 5 times by 3 tests: return QVariant();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
5
1729 source_section = it.value()->source_columns.at(section);-
1730 }
executed 144 times by 3 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
144
1731 return
executed 144 times by 3 tests: return d->model->headerData(source_section, orientation, role);
Executed by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
d->model->headerData(source_section, orientation, role);
executed 144 times by 3 tests: return d->model->headerData(source_section, orientation, role);
Executed by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
144
1732}-
1733-
1734-
1735-
1736-
1737bool QSortFilterProxyModel::setHeaderData(int section, Qt::Orientation orientation,-
1738 const QVariant &value, int role)-
1739{-
1740 QSortFilterProxyModelPrivate * const d = d_func();-
1741 IndexMap::const_iterator it = d->create_mapping(QModelIndex());-
1742 if (it.value()->source_rows.count() * it.value()->source_columns.count() > 0
it.value()->so...ns.count() > 0Description
TRUEevaluated 102 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 19 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
19-102
1743 return
executed 102 times by 3 tests: return QAbstractProxyModel::setHeaderData(section, orientation, value, role);
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
QAbstractProxyModel::setHeaderData(section, orientation, value, role);
executed 102 times by 3 tests: return QAbstractProxyModel::setHeaderData(section, orientation, value, role);
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
102
1744 int source_section;-
1745 if (orientation == Qt::Vertical
orientation == Qt::VerticalDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 18 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
) {
1-18
1746 if (section < 0
section < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QItemModel
FALSEnever evaluated
|| section >= it.value()->source_rows.count()
section >= it....e_rows.count()Description
TRUEnever evaluated
FALSEnever evaluated
)
0-1
1747 return
executed 1 time by 1 test: return false;
Executed by:
  • tst_QItemModel
false;
executed 1 time by 1 test: return false;
Executed by:
  • tst_QItemModel
1
1748 source_section = it.value()->source_rows.at(section);-
1749 }
never executed: end of block
else {
0
1750 if (section < 0
section < 0Description
TRUEevaluated 9 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 9 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
|| section >= it.value()->source_columns.count()
section >= it....olumns.count()Description
TRUEevaluated 9 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEnever evaluated
)
0-9
1751 return
executed 18 times by 3 tests: return false;
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
false;
executed 18 times by 3 tests: return false;
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
18
1752 source_section = it.value()->source_columns.at(section);-
1753 }
never executed: end of block
0
1754 return
never executed: return d->model->setHeaderData(source_section, orientation, value, role);
d->model->setHeaderData(source_section, orientation, value, role);
never executed: return d->model->setHeaderData(source_section, orientation, value, role);
0
1755}-
1756-
1757-
1758-
1759-
1760QMimeData *QSortFilterProxyModel::mimeData(const QModelIndexList &indexes) const-
1761{-
1762 const QSortFilterProxyModelPrivate * const d = d_func();-
1763 QModelIndexList source_indexes;-
1764 const int numIndexes = indexes.count();-
1765 source_indexes.reserve(numIndexes);-
1766 for (int i = 0; i < numIndexes
i < numIndexesDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1767 source_indexes << mapToSource(indexes.at(i));
never executed: source_indexes << mapToSource(indexes.at(i));
0
1768 return
never executed: return d->model->mimeData(source_indexes);
d->model->mimeData(source_indexes);
never executed: return d->model->mimeData(source_indexes);
0
1769}-
1770-
1771-
1772-
1773-
1774QStringList QSortFilterProxyModel::mimeTypes() const-
1775{-
1776 const QSortFilterProxyModelPrivate * const d = d_func();-
1777 return
executed 48 times by 3 tests: return d->model->mimeTypes();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
d->model->mimeTypes();
executed 48 times by 3 tests: return d->model->mimeTypes();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
48
1778}-
1779-
1780-
1781-
1782-
1783Qt::DropActions QSortFilterProxyModel::supportedDropActions() const-
1784{-
1785 const QSortFilterProxyModelPrivate * const d = d_func();-
1786 return
executed 48 times by 3 tests: return d->model->supportedDropActions();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
d->model->supportedDropActions();
executed 48 times by 3 tests: return d->model->supportedDropActions();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
48
1787}-
1788-
1789-
1790-
1791-
1792-
1793bool QSortFilterProxyModel::dropMimeData(const QMimeData *data, Qt::DropAction action,-
1794 int row, int column, const QModelIndex &parent)-
1795{-
1796 return
executed 1 time by 1 test: return QAbstractProxyModel::dropMimeData(data, action, row, column, parent);
Executed by:
  • tst_QSortFilterProxyModel
QAbstractProxyModel::dropMimeData(data, action, row, column, parent);
executed 1 time by 1 test: return QAbstractProxyModel::dropMimeData(data, action, row, column, parent);
Executed by:
  • tst_QSortFilterProxyModel
1
1797}-
1798-
1799-
1800-
1801-
1802bool QSortFilterProxyModel::insertRows(int row, int count, const QModelIndex &parent)-
1803{-
1804 QSortFilterProxyModelPrivate * const d = d_func();-
1805 if (row < 0
row < 0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 51 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
|| count <= 0
count <= 0Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
9-51
1806 return
executed 30 times by 1 test: return false;
Executed by:
  • tst_QItemModel
false;
executed 30 times by 1 test: return false;
Executed by:
  • tst_QItemModel
30
1807 QModelIndex source_parent = mapToSource(parent);-
1808 if (parent.isValid()
parent.isValid()Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
&& !source_parent.isValid()
!source_parent.isValid()Description
TRUEnever evaluated
FALSEevaluated 27 times by 1 test
Evaluated by:
  • tst_QItemModel
)
0-27
1809 return
never executed: return false;
false;
never executed: return false;
0
1810 QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value();-
1811 if (row > m->source_rows.count()
row > m->source_rows.count()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 24 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
6-24
1812 return
executed 6 times by 1 test: return false;
Executed by:
  • tst_QItemModel
false;
executed 6 times by 1 test: return false;
Executed by:
  • tst_QItemModel
6
1813 int source_row = (row >= m->source_rows.count()
row >= m->source_rows.count()Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 23 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
1-23
1814 ? m->source_rows.count()-
1815 : m->source_rows.at(row));-
1816 return
executed 24 times by 2 tests: return d->model->insertRows(source_row, count, source_parent);
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
d->model->insertRows(source_row, count, source_parent);
executed 24 times by 2 tests: return d->model->insertRows(source_row, count, source_parent);
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
24
1817}-
1818-
1819-
1820-
1821-
1822bool QSortFilterProxyModel::insertColumns(int column, int count, const QModelIndex &parent)-
1823{-
1824 QSortFilterProxyModelPrivate * const d = d_func();-
1825 if (column < 0
column < 0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_QItemModel
|| count <= 0
count <= 0Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 27 times by 1 test
Evaluated by:
  • tst_QItemModel
)
9-48
1826 return
executed 30 times by 1 test: return false;
Executed by:
  • tst_QItemModel
false;
executed 30 times by 1 test: return false;
Executed by:
  • tst_QItemModel
30
1827 QModelIndex source_parent = mapToSource(parent);-
1828 if (parent.isValid()
parent.isValid()Description
TRUEevaluated 27 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEnever evaluated
&& !source_parent.isValid()
!source_parent.isValid()Description
TRUEnever evaluated
FALSEevaluated 27 times by 1 test
Evaluated by:
  • tst_QItemModel
)
0-27
1829 return
never executed: return false;
false;
never executed: return false;
0
1830 QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value();-
1831 if (column > m->source_columns.count()
column > m->so...olumns.count()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 21 times by 1 test
Evaluated by:
  • tst_QItemModel
)
6-21
1832 return
executed 6 times by 1 test: return false;
Executed by:
  • tst_QItemModel
false;
executed 6 times by 1 test: return false;
Executed by:
  • tst_QItemModel
6
1833 int source_column = (column >= m->source_columns.count()
column >= m->s...olumns.count()Description
TRUEnever evaluated
FALSEevaluated 21 times by 1 test
Evaluated by:
  • tst_QItemModel
0-21
1834 ? m->source_columns.count()-
1835 : m->source_columns.at(column));-
1836 return
executed 21 times by 1 test: return d->model->insertColumns(source_column, count, source_parent);
Executed by:
  • tst_QItemModel
d->model->insertColumns(source_column, count, source_parent);
executed 21 times by 1 test: return d->model->insertColumns(source_column, count, source_parent);
Executed by:
  • tst_QItemModel
21
1837}-
1838-
1839-
1840-
1841-
1842bool QSortFilterProxyModel::removeRows(int row, int count, const QModelIndex &parent)-
1843{-
1844 QSortFilterProxyModelPrivate * const d = d_func();-
1845 if (row < 0
row < 0Description
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 65 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
|| count <= 0
count <= 0Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 44 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
13-65
1846 return
executed 34 times by 2 tests: return false;
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
false;
executed 34 times by 2 tests: return false;
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
34
1847 QModelIndex source_parent = mapToSource(parent);-
1848 if (parent.isValid()
parent.isValid()Description
TRUEevaluated 33 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 11 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
&& !source_parent.isValid()
!source_parent.isValid()Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • tst_QItemModel
)
0-33
1849 return
never executed: return false;
false;
never executed: return false;
0
1850 QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value();-
1851 if (row + count > m->source_rows.count()
row + count > ...e_rows.count()Description
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 31 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
13-31
1852 return
executed 13 times by 2 tests: return false;
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
false;
executed 13 times by 2 tests: return false;
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
13
1853 if ((
(count == 1)Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 17 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
count == 1)
(count == 1)Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 17 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
14-17
1854 || ((
(d->source_sort_column < 0)Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
d->source_sort_column < 0)
(d->source_sort_column < 0)Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
&& (
(m->proxy_rows..._rows.count())Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEnever evaluated
m->proxy_rows.count() == m->source_rows.count())
(m->proxy_rows..._rows.count())Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEnever evaluated
)) {
0-14
1855 int source_row = m->source_rows.at(row);-
1856 return
executed 28 times by 2 tests: return d->model->removeRows(source_row, count, source_parent);
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
d->model->removeRows(source_row, count, source_parent);
executed 28 times by 2 tests: return d->model->removeRows(source_row, count, source_parent);
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
28
1857 }-
1858-
1859-
1860 QVector<int> rows;-
1861 rows.reserve(count);-
1862 for (int i = row; i < row + count
i < row + countDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
; ++i)
3-9
1863 rows.append(m->source_rows.at(i));
executed 9 times by 1 test: rows.append(m->source_rows.at(i));
Executed by:
  • tst_QSortFilterProxyModel
9
1864 std::sort(rows.begin(), rows.end());-
1865-
1866 int pos = rows.count() - 1;-
1867 bool ok = true;-
1868 while (pos >= 0
pos >= 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
) {
3-4
1869 const int source_end = rows.at(pos--);-
1870 int source_start = source_end;-
1871 while ((
(pos >= 0)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
pos >= 0)
(pos >= 0)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
&& (
(rows.at(pos) ...ce_start - 1))Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
rows.at(pos) == (source_start - 1))
(rows.at(pos) ...ce_start - 1))Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
) {
1-6
1872 --source_start;-
1873 --pos;-
1874 }
executed 5 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
5
1875 ok = ok
okDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEnever evaluated
&& d->model->removeRows(source_start, source_end - source_start + 1,
d->model->remo...source_parent)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEnever evaluated
0-4
1876 source_parent)
d->model->remo...source_parent)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEnever evaluated
;
0-4
1877 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
4
1878 return
executed 3 times by 1 test: return ok;
Executed by:
  • tst_QSortFilterProxyModel
ok;
executed 3 times by 1 test: return ok;
Executed by:
  • tst_QSortFilterProxyModel
3
1879}-
1880-
1881-
1882-
1883-
1884bool QSortFilterProxyModel::removeColumns(int column, int count, const QModelIndex &parent)-
1885{-
1886 QSortFilterProxyModelPrivate * const d = d_func();-
1887 if (column < 0
column < 0Description
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 62 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
|| count <= 0
count <= 0Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 41 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
13-62
1888 return
executed 34 times by 2 tests: return false;
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
false;
executed 34 times by 2 tests: return false;
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
34
1889 QModelIndex source_parent = mapToSource(parent);-
1890 if (parent.isValid()
parent.isValid()Description
TRUEevaluated 33 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
&& !source_parent.isValid()
!source_parent.isValid()Description
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • tst_QItemModel
)
0-33
1891 return
never executed: return false;
false;
never executed: return false;
0
1892 QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value();-
1893 if (column + count > m->source_columns.count()
column + count...olumns.count()Description
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 27 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
14-27
1894 return
executed 14 times by 2 tests: return false;
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
false;
executed 14 times by 2 tests: return false;
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
14
1895 if ((
(count == 1)Description
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
count == 1)
(count == 1)Description
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
|| (
(m->proxy_colu...lumns.count())Description
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
m->proxy_columns.count() == m->source_columns.count())
(m->proxy_colu...lumns.count())Description
TRUEevaluated 13 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
) {
1-14
1896 int source_column = m->source_columns.at(column);-
1897 return
executed 26 times by 2 tests: return d->model->removeColumns(source_column, count, source_parent);
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
d->model->removeColumns(source_column, count, source_parent);
executed 26 times by 2 tests: return d->model->removeColumns(source_column, count, source_parent);
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
26
1898 }-
1899-
1900 QVector<int> columns;-
1901 columns.reserve(count);-
1902 for (int i = column; i < column + count
i < column + countDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
; ++i)
1-3
1903 columns.append(m->source_columns.at(i));
executed 3 times by 1 test: columns.append(m->source_columns.at(i));
Executed by:
  • tst_QSortFilterProxyModel
3
1904-
1905 int pos = columns.count() - 1;-
1906 bool ok = true;-
1907 while (pos >= 0
pos >= 0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
) {
1-3
1908 const int source_end = columns.at(pos--);-
1909 int source_start = source_end;-
1910 while ((
(pos >= 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
pos >= 0)
(pos >= 0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
&& (
(columns.at(po...ce_start - 1))Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
columns.at(pos) == (source_start - 1))
(columns.at(po...ce_start - 1))Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
) {
0-2
1911 --source_start;-
1912 --pos;-
1913 }
never executed: end of block
0
1914 ok = ok
okDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEnever evaluated
&& d->model->removeColumns(source_start, source_end - source_start + 1,
d->model->remo...source_parent)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEnever evaluated
0-3
1915 source_parent)
d->model->remo...source_parent)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEnever evaluated
;
0-3
1916 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
3
1917 return
executed 1 time by 1 test: return ok;
Executed by:
  • tst_QSortFilterProxyModel
ok;
executed 1 time by 1 test: return ok;
Executed by:
  • tst_QSortFilterProxyModel
1
1918}-
1919-
1920-
1921-
1922-
1923void QSortFilterProxyModel::fetchMore(const QModelIndex &parent)-
1924{-
1925 QSortFilterProxyModelPrivate * const d = d_func();-
1926 QModelIndex source_parent;-
1927 if (d->indexValid(parent)
d->indexValid(parent)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 51 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
)
1-51
1928 source_parent = mapToSource(parent);
executed 1 time by 1 test: source_parent = mapToSource(parent);
Executed by:
  • tst_QSortFilterProxyModel
1
1929 d->model->fetchMore(source_parent);-
1930}
executed 52 times by 5 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
52
1931-
1932-
1933-
1934-
1935bool QSortFilterProxyModel::canFetchMore(const QModelIndex &parent) const-
1936{-
1937 const QSortFilterProxyModelPrivate * const d = d_func();-
1938 QModelIndex source_parent;-
1939 if (d->indexValid(parent)
d->indexValid(parent)Description
TRUEevaluated 277 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 449 times by 9 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
)
277-449
1940 source_parent = mapToSource(parent);
executed 277 times by 5 tests: source_parent = mapToSource(parent);
Executed by:
  • tst_ModelTest
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QSortFilterProxyModel
277
1941 return
executed 726 times by 10 tests: return d->model->canFetchMore(source_parent);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
d->model->canFetchMore(source_parent);
executed 726 times by 10 tests: return d->model->canFetchMore(source_parent);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
726
1942}-
1943-
1944-
1945-
1946-
1947Qt::ItemFlags QSortFilterProxyModel::flags(const QModelIndex &index) const-
1948{-
1949 const QSortFilterProxyModelPrivate * const d = d_func();-
1950 QModelIndex source_index;-
1951 if (d->indexValid(index)
d->indexValid(index)Description
TRUEevaluated 3159 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 48 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
)
48-3159
1952 source_index = mapToSource(index);
executed 3159 times by 8 tests: source_index = mapToSource(index);
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
3159
1953 return
executed 3207 times by 10 tests: return d->model->flags(source_index);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
d->model->flags(source_index);
executed 3207 times by 10 tests: return d->model->flags(source_index);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
3207
1954}-
1955-
1956-
1957-
1958-
1959QModelIndex QSortFilterProxyModel::buddy(const QModelIndex &index) const-
1960{-
1961 const QSortFilterProxyModelPrivate * const d = d_func();-
1962 if (!d->indexValid(index)
!d->indexValid(index)Description
TRUEevaluated 48 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 102 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
)
48-102
1963 return
executed 48 times by 3 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
QModelIndex();
executed 48 times by 3 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
48
1964 QModelIndex source_index = mapToSource(index);-
1965 QModelIndex source_buddy = d->model->buddy(source_index);-
1966 if (source_index == source_buddy
source_index == source_buddyDescription
TRUEevaluated 102 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
FALSEnever evaluated
)
0-102
1967 return
executed 102 times by 5 tests: return index;
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
index;
executed 102 times by 5 tests: return index;
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
102
1968 return
never executed: return mapFromSource(source_buddy);
mapFromSource(source_buddy);
never executed: return mapFromSource(source_buddy);
0
1969}-
1970-
1971-
1972-
1973-
1974QModelIndexList QSortFilterProxyModel::match(const QModelIndex &start, int role,-
1975 const QVariant &value, int hits,-
1976 Qt::MatchFlags flags) const-
1977{-
1978 return
executed 54 times by 3 tests: return QAbstractProxyModel::match(start, role, value, hits, flags);
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
QAbstractProxyModel::match(start, role, value, hits, flags);
executed 54 times by 3 tests: return QAbstractProxyModel::match(start, role, value, hits, flags);
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
54
1979}-
1980-
1981-
1982-
1983-
1984QSize QSortFilterProxyModel::span(const QModelIndex &index) const-
1985{-
1986 const QSortFilterProxyModelPrivate * const d = d_func();-
1987 QModelIndex source_index = mapToSource(index);-
1988 if (index.isValid()
index.isValid()Description
TRUEnever evaluated
FALSEevaluated 48 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
&& !source_index.isValid()
!source_index.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
)
0-48
1989 return
never executed: return QSize();
QSize();
never executed: return QSize();
0
1990 return
executed 48 times by 3 tests: return d->model->span(source_index);
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
d->model->span(source_index);
executed 48 times by 3 tests: return d->model->span(source_index);
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
48
1991}-
1992-
1993-
1994-
1995-
1996void QSortFilterProxyModel::sort(int column, Qt::SortOrder order)-
1997{-
1998 QSortFilterProxyModelPrivate * const d = d_func();-
1999 if (d->dynamic_sortfilter
d->dynamic_sortfilterDescription
TRUEevaluated 214 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
&& d->proxy_sort_column == column
d->proxy_sort_column == columnDescription
TRUEevaluated 121 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
FALSEevaluated 93 times by 8 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
&& d->sort_order == order
d->sort_order == orderDescription
TRUEevaluated 117 times by 4 tests
Evaluated by:
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QTableView
)
4-214
2000 return;
executed 117 times by 4 tests: return;
Executed by:
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
117
2001 d->sort_order = order;-
2002 d->proxy_sort_column = column;-
2003 d->update_source_sort_column();-
2004 d->sort();-
2005}
executed 102 times by 8 tests: end of block
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
102
2006-
2007-
2008-
2009-
2010-
2011-
2012-
2013int QSortFilterProxyModel::sortColumn() const-
2014{-
2015 const QSortFilterProxyModelPrivate * const d = d_func();-
2016 return
executed 13 times by 1 test: return d->proxy_sort_column;
Executed by:
  • tst_QSortFilterProxyModel
d->proxy_sort_column;
executed 13 times by 1 test: return d->proxy_sort_column;
Executed by:
  • tst_QSortFilterProxyModel
13
2017}-
2018-
2019-
2020-
2021-
2022-
2023-
2024-
2025Qt::SortOrder QSortFilterProxyModel::sortOrder() const-
2026{-
2027 const QSortFilterProxyModelPrivate * const d = d_func();-
2028 return
never executed: return d->sort_order;
d->sort_order;
never executed: return d->sort_order;
0
2029}-
2030QRegExp QSortFilterProxyModel::filterRegExp() const-
2031{-
2032 const QSortFilterProxyModelPrivate * const d = d_func();-
2033 return
executed 45 times by 1 test: return d->filter_regexp;
Executed by:
  • tst_QSortFilterProxyModel
d->filter_regexp;
executed 45 times by 1 test: return d->filter_regexp;
Executed by:
  • tst_QSortFilterProxyModel
45
2034}-
2035-
2036void QSortFilterProxyModel::setFilterRegExp(const QRegExp &regExp)-
2037{-
2038 QSortFilterProxyModelPrivate * const d = d_func();-
2039 d->filter_about_to_be_changed();-
2040 d->filter_regexp = regExp;-
2041 d->filter_changed();-
2042}
executed 179 times by 4 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
179
2043int QSortFilterProxyModel::filterKeyColumn() const-
2044{-
2045 const QSortFilterProxyModelPrivate * const d = d_func();-
2046 return
executed 3 times by 1 test: return d->filter_column;
Executed by:
  • tst_QSortFilterProxyModel
d->filter_column;
executed 3 times by 1 test: return d->filter_column;
Executed by:
  • tst_QSortFilterProxyModel
3
2047}-
2048-
2049void QSortFilterProxyModel::setFilterKeyColumn(int column)-
2050{-
2051 QSortFilterProxyModelPrivate * const d = d_func();-
2052 d->filter_about_to_be_changed();-
2053 d->filter_column = column;-
2054 d->filter_changed();-
2055}
executed 6 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
6
2056Qt::CaseSensitivity QSortFilterProxyModel::filterCaseSensitivity() const-
2057{-
2058 const QSortFilterProxyModelPrivate * const d = d_func();-
2059 return
never executed: return d->filter_regexp.caseSensitivity();
d->filter_regexp.caseSensitivity();
never executed: return d->filter_regexp.caseSensitivity();
0
2060}-
2061-
2062void QSortFilterProxyModel::setFilterCaseSensitivity(Qt::CaseSensitivity cs)-
2063{-
2064 QSortFilterProxyModelPrivate * const d = d_func();-
2065 if (cs == d->filter_regexp.caseSensitivity()
cs == d->filte...eSensitivity()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
2066 return;
never executed: return;
0
2067 d->filter_about_to_be_changed();-
2068 d->filter_regexp.setCaseSensitivity(cs);-
2069 d->filter_changed();-
2070}
never executed: end of block
0
2071Qt::CaseSensitivity QSortFilterProxyModel::sortCaseSensitivity() const-
2072{-
2073 const QSortFilterProxyModelPrivate * const d = d_func();-
2074 return
never executed: return d->sort_casesensitivity;
d->sort_casesensitivity;
never executed: return d->sort_casesensitivity;
0
2075}-
2076-
2077void QSortFilterProxyModel::setSortCaseSensitivity(Qt::CaseSensitivity cs)-
2078{-
2079 QSortFilterProxyModelPrivate * const d = d_func();-
2080 if (d->sort_casesensitivity == cs
d->sort_casesensitivity == csDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QHeaderView
  • tst_QSortFilterProxyModel
)
3
2081 return;
executed 3 times by 1 test: return;
Executed by:
  • tst_QSortFilterProxyModel
3
2082-
2083 d->sort_casesensitivity = cs;-
2084 d->sort();-
2085}
executed 3 times by 2 tests: end of block
Executed by:
  • tst_QHeaderView
  • tst_QSortFilterProxyModel
3
2086bool QSortFilterProxyModel::isSortLocaleAware() const-
2087{-
2088 const QSortFilterProxyModelPrivate * const d = d_func();-
2089 return
never executed: return d->sort_localeaware;
d->sort_localeaware;
never executed: return d->sort_localeaware;
0
2090}-
2091-
2092void QSortFilterProxyModel::setSortLocaleAware(bool on)-
2093{-
2094 QSortFilterProxyModelPrivate * const d = d_func();-
2095 if (d->sort_localeaware == on
d->sort_localeaware == onDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
2096 return;
never executed: return;
0
2097-
2098 d->sort_localeaware = on;-
2099 d->sort();-
2100}
never executed: end of block
0
2101void QSortFilterProxyModel::setFilterRegExp(const QString &pattern)-
2102{-
2103 QSortFilterProxyModelPrivate * const d = d_func();-
2104 d->filter_about_to_be_changed();-
2105 d->filter_regexp.setPatternSyntax(QRegExp::RegExp);-
2106 d->filter_regexp.setPattern(pattern);-
2107 d->filter_changed();-
2108}
executed 36 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
36
2109-
2110-
2111-
2112-
2113-
2114-
2115-
2116void QSortFilterProxyModel::setFilterWildcard(const QString &pattern)-
2117{-
2118 QSortFilterProxyModelPrivate * const d = d_func();-
2119 d->filter_about_to_be_changed();-
2120 d->filter_regexp.setPatternSyntax(QRegExp::Wildcard);-
2121 d->filter_regexp.setPattern(pattern);-
2122 d->filter_changed();-
2123}
never executed: end of block
0
2124-
2125-
2126-
2127-
2128-
2129-
2130-
2131void QSortFilterProxyModel::setFilterFixedString(const QString &pattern)-
2132{-
2133 QSortFilterProxyModelPrivate * const d = d_func();-
2134 d->filter_about_to_be_changed();-
2135 d->filter_regexp.setPatternSyntax(QRegExp::FixedString);-
2136 d->filter_regexp.setPattern(pattern);-
2137 d->filter_changed();-
2138}
executed 4 times by 2 tests: end of block
Executed by:
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
4
2139bool QSortFilterProxyModel::dynamicSortFilter() const-
2140{-
2141 const QSortFilterProxyModelPrivate * const d = d_func();-
2142 return
never executed: return d->dynamic_sortfilter;
d->dynamic_sortfilter;
never executed: return d->dynamic_sortfilter;
0
2143}-
2144-
2145void QSortFilterProxyModel::setDynamicSortFilter(bool enable)-
2146{-
2147 QSortFilterProxyModelPrivate * const d = d_func();-
2148 d->dynamic_sortfilter = enable;-
2149 if (enable
enableDescription
TRUEevaluated 28 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
)
4-28
2150 d->sort();
executed 28 times by 5 tests: d->sort();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
28
2151}
executed 32 times by 5 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
32
2152int QSortFilterProxyModel::sortRole() const-
2153{-
2154 const QSortFilterProxyModelPrivate * const d = d_func();-
2155 return
never executed: return d->sort_role;
d->sort_role;
never executed: return d->sort_role;
0
2156}-
2157-
2158void QSortFilterProxyModel::setSortRole(int role)-
2159{-
2160 QSortFilterProxyModelPrivate * const d = d_func();-
2161 if (d->sort_role == role
d->sort_role == roleDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
)
1
2162 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_QSortFilterProxyModel
1
2163 d->sort_role = role;-
2164 d->sort();-
2165}
executed 1 time by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
1
2166int QSortFilterProxyModel::filterRole() const-
2167{-
2168 const QSortFilterProxyModelPrivate * const d = d_func();-
2169 return
never executed: return d->filter_role;
d->filter_role;
never executed: return d->filter_role;
0
2170}-
2171-
2172void QSortFilterProxyModel::setFilterRole(int role)-
2173{-
2174 QSortFilterProxyModelPrivate * const d = d_func();-
2175 if (d->filter_role == role
d->filter_role == roleDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
)
1-4
2176 return;
executed 1 time by 1 test: return;
Executed by:
  • tst_QSortFilterProxyModel
1
2177 d->filter_about_to_be_changed();-
2178 d->filter_role = role;-
2179 d->filter_changed();-
2180}
executed 4 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
4
2181-
2182-
2183-
2184-
2185-
2186-
2187void QSortFilterProxyModel::clear()-
2188{-
2189 QSortFilterProxyModelPrivate * const d = d_func();-
2190 layoutAboutToBeChanged();-
2191 d->_q_clearMapping();-
2192 layoutChanged();-
2193}
never executed: end of block
0
2194void QSortFilterProxyModel::invalidate()-
2195{-
2196 QSortFilterProxyModelPrivate * const d = d_func();-
2197 layoutAboutToBeChanged();-
2198 d->_q_clearMapping();-
2199 layoutChanged();-
2200}
executed 5 times by 3 tests: end of block
Executed by:
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QTreeView
5
2201-
2202-
2203-
2204-
2205-
2206-
2207void QSortFilterProxyModel::filterChanged()-
2208{-
2209 QSortFilterProxyModelPrivate * const d = d_func();-
2210 d->filter_changed();-
2211}
never executed: end of block
0
2212void QSortFilterProxyModel::invalidateFilter()-
2213{-
2214 QSortFilterProxyModelPrivate * const d = d_func();-
2215 d->filter_changed();-
2216}
executed 3 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
3
2217bool QSortFilterProxyModel::lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const-
2218{-
2219 const QSortFilterProxyModelPrivate * const d = d_func();-
2220 QVariant l = (source_left.model()
source_left.model()Description
TRUEevaluated 88008 times by 7 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
? source_left.model()->data(source_left, d->sort_role) : QVariant());
3-88008
2221 QVariant r = (source_right.model()
source_right.model()Description
TRUEevaluated 88008 times by 7 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
? source_right.model()->data(source_right, d->sort_role) : QVariant());
3-88008
2222-
2223 if (l.userType() == QVariant::Invalid
l.userType() =...riant::InvalidDescription
TRUEevaluated 12990 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 75021 times by 6 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
)
12990-75021
2224 return
executed 12990 times by 2 tests: return false;
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
false;
executed 12990 times by 2 tests: return false;
Executed by:
  • tst_QItemModel
  • tst_QSortFilterProxyModel
12990
2225 if (r.userType() == QVariant::Invalid
r.userType() =...riant::InvalidDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 75015 times by 6 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QSortFilterProxyModel
  • tst_QTableView
  • tst_QTreeView
)
6-75015
2226 return
executed 6 times by 1 test: return true;
Executed by:
  • tst_QSortFilterProxyModel
true;
executed 6 times by 1 test: return true;
Executed by:
  • tst_QSortFilterProxyModel
6
2227 switch (l.userType()) {-
2228 case
executed 8 times by 2 tests: case QVariant::Int:
Executed by:
  • tst_QSortFilterProxyModel
  • tst_QTableView
QVariant::Int:
executed 8 times by 2 tests: case QVariant::Int:
Executed by:
  • tst_QSortFilterProxyModel
  • tst_QTableView
8
2229 return
executed 8 times by 2 tests: return l.toInt() < r.toInt();
Executed by:
  • tst_QSortFilterProxyModel
  • tst_QTableView
l.toInt() < r.toInt();
executed 8 times by 2 tests: return l.toInt() < r.toInt();
Executed by:
  • tst_QSortFilterProxyModel
  • tst_QTableView
8
2230 case
never executed: case QVariant::UInt:
QVariant::UInt:
never executed: case QVariant::UInt:
0
2231 return
never executed: return l.toUInt() < r.toUInt();
l.toUInt() < r.toUInt();
never executed: return l.toUInt() < r.toUInt();
0
2232 case
never executed: case QVariant::LongLong:
QVariant::LongLong:
never executed: case QVariant::LongLong:
0
2233 return
never executed: return l.toLongLong() < r.toLongLong();
l.toLongLong() < r.toLongLong();
never executed: return l.toLongLong() < r.toLongLong();
0
2234 case
never executed: case QVariant::ULongLong:
QVariant::ULongLong:
never executed: case QVariant::ULongLong:
0
2235 return
never executed: return l.toULongLong() < r.toULongLong();
l.toULongLong() < r.toULongLong();
never executed: return l.toULongLong() < r.toULongLong();
0
2236 case
never executed: case QMetaType::Float:
QMetaType::Float:
never executed: case QMetaType::Float:
0
2237 return
never executed: return l.toFloat() < r.toFloat();
l.toFloat() < r.toFloat();
never executed: return l.toFloat() < r.toFloat();
0
2238 case
never executed: case QVariant::Double:
QVariant::Double:
never executed: case QVariant::Double:
0
2239 return
never executed: return l.toDouble() < r.toDouble();
l.toDouble() < r.toDouble();
never executed: return l.toDouble() < r.toDouble();
0
2240 case
never executed: case QVariant::Char:
QVariant::Char:
never executed: case QVariant::Char:
0
2241 return
never executed: return l.toChar() < r.toChar();
l.toChar() < r.toChar();
never executed: return l.toChar() < r.toChar();
0
2242 case
never executed: case QVariant::Date:
QVariant::Date:
never executed: case QVariant::Date:
0
2243 return
never executed: return l.toDate() < r.toDate();
l.toDate() < r.toDate();
never executed: return l.toDate() < r.toDate();
0
2244 case
never executed: case QVariant::Time:
QVariant::Time:
never executed: case QVariant::Time:
0
2245 return
never executed: return l.toTime() < r.toTime();
l.toTime() < r.toTime();
never executed: return l.toTime() < r.toTime();
0
2246 case
never executed: case QVariant::DateTime:
QVariant::DateTime:
never executed: case QVariant::DateTime:
0
2247 return
never executed: return l.toDateTime() < r.toDateTime();
l.toDateTime() < r.toDateTime();
never executed: return l.toDateTime() < r.toDateTime();
0
2248 case
executed 75007 times by 5 tests: case QVariant::String:
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
QVariant::String:
executed 75007 times by 5 tests: case QVariant::String:
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
75007
2249 default
never executed: default:
:
never executed: default:
0
2250 if (d->sort_localeaware
d->sort_localeawareDescription
TRUEnever evaluated
FALSEevaluated 75007 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
)
0-75007
2251 return
never executed: return l.toString().localeAwareCompare(r.toString()) < 0;
l.toString().localeAwareCompare(r.toString()) < 0;
never executed: return l.toString().localeAwareCompare(r.toString()) < 0;
0
2252 else-
2253 return
executed 75007 times by 5 tests: return l.toString().compare(r.toString(), d->sort_casesensitivity) < 0;
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
l.toString().compare(r.toString(), d->sort_casesensitivity) < 0;
executed 75007 times by 5 tests: return l.toString().compare(r.toString(), d->sort_casesensitivity) < 0;
Executed by:
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QHeaderView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
75007
2254 }-
2255 return
dead code: return false;
false;
dead code: return false;
-
2256}-
2257bool QSortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const-
2258{-
2259 const QSortFilterProxyModelPrivate * const d = d_func();-
2260 if (d->filter_regexp.isEmpty()
d->filter_regexp.isEmpty()Description
TRUEevaluated 46226 times by 13 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
FALSEevaluated 23768 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
)
23768-46226
2261 return
executed 46226 times by 13 tests: return true;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
true;
executed 46226 times by 13 tests: return true;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
46226
2262 if (d->filter_column == -1
d->filter_column == -1Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 23763 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
) {
5-23763
2263 int column_count = d->model->columnCount(source_parent);-
2264 for (int column = 0; column < column_count
column < column_countDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
; ++column) {
2-11
2265 QModelIndex source_index = d->model->index(source_row, column, source_parent);-
2266 QString key = d->model->data(source_index, d->filter_role).toString();-
2267 if (key.contains(d->filter_regexp)
key.contains(d->filter_regexp)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_QSortFilterProxyModel
)
3-8
2268 return
executed 3 times by 1 test: return true;
Executed by:
  • tst_QSortFilterProxyModel
true;
executed 3 times by 1 test: return true;
Executed by:
  • tst_QSortFilterProxyModel
3
2269 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_QSortFilterProxyModel
8
2270 return
executed 2 times by 1 test: return false;
Executed by:
  • tst_QSortFilterProxyModel
false;
executed 2 times by 1 test: return false;
Executed by:
  • tst_QSortFilterProxyModel
2
2271 }-
2272 QModelIndex source_index = d->model->index(source_row, d->filter_column, source_parent);-
2273 if (!source_index.isValid()
!source_index.isValid()Description
TRUEevaluated 3696 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 20067 times by 5 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
)
3696-20067
2274 return
executed 3696 times by 1 test: return true;
Executed by:
  • tst_QItemModel
true;
executed 3696 times by 1 test: return true;
Executed by:
  • tst_QItemModel
3696
2275 QString key = d->model->data(source_index, d->filter_role).toString();-
2276 return
executed 20067 times by 5 tests: return key.contains(d->filter_regexp);
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
key.contains(d->filter_regexp);
executed 20067 times by 5 tests: return key.contains(d->filter_regexp);
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
20067
2277}-
2278bool QSortFilterProxyModel::filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const-
2279{-
2280 (void)source_column;;-
2281 (void)source_parent;;-
2282 return
executed 32152 times by 13 tests: return true;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
true;
executed 32152 times by 13 tests: return true;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
32152
2283}-
2284-
2285-
2286-
2287-
2288-
2289-
2290-
2291QModelIndex QSortFilterProxyModel::mapToSource(const QModelIndex &proxyIndex) const-
2292{-
2293 const QSortFilterProxyModelPrivate * const d = d_func();-
2294 return
executed 223096 times by 13 tests: return d->proxy_to_source(proxyIndex);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
d->proxy_to_source(proxyIndex);
executed 223096 times by 13 tests: return d->proxy_to_source(proxyIndex);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
223096
2295}-
2296-
2297-
2298-
2299-
2300-
2301-
2302-
2303QModelIndex QSortFilterProxyModel::mapFromSource(const QModelIndex &sourceIndex) const-
2304{-
2305 const QSortFilterProxyModelPrivate * const d = d_func();-
2306 return
executed 24071 times by 13 tests: return d->source_to_proxy(sourceIndex);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
d->source_to_proxy(sourceIndex);
executed 24071 times by 13 tests: return d->source_to_proxy(sourceIndex);
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QSortFilterProxyModel
  • tst_QSqlQueryModel
  • tst_QTableView
  • tst_QTreeView
24071
2307}-
2308-
2309-
2310-
2311-
2312QItemSelection QSortFilterProxyModel::mapSelectionToSource(const QItemSelection &proxySelection) const-
2313{-
2314 return
never executed: return QAbstractProxyModel::mapSelectionToSource(proxySelection);
QAbstractProxyModel::mapSelectionToSource(proxySelection);
never executed: return QAbstractProxyModel::mapSelectionToSource(proxySelection);
0
2315}-
2316-
2317-
2318-
2319-
2320QItemSelection QSortFilterProxyModel::mapSelectionFromSource(const QItemSelection &sourceSelection) const-
2321{-
2322 return
executed 1 time by 1 test: return QAbstractProxyModel::mapSelectionFromSource(sourceSelection);
Executed by:
  • tst_QSortFilterProxyModel
QAbstractProxyModel::mapSelectionFromSource(sourceSelection);
executed 1 time by 1 test: return QAbstractProxyModel::mapSelectionFromSource(sourceSelection);
Executed by:
  • tst_QSortFilterProxyModel
1
2323}-
2324-
2325-
2326-
Switch to Source codePreprocessed file

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