OpenCoverage

qstringlistmodel.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/itemmodels/qstringlistmodel.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8QStringListModel::QStringListModel(QObject *parent)-
9 : QAbstractListModel(parent)-
10{-
11}
executed 285 times by 13 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QObject
  • tst_QSortFilterProxyModel
  • tst_QTableView
285
12-
13-
14-
15-
16-
17-
18QStringListModel::QStringListModel(const QStringList &strings, QObject *parent)-
19 : QAbstractListModel(parent), lst(strings)-
20{-
21}
executed 67 times by 14 tests: end of block
Executed by:
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QHeaderView
  • tst_QIdentityProxyModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
  • tst_QTreeView
67
22int QStringListModel::rowCount(const QModelIndex &parent) const-
23{-
24 if (parent.isValid()
parent.isValid()Description
TRUEevaluated 18 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 91991 times by 20 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QIdentityProxyModel
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
  • tst_QTableView
  • tst_QTreeView
)
18-91991
25 return
executed 18 times by 3 tests: return 0;
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
0;
executed 18 times by 3 tests: return 0;
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
18
26-
27 return
executed 91991 times by 20 tests: return lst.count();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QIdentityProxyModel
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
  • tst_QTableView
  • tst_QTreeView
lst.count();
executed 91991 times by 20 tests: return lst.count();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QHeaderView
  • tst_QIdentityProxyModel
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
  • tst_QTableView
  • tst_QTreeView
91991
28}-
29-
30-
31-
32-
33QModelIndex QStringListModel::sibling(int row, int column, const QModelIndex &idx) const-
34{-
35 if (!idx.isValid()
!idx.isValid()Description
TRUEevaluated 5 times by 2 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
FALSEevaluated 73 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QListView
|| column != 0
column != 0Description
TRUEnever evaluated
FALSEevaluated 73 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QListView
|| row >= lst.count()
row >= lst.count()Description
TRUEnever evaluated
FALSEevaluated 73 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QListView
)
0-73
36 return
executed 5 times by 2 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
QModelIndex();
executed 5 times by 2 tests: return QModelIndex();
Executed by:
  • tst_ModelTest
  • tst_QItemModel
5
37-
38 return
executed 73 times by 3 tests: return createIndex(row, 0);
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QListView
createIndex(row, 0);
executed 73 times by 3 tests: return createIndex(row, 0);
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QListView
73
39}-
40QVariant QStringListModel::data(const QModelIndex &index, int role) const-
41{-
42 if (index.row() < 0
index.row() < 0Description
TRUEevaluated 4739 times by 6 tests
Evaluated by:
  • tst_ModelTest
  • tst_QComboBox
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 132335 times by 17 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QIdentityProxyModel
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
  • tst_QTreeView
|| index.row() >= lst.size()
index.row() >= lst.size()Description
TRUEnever evaluated
FALSEevaluated 132335 times by 17 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QIdentityProxyModel
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
  • tst_QTreeView
)
0-132335
43 return
executed 4739 times by 6 tests: return QVariant();
Executed by:
  • tst_ModelTest
  • tst_QComboBox
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QSortFilterProxyModel
QVariant();
executed 4739 times by 6 tests: return QVariant();
Executed by:
  • tst_ModelTest
  • tst_QComboBox
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QSortFilterProxyModel
4739
44-
45 if (role == Qt::DisplayRole
role == Qt::DisplayRoleDescription
TRUEevaluated 19898 times by 14 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontDialog
  • tst_QIdentityProxyModel
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
  • tst_QTreeView
FALSEevaluated 112437 times by 15 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QIdentityProxyModel
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTreeView
|| role == Qt::EditRole
role == Qt::EditRoleDescription
TRUEevaluated 4295 times by 8 tests
Evaluated by:
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QGraphicsProxyWidget
  • tst_QIdentityProxyModel
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QListWidget
FALSEevaluated 108142 times by 14 tests
Evaluated by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QIdentityProxyModel
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
)
4295-112437
46 return
executed 24193 times by 17 tests: return lst.at(index.row());
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QIdentityProxyModel
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
  • tst_QTreeView
lst.at(index.row());
executed 24193 times by 17 tests: return lst.at(index.row());
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QIdentityProxyModel
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
  • tst_QTreeView
24193
47-
48 return
executed 108142 times by 14 tests: return QVariant();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QIdentityProxyModel
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
QVariant();
executed 108142 times by 14 tests: return QVariant();
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QIdentityProxyModel
  • tst_QItemModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTreeView
108142
49}-
50Qt::ItemFlags QStringListModel::flags(const QModelIndex &index) const-
51{-
52 if (!index.isValid()
!index.isValid()Description
TRUEevaluated 18 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
FALSEevaluated 10582 times by 13 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTreeView
)
18-10582
53 return
executed 18 times by 3 tests: return QAbstractListModel::flags(index) | Qt::ItemIsDropEnabled;
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
QAbstractListModel::flags(index) | Qt::ItemIsDropEnabled;
executed 18 times by 3 tests: return QAbstractListModel::flags(index) | Qt::ItemIsDropEnabled;
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
18
54-
55 return
executed 10582 times by 13 tests: return QAbstractListModel::flags(index) | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
Executed by:
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTreeView
QAbstractListModel::flags(index) | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
executed 10582 times by 13 tests: return QAbstractListModel::flags(index) | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
Executed by:
  • tst_QAbstractItemView
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemSelectionModel
  • tst_QLineEdit
  • tst_QListView
  • tst_QListWidget
  • tst_QSortFilterProxyModel
  • tst_QTreeView
10582
56}-
57bool QStringListModel::setData(const QModelIndex &index, const QVariant &value, int role)-
58{-
59 if (index.row() >= 0
index.row() >= 0Description
TRUEevaluated 37 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
FALSEevaluated 35 times by 3 tests
Evaluated by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
&& index.row() < lst.size()
index.row() < lst.size()Description
TRUEevaluated 37 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
FALSEnever evaluated
0-37
60 && (role == Qt::EditRole
role == Qt::EditRoleDescription
TRUEevaluated 34 times by 4 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
FALSEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
|| role == Qt::DisplayRole
role == Qt::DisplayRoleDescription
TRUEevaluated 3 times by 2 tests
Evaluated by:
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
FALSEnever evaluated
)) {
0-34
61 lst.replace(index.row(), value.toString());-
62 QVector<int> roles;-
63 roles.reserve(2);-
64 roles.append(Qt::DisplayRole);-
65 roles.append(Qt::EditRole);-
66 dataChanged(index, index, roles);-
67-
68-
69 return
executed 37 times by 4 tests: return true;
Executed by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
true;
executed 37 times by 4 tests: return true;
Executed by:
  • tst_QAbstractItemView
  • tst_QItemModel
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
37
70 }-
71 return
executed 35 times by 3 tests: return false;
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
false;
executed 35 times by 3 tests: return false;
Executed by:
  • tst_ModelTest
  • tst_QItemModel
  • tst_QSortFilterProxyModel
35
72}-
73bool QStringListModel::insertRows(int row, int count, const QModelIndex &parent)-
74{-
75 if (count < 1
count < 1Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 37 times by 7 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
|| row < 0
row < 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 33 times by 7 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
|| row > rowCount(parent)
row > rowCount(parent)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 29 times by 7 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
)
4-37
76 return
executed 24 times by 1 test: return false;
Executed by:
  • tst_QItemModel
false;
executed 24 times by 1 test: return false;
Executed by:
  • tst_QItemModel
24
77-
78 beginInsertRows(QModelIndex(), row, row + count - 1);-
79-
80 for (int r = 0; r < count
r < countDescription
TRUEevaluated 140 times by 7 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
FALSEevaluated 29 times by 7 tests
Evaluated by:
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
; ++r)
29-140
81 lst.insert(row, QString());
executed 140 times by 7 tests: lst.insert(row, QString());
Executed by:
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
140
82-
83 endInsertRows();-
84-
85 return
executed 29 times by 7 tests: return true;
Executed by:
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
true;
executed 29 times by 7 tests: return true;
Executed by:
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QSortFilterProxyModel
  • tst_QStringListModel
29
86}-
87bool QStringListModel::removeRows(int row, int count, const QModelIndex &parent)-
88{-
89 if (count <= 0
count <= 0Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 39 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QListView
  • tst_QStringListModel
|| row < 0
row < 0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_QItemModel
FALSEevaluated 33 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QListView
  • tst_QStringListModel
|| (
(row + count) ...wCount(parent)Description
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QStringListModel
FALSEevaluated 24 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QListView
  • tst_QStringListModel
row + count) > rowCount(parent)
(row + count) ...wCount(parent)Description
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QStringListModel
FALSEevaluated 24 times by 5 tests
Evaluated by:
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QListView
  • tst_QStringListModel
)
6-39
90 return
executed 31 times by 2 tests: return false;
Executed by:
  • tst_QItemModel
  • tst_QStringListModel
false;
executed 31 times by 2 tests: return false;
Executed by:
  • tst_QItemModel
  • tst_QStringListModel
31
91-
92 beginRemoveRows(QModelIndex(), row, row + count - 1);-
93-
94 const auto it = lst.begin() + row;-
95 lst.erase(it, it + count);-
96-
97 endRemoveRows();-
98-
99 return
executed 24 times by 5 tests: return true;
Executed by:
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QListView
  • tst_QStringListModel
true;
executed 24 times by 5 tests: return true;
Executed by:
  • tst_QAbstractItemView
  • tst_QHeaderView
  • tst_QItemModel
  • tst_QListView
  • tst_QStringListModel
24
100}-
101-
102static bool ascendingLessThan(const QPair<QString, int> &s1, const QPair<QString, int> &s2)-
103{-
104 return
executed 952 times by 2 tests: return s1.first < s2.first;
Executed by:
  • tst_QItemModel
  • tst_QTableView
s1.first < s2.first;
executed 952 times by 2 tests: return s1.first < s2.first;
Executed by:
  • tst_QItemModel
  • tst_QTableView
952
105}-
106-
107static bool decendingLessThan(const QPair<QString, int> &s1, const QPair<QString, int> &s2)-
108{-
109 return
executed 26 times by 1 test: return s1.first > s2.first;
Executed by:
  • tst_QTableView
s1.first > s2.first;
executed 26 times by 1 test: return s1.first > s2.first;
Executed by:
  • tst_QTableView
26
110}-
111-
112-
113-
114-
115void QStringListModel::sort(int, Qt::SortOrder order)-
116{-
117 layoutAboutToBeChanged(QList<QPersistentModelIndex>(), VerticalSortHint);-
118-
119 QVector<QPair<QString, int> > list;-
120 const int lstCount = lst.count();-
121 list.reserve(lstCount);-
122 for (int i = 0; i < lstCount
i < lstCountDescription
TRUEevaluated 347 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QTableView
FALSEevaluated 19 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QTableView
; ++i)
19-347
123 list.append(QPair<QString, int>(lst.at(i), i));
executed 347 times by 2 tests: list.append(QPair<QString, int>(lst.at(i), i));
Executed by:
  • tst_QItemModel
  • tst_QTableView
347
124-
125 if (order == Qt::AscendingOrder
order == Qt::AscendingOrderDescription
TRUEevaluated 15 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QTableView
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QTableView
)
4-15
126 std::sort(list.begin(), list.end(), ascendingLessThan);
executed 15 times by 2 tests: std::sort(list.begin(), list.end(), ascendingLessThan);
Executed by:
  • tst_QItemModel
  • tst_QTableView
15
127 else-
128 std::sort(list.begin(), list.end(), decendingLessThan);
executed 4 times by 1 test: std::sort(list.begin(), list.end(), decendingLessThan);
Executed by:
  • tst_QTableView
4
129-
130 lst.clear();-
131 QVector<int> forwarding(lstCount);-
132 for (int i = 0; i < lstCount
i < lstCountDescription
TRUEevaluated 347 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QTableView
FALSEevaluated 19 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QTableView
; ++i) {
19-347
133 lst.append(list.at(i).first);-
134 forwarding[list.at(i).second] = i;-
135 }
executed 347 times by 2 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QTableView
347
136-
137 QModelIndexList oldList = persistentIndexList();-
138 QModelIndexList newList;-
139 const int numOldIndexes = oldList.count();-
140 newList.reserve(numOldIndexes);-
141 for (int i = 0; i < numOldIndexes
i < numOldIndexesDescription
TRUEnever evaluated
FALSEevaluated 19 times by 2 tests
Evaluated by:
  • tst_QItemModel
  • tst_QTableView
; ++i)
0-19
142 newList.append(index(forwarding.at(oldList.at(i).row()), 0));
never executed: newList.append(index(forwarding.at(oldList.at(i).row()), 0));
0
143 changePersistentIndexList(oldList, newList);-
144-
145 layoutChanged(QList<QPersistentModelIndex>(), VerticalSortHint);-
146}
executed 19 times by 2 tests: end of block
Executed by:
  • tst_QItemModel
  • tst_QTableView
19
147-
148-
149-
150-
151QStringList QStringListModel::stringList() const-
152{-
153 return
executed 1498 times by 2 tests: return lst;
Executed by:
  • tst_QFontDialog
  • tst_QTableView
lst;
executed 1498 times by 2 tests: return lst;
Executed by:
  • tst_QFontDialog
  • tst_QTableView
1498
154}-
155-
156-
157-
158-
159-
160-
161-
162void QStringListModel::setStringList(const QStringList &strings)-
163{-
164 beginResetModel();-
165 lst = strings;-
166 endResetModel();-
167}
executed 628 times by 11 tests: end of block
Executed by:
  • tst_ModelTest
  • tst_QComboBox
  • tst_QCompleter
  • tst_QFontComboBox
  • tst_QFontDialog
  • tst_QGraphicsProxyWidget
  • tst_QItemModel
  • tst_QItemSelectionModel
  • tst_QListView
  • tst_QSortFilterProxyModel
  • tst_QTableView
628
168-
169-
170-
171-
172Qt::DropActions QStringListModel::supportedDropActions() const-
173{-
174 return
executed 19 times by 4 tests: return QAbstractItemModel::supportedDropActions() | Qt::MoveAction;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QItemModel
  • tst_QSortFilterProxyModel
QAbstractItemModel::supportedDropActions() | Qt::MoveAction;
executed 19 times by 4 tests: return QAbstractItemModel::supportedDropActions() | Qt::MoveAction;
Executed by:
  • tst_ModelTest
  • tst_QAbstractItemModel
  • tst_QItemModel
  • tst_QSortFilterProxyModel
19
175}-
176-
177-
Switch to Source codePreprocessed file

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