Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/itemviews/qlistwidget.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||||||||
8 | - | |||||||||||||||||||||||||||||||
9 | typedef bool(*LessThan)(const QPair<QListWidgetItem*,int>&,const QPair<QListWidgetItem*,int>&); | - | ||||||||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||||||||
11 | class QListWidgetMimeData : public QMimeData | - | ||||||||||||||||||||||||||||||
12 | { | - | ||||||||||||||||||||||||||||||
13 | public: template <typename ThisObject> inline void qt_check_for_QOBJECT_macro(const ThisObject &_q_argument) const { int i = qYouForgotTheQ_OBJECT_Macro(this, &_q_argument); i = i + 1; } | - | ||||||||||||||||||||||||||||||
14 | #pragma GCC diagnostic push | - | ||||||||||||||||||||||||||||||
15 | static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - | ||||||||||||||||||||||||||||||
16 | #pragma GCC diagnostic pop | - | ||||||||||||||||||||||||||||||
17 | struct QPrivateSignal {}; | - | ||||||||||||||||||||||||||||||
18 | public: | - | ||||||||||||||||||||||||||||||
19 | QList<QListWidgetItem*> items; | - | ||||||||||||||||||||||||||||||
20 | }; | - | ||||||||||||||||||||||||||||||
21 | - | |||||||||||||||||||||||||||||||
22 | - | |||||||||||||||||||||||||||||||
23 | - | |||||||||||||||||||||||||||||||
24 | - | |||||||||||||||||||||||||||||||
25 | QListModel::QListModel(QListWidget *parent) | - | ||||||||||||||||||||||||||||||
26 | : QAbstractListModel(parent) | - | ||||||||||||||||||||||||||||||
27 | { | - | ||||||||||||||||||||||||||||||
28 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
29 | - | |||||||||||||||||||||||||||||||
30 | QListModel::~QListModel() | - | ||||||||||||||||||||||||||||||
31 | { | - | ||||||||||||||||||||||||||||||
32 | clear(); | - | ||||||||||||||||||||||||||||||
33 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
34 | - | |||||||||||||||||||||||||||||||
35 | void QListModel::clear() | - | ||||||||||||||||||||||||||||||
36 | { | - | ||||||||||||||||||||||||||||||
37 | beginResetModel(); | - | ||||||||||||||||||||||||||||||
38 | for (int i = 0; i < items.count()
| 0 | ||||||||||||||||||||||||||||||
39 | if (items.at(i)
| 0 | ||||||||||||||||||||||||||||||
40 | items.at(i)->d->theid = -1; | - | ||||||||||||||||||||||||||||||
41 | items.at(i)->view = 0; | - | ||||||||||||||||||||||||||||||
42 | delete items.at(i); | - | ||||||||||||||||||||||||||||||
43 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
44 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
45 | items.clear(); | - | ||||||||||||||||||||||||||||||
46 | endResetModel(); | - | ||||||||||||||||||||||||||||||
47 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
48 | - | |||||||||||||||||||||||||||||||
49 | QListWidgetItem *QListModel::at(int row) const | - | ||||||||||||||||||||||||||||||
50 | { | - | ||||||||||||||||||||||||||||||
51 | return never executed: items.value(row);return items.value(row); never executed: return items.value(row); | 0 | ||||||||||||||||||||||||||||||
52 | } | - | ||||||||||||||||||||||||||||||
53 | - | |||||||||||||||||||||||||||||||
54 | void QListModel::remove(QListWidgetItem *item) | - | ||||||||||||||||||||||||||||||
55 | { | - | ||||||||||||||||||||||||||||||
56 | if (!item
| 0 | ||||||||||||||||||||||||||||||
57 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
58 | int row = items.indexOf(item); | - | ||||||||||||||||||||||||||||||
59 | ((!(row != -1)) ? qt_assert("row != -1",__FILE__,94) : qt_noop()); | - | ||||||||||||||||||||||||||||||
60 | beginRemoveRows(QModelIndex(), row, row); | - | ||||||||||||||||||||||||||||||
61 | items.at(row)->d->theid = -1; | - | ||||||||||||||||||||||||||||||
62 | items.at(row)->view = 0; | - | ||||||||||||||||||||||||||||||
63 | items.removeAt(row); | - | ||||||||||||||||||||||||||||||
64 | endRemoveRows(); | - | ||||||||||||||||||||||||||||||
65 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
66 | - | |||||||||||||||||||||||||||||||
67 | void QListModel::insert(int row, QListWidgetItem *item) | - | ||||||||||||||||||||||||||||||
68 | { | - | ||||||||||||||||||||||||||||||
69 | if (!item
| 0 | ||||||||||||||||||||||||||||||
70 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
71 | - | |||||||||||||||||||||||||||||||
72 | item->view = qobject_cast<QListWidget*>(QObject::parent()); | - | ||||||||||||||||||||||||||||||
73 | if (item->view
| 0 | ||||||||||||||||||||||||||||||
74 | - | |||||||||||||||||||||||||||||||
75 | QList<QListWidgetItem*>::iterator it; | - | ||||||||||||||||||||||||||||||
76 | it = sortedInsertionIterator(items.begin(), items.end(), | - | ||||||||||||||||||||||||||||||
77 | item->view->sortOrder(), item); | - | ||||||||||||||||||||||||||||||
78 | row = qMax(it - items.begin(), 0); | - | ||||||||||||||||||||||||||||||
79 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||
80 | if (row < 0
| 0 | ||||||||||||||||||||||||||||||
81 | row = 0; never executed: row = 0; | 0 | ||||||||||||||||||||||||||||||
82 | else if (row > items.count()
| 0 | ||||||||||||||||||||||||||||||
83 | row = items.count(); never executed: row = items.count(); | 0 | ||||||||||||||||||||||||||||||
84 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
85 | beginInsertRows(QModelIndex(), row, row); | - | ||||||||||||||||||||||||||||||
86 | items.insert(row, item); | - | ||||||||||||||||||||||||||||||
87 | item->d->theid = row; | - | ||||||||||||||||||||||||||||||
88 | endInsertRows(); | - | ||||||||||||||||||||||||||||||
89 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
90 | - | |||||||||||||||||||||||||||||||
91 | void QListModel::insert(int row, const QStringList &labels) | - | ||||||||||||||||||||||||||||||
92 | { | - | ||||||||||||||||||||||||||||||
93 | const int count = labels.count(); | - | ||||||||||||||||||||||||||||||
94 | if (count <= 0
| 0 | ||||||||||||||||||||||||||||||
95 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
96 | QListWidget *view = qobject_cast<QListWidget*>(QObject::parent()); | - | ||||||||||||||||||||||||||||||
97 | if (view
| 0 | ||||||||||||||||||||||||||||||
98 | - | |||||||||||||||||||||||||||||||
99 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||||||||
100 | QListWidgetItem *item = new QListWidgetItem(labels.at(i)); | - | ||||||||||||||||||||||||||||||
101 | insert(row, item); | - | ||||||||||||||||||||||||||||||
102 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
103 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||
104 | if (row < 0
| 0 | ||||||||||||||||||||||||||||||
105 | row = 0; never executed: row = 0; | 0 | ||||||||||||||||||||||||||||||
106 | else if (row > items.count()
| 0 | ||||||||||||||||||||||||||||||
107 | row = items.count(); never executed: row = items.count(); | 0 | ||||||||||||||||||||||||||||||
108 | beginInsertRows(QModelIndex(), row, row + count - 1); | - | ||||||||||||||||||||||||||||||
109 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||||||||
110 | QListWidgetItem *item = new QListWidgetItem(labels.at(i)); | - | ||||||||||||||||||||||||||||||
111 | item->d->theid = row; | - | ||||||||||||||||||||||||||||||
112 | item->view = qobject_cast<QListWidget*>(QObject::parent()); | - | ||||||||||||||||||||||||||||||
113 | items.insert(row++, item); | - | ||||||||||||||||||||||||||||||
114 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
115 | endInsertRows(); | - | ||||||||||||||||||||||||||||||
116 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
117 | } | - | ||||||||||||||||||||||||||||||
118 | - | |||||||||||||||||||||||||||||||
119 | QListWidgetItem *QListModel::take(int row) | - | ||||||||||||||||||||||||||||||
120 | { | - | ||||||||||||||||||||||||||||||
121 | if (row < 0
| 0 | ||||||||||||||||||||||||||||||
122 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||
123 | - | |||||||||||||||||||||||||||||||
124 | beginRemoveRows(QModelIndex(), row, row); | - | ||||||||||||||||||||||||||||||
125 | items.at(row)->d->theid = -1; | - | ||||||||||||||||||||||||||||||
126 | items.at(row)->view = 0; | - | ||||||||||||||||||||||||||||||
127 | QListWidgetItem *item = items.takeAt(row); | - | ||||||||||||||||||||||||||||||
128 | endRemoveRows(); | - | ||||||||||||||||||||||||||||||
129 | return never executed: item;return item; never executed: return item; | 0 | ||||||||||||||||||||||||||||||
130 | } | - | ||||||||||||||||||||||||||||||
131 | - | |||||||||||||||||||||||||||||||
132 | void QListModel::move(int srcRow, int dstRow) | - | ||||||||||||||||||||||||||||||
133 | { | - | ||||||||||||||||||||||||||||||
134 | if (srcRow == dstRow
| 0 | ||||||||||||||||||||||||||||||
135 | || srcRow < 0
| 0 | ||||||||||||||||||||||||||||||
136 | || dstRow < 0
| 0 | ||||||||||||||||||||||||||||||
137 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
138 | - | |||||||||||||||||||||||||||||||
139 | if (!beginMoveRows(QModelIndex(), srcRow, srcRow, QModelIndex(), dstRow)
| 0 | ||||||||||||||||||||||||||||||
140 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
141 | if (srcRow < dstRow
| 0 | ||||||||||||||||||||||||||||||
142 | -- never executed: dstRow;--dstRow; never executed: --dstRow; | 0 | ||||||||||||||||||||||||||||||
143 | items.move(srcRow, dstRow); | - | ||||||||||||||||||||||||||||||
144 | endMoveRows(); | - | ||||||||||||||||||||||||||||||
145 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
146 | - | |||||||||||||||||||||||||||||||
147 | int QListModel::rowCount(const QModelIndex &parent) const | - | ||||||||||||||||||||||||||||||
148 | { | - | ||||||||||||||||||||||||||||||
149 | return never executed: parent.isValid()return parent.isValid() ? 0 : items.count();
never executed: return parent.isValid() ? 0 : items.count(); | 0 | ||||||||||||||||||||||||||||||
150 | } | - | ||||||||||||||||||||||||||||||
151 | - | |||||||||||||||||||||||||||||||
152 | QModelIndex QListModel::index(QListWidgetItem *item) const | - | ||||||||||||||||||||||||||||||
153 | { | - | ||||||||||||||||||||||||||||||
154 | if (!item
| 0 | ||||||||||||||||||||||||||||||
155 | || items.isEmpty()
| 0 | ||||||||||||||||||||||||||||||
156 | return never executed: QModelIndex();return QModelIndex(); never executed: return QModelIndex(); | 0 | ||||||||||||||||||||||||||||||
157 | int row; | - | ||||||||||||||||||||||||||||||
158 | const int theid = item->d->theid; | - | ||||||||||||||||||||||||||||||
159 | if (theid >= 0
| 0 | ||||||||||||||||||||||||||||||
160 | row = theid; | - | ||||||||||||||||||||||||||||||
161 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||
162 | row = items.lastIndexOf(item); | - | ||||||||||||||||||||||||||||||
163 | if (row == -1
| 0 | ||||||||||||||||||||||||||||||
164 | return never executed: QModelIndex();return QModelIndex(); never executed: return QModelIndex(); | 0 | ||||||||||||||||||||||||||||||
165 | item->d->theid = row; | - | ||||||||||||||||||||||||||||||
166 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
167 | return never executed: createIndex(row, 0, item);return createIndex(row, 0, item); never executed: return createIndex(row, 0, item); | 0 | ||||||||||||||||||||||||||||||
168 | } | - | ||||||||||||||||||||||||||||||
169 | - | |||||||||||||||||||||||||||||||
170 | QModelIndex QListModel::index(int row, int column, const QModelIndex &parent) const | - | ||||||||||||||||||||||||||||||
171 | { | - | ||||||||||||||||||||||||||||||
172 | if (hasIndex(row, column, parent)
| 0 | ||||||||||||||||||||||||||||||
173 | return never executed: createIndex(row, column, items.at(row));return createIndex(row, column, items.at(row)); never executed: return createIndex(row, column, items.at(row)); | 0 | ||||||||||||||||||||||||||||||
174 | return never executed: QModelIndex();return QModelIndex(); never executed: return QModelIndex(); | 0 | ||||||||||||||||||||||||||||||
175 | } | - | ||||||||||||||||||||||||||||||
176 | - | |||||||||||||||||||||||||||||||
177 | QVariant QListModel::data(const QModelIndex &index, int role) const | - | ||||||||||||||||||||||||||||||
178 | { | - | ||||||||||||||||||||||||||||||
179 | if (!index.isValid()
| 0 | ||||||||||||||||||||||||||||||
180 | return never executed: QVariant();return QVariant(); never executed: return QVariant(); | 0 | ||||||||||||||||||||||||||||||
181 | return never executed: items.at(index.row())->data(role);return items.at(index.row())->data(role); never executed: return items.at(index.row())->data(role); | 0 | ||||||||||||||||||||||||||||||
182 | } | - | ||||||||||||||||||||||||||||||
183 | - | |||||||||||||||||||||||||||||||
184 | bool QListModel::setData(const QModelIndex &index, const QVariant &value, int role) | - | ||||||||||||||||||||||||||||||
185 | { | - | ||||||||||||||||||||||||||||||
186 | if (!index.isValid()
| 0 | ||||||||||||||||||||||||||||||
187 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||||||||
188 | items.at(index.row())->setData(role, value); | - | ||||||||||||||||||||||||||||||
189 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||||||||
190 | } | - | ||||||||||||||||||||||||||||||
191 | - | |||||||||||||||||||||||||||||||
192 | QMap<int, QVariant> QListModel::itemData(const QModelIndex &index) const | - | ||||||||||||||||||||||||||||||
193 | { | - | ||||||||||||||||||||||||||||||
194 | QMap<int, QVariant> roles; | - | ||||||||||||||||||||||||||||||
195 | if (!index.isValid()
| 0 | ||||||||||||||||||||||||||||||
196 | return never executed: roles;return roles; never executed: return roles; | 0 | ||||||||||||||||||||||||||||||
197 | QListWidgetItem *itm = items.at(index.row()); | - | ||||||||||||||||||||||||||||||
198 | for (int i = 0; i < itm->d->values.count()
| 0 | ||||||||||||||||||||||||||||||
199 | roles.insert(itm->d->values.at(i).role, | - | ||||||||||||||||||||||||||||||
200 | itm->d->values.at(i).value); | - | ||||||||||||||||||||||||||||||
201 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
202 | return never executed: roles;return roles; never executed: return roles; | 0 | ||||||||||||||||||||||||||||||
203 | } | - | ||||||||||||||||||||||||||||||
204 | - | |||||||||||||||||||||||||||||||
205 | bool QListModel::insertRows(int row, int count, const QModelIndex &parent) | - | ||||||||||||||||||||||||||||||
206 | { | - | ||||||||||||||||||||||||||||||
207 | if (count < 1
| 0 | ||||||||||||||||||||||||||||||
208 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||||||||
209 | - | |||||||||||||||||||||||||||||||
210 | beginInsertRows(QModelIndex(), row, row + count - 1); | - | ||||||||||||||||||||||||||||||
211 | QListWidget *view = qobject_cast<QListWidget*>(QObject::parent()); | - | ||||||||||||||||||||||||||||||
212 | QListWidgetItem *itm = 0; | - | ||||||||||||||||||||||||||||||
213 | - | |||||||||||||||||||||||||||||||
214 | for (int r = row; r < row + count
| 0 | ||||||||||||||||||||||||||||||
215 | itm = new QListWidgetItem; | - | ||||||||||||||||||||||||||||||
216 | itm->view = view; | - | ||||||||||||||||||||||||||||||
217 | itm->d->theid = r; | - | ||||||||||||||||||||||||||||||
218 | items.insert(r, itm); | - | ||||||||||||||||||||||||||||||
219 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
220 | - | |||||||||||||||||||||||||||||||
221 | endInsertRows(); | - | ||||||||||||||||||||||||||||||
222 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||||||||
223 | } | - | ||||||||||||||||||||||||||||||
224 | - | |||||||||||||||||||||||||||||||
225 | bool QListModel::removeRows(int row, int count, const QModelIndex &parent) | - | ||||||||||||||||||||||||||||||
226 | { | - | ||||||||||||||||||||||||||||||
227 | if (count < 1
| 0 | ||||||||||||||||||||||||||||||
228 | return never executed: false;return false; never executed: return false; | 0 | ||||||||||||||||||||||||||||||
229 | - | |||||||||||||||||||||||||||||||
230 | beginRemoveRows(QModelIndex(), row, row + count - 1); | - | ||||||||||||||||||||||||||||||
231 | QListWidgetItem *itm = 0; | - | ||||||||||||||||||||||||||||||
232 | for (int r = row; r < row + count
| 0 | ||||||||||||||||||||||||||||||
233 | itm = items.takeAt(row); | - | ||||||||||||||||||||||||||||||
234 | itm->view = 0; | - | ||||||||||||||||||||||||||||||
235 | itm->d->theid = -1; | - | ||||||||||||||||||||||||||||||
236 | delete itm; | - | ||||||||||||||||||||||||||||||
237 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
238 | endRemoveRows(); | - | ||||||||||||||||||||||||||||||
239 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||||||||||||||
240 | } | - | ||||||||||||||||||||||||||||||
241 | - | |||||||||||||||||||||||||||||||
242 | Qt::ItemFlags QListModel::flags(const QModelIndex &index) const | - | ||||||||||||||||||||||||||||||
243 | { | - | ||||||||||||||||||||||||||||||
244 | if (!index.isValid()
| 0 | ||||||||||||||||||||||||||||||
245 | return never executed: Qt::ItemIsDropEnabled;return Qt::ItemIsDropEnabled; never executed: return Qt::ItemIsDropEnabled; | 0 | ||||||||||||||||||||||||||||||
246 | return never executed: items.at(index.row())->flags();return items.at(index.row())->flags(); never executed: return items.at(index.row())->flags(); | 0 | ||||||||||||||||||||||||||||||
247 | } | - | ||||||||||||||||||||||||||||||
248 | - | |||||||||||||||||||||||||||||||
249 | void QListModel::sort(int column, Qt::SortOrder order) | - | ||||||||||||||||||||||||||||||
250 | { | - | ||||||||||||||||||||||||||||||
251 | if (column != 0
| 0 | ||||||||||||||||||||||||||||||
252 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
253 | - | |||||||||||||||||||||||||||||||
254 | layoutAboutToBeChanged(); | - | ||||||||||||||||||||||||||||||
255 | - | |||||||||||||||||||||||||||||||
256 | QVector < QPair<QListWidgetItem*,int> > sorting(items.count()); | - | ||||||||||||||||||||||||||||||
257 | for (int i = 0; i < items.count()
| 0 | ||||||||||||||||||||||||||||||
258 | QListWidgetItem *item = items.at(i); | - | ||||||||||||||||||||||||||||||
259 | sorting[i].first = item; | - | ||||||||||||||||||||||||||||||
260 | sorting[i].second = i; | - | ||||||||||||||||||||||||||||||
261 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
262 | - | |||||||||||||||||||||||||||||||
263 | LessThan compare = (order == Qt::AscendingOrder
| 0 | ||||||||||||||||||||||||||||||
264 | std::sort(sorting.begin(), sorting.end(), compare); | - | ||||||||||||||||||||||||||||||
265 | QModelIndexList fromIndexes; | - | ||||||||||||||||||||||||||||||
266 | QModelIndexList toIndexes; | - | ||||||||||||||||||||||||||||||
267 | const int sortingCount = sorting.count(); | - | ||||||||||||||||||||||||||||||
268 | fromIndexes.reserve(sortingCount); | - | ||||||||||||||||||||||||||||||
269 | toIndexes.reserve(sortingCount); | - | ||||||||||||||||||||||||||||||
270 | for (int r = 0; r < sortingCount
| 0 | ||||||||||||||||||||||||||||||
271 | QListWidgetItem *item = sorting.at(r).first; | - | ||||||||||||||||||||||||||||||
272 | toIndexes.append(createIndex(r, 0, item)); | - | ||||||||||||||||||||||||||||||
273 | fromIndexes.append(createIndex(sorting.at(r).second, 0, sorting.at(r).first)); | - | ||||||||||||||||||||||||||||||
274 | items[r] = sorting.at(r).first; | - | ||||||||||||||||||||||||||||||
275 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
276 | changePersistentIndexList(fromIndexes, toIndexes); | - | ||||||||||||||||||||||||||||||
277 | - | |||||||||||||||||||||||||||||||
278 | layoutChanged(); | - | ||||||||||||||||||||||||||||||
279 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
280 | void QListModel::ensureSorted(int column, Qt::SortOrder order, int start, int end) | - | ||||||||||||||||||||||||||||||
281 | { | - | ||||||||||||||||||||||||||||||
282 | if (column != 0
| 0 | ||||||||||||||||||||||||||||||
283 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
284 | - | |||||||||||||||||||||||||||||||
285 | int count = end - start + 1; | - | ||||||||||||||||||||||||||||||
286 | QVector < QPair<QListWidgetItem*,int> > sorting(count); | - | ||||||||||||||||||||||||||||||
287 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||||||||
288 | sorting[i].first = items.at(start + i); | - | ||||||||||||||||||||||||||||||
289 | sorting[i].second = start + i; | - | ||||||||||||||||||||||||||||||
290 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
291 | - | |||||||||||||||||||||||||||||||
292 | LessThan compare = (order == Qt::AscendingOrder
| 0 | ||||||||||||||||||||||||||||||
293 | std::sort(sorting.begin(), sorting.end(), compare); | - | ||||||||||||||||||||||||||||||
294 | - | |||||||||||||||||||||||||||||||
295 | QModelIndexList oldPersistentIndexes = persistentIndexList(); | - | ||||||||||||||||||||||||||||||
296 | QModelIndexList newPersistentIndexes = oldPersistentIndexes; | - | ||||||||||||||||||||||||||||||
297 | QList<QListWidgetItem*> tmp = items; | - | ||||||||||||||||||||||||||||||
298 | QList<QListWidgetItem*>::iterator lit = tmp.begin(); | - | ||||||||||||||||||||||||||||||
299 | bool changed = false; | - | ||||||||||||||||||||||||||||||
300 | for (int i = 0; i < count
| 0 | ||||||||||||||||||||||||||||||
301 | int oldRow = sorting.at(i).second; | - | ||||||||||||||||||||||||||||||
302 | int tmpitepos = lit - tmp.begin(); | - | ||||||||||||||||||||||||||||||
303 | QListWidgetItem *item = tmp.takeAt(oldRow); | - | ||||||||||||||||||||||||||||||
304 | if (tmpitepos > tmp.size()
| 0 | ||||||||||||||||||||||||||||||
305 | -- never executed: tmpitepos;--tmpitepos; never executed: --tmpitepos; | 0 | ||||||||||||||||||||||||||||||
306 | lit = tmp.begin() + tmpitepos; | - | ||||||||||||||||||||||||||||||
307 | lit = sortedInsertionIterator(lit, tmp.end(), order, item); | - | ||||||||||||||||||||||||||||||
308 | int newRow = qMax(lit - tmp.begin(), 0); | - | ||||||||||||||||||||||||||||||
309 | lit = tmp.insert(lit, item); | - | ||||||||||||||||||||||||||||||
310 | if (newRow != oldRow
| 0 | ||||||||||||||||||||||||||||||
311 | changed = true; | - | ||||||||||||||||||||||||||||||
312 | for (int j = i + 1; j < count
| 0 | ||||||||||||||||||||||||||||||
313 | int otherRow = sorting.at(j).second; | - | ||||||||||||||||||||||||||||||
314 | if (oldRow < otherRow
| 0 | ||||||||||||||||||||||||||||||
315 | -- never executed: sorting[j].second;--sorting[j].second; never executed: --sorting[j].second; | 0 | ||||||||||||||||||||||||||||||
316 | else if (oldRow > otherRow
| 0 | ||||||||||||||||||||||||||||||
317 | ++ never executed: sorting[j].second;++sorting[j].second; never executed: ++sorting[j].second; | 0 | ||||||||||||||||||||||||||||||
318 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
319 | for (int k = 0; k < newPersistentIndexes.count()
| 0 | ||||||||||||||||||||||||||||||
320 | QModelIndex pi = newPersistentIndexes.at(k); | - | ||||||||||||||||||||||||||||||
321 | int oldPersistentRow = pi.row(); | - | ||||||||||||||||||||||||||||||
322 | int newPersistentRow = oldPersistentRow; | - | ||||||||||||||||||||||||||||||
323 | if (oldPersistentRow == oldRow
| 0 | ||||||||||||||||||||||||||||||
324 | newPersistentRow = newRow; never executed: newPersistentRow = newRow; | 0 | ||||||||||||||||||||||||||||||
325 | else if (oldRow < oldPersistentRow
| 0 | ||||||||||||||||||||||||||||||
326 | newPersistentRow = oldPersistentRow - 1; never executed: newPersistentRow = oldPersistentRow - 1; | 0 | ||||||||||||||||||||||||||||||
327 | else if (oldRow > oldPersistentRow
| 0 | ||||||||||||||||||||||||||||||
328 | newPersistentRow = oldPersistentRow + 1; never executed: newPersistentRow = oldPersistentRow + 1; | 0 | ||||||||||||||||||||||||||||||
329 | if (newPersistentRow != oldPersistentRow
| 0 | ||||||||||||||||||||||||||||||
330 | newPersistentIndexes[k] = createIndex(newPersistentRow, never executed: newPersistentIndexes[k] = createIndex(newPersistentRow, pi.column(), pi.internalPointer()); | 0 | ||||||||||||||||||||||||||||||
331 | pi.column(), pi.internalPointer()); never executed: newPersistentIndexes[k] = createIndex(newPersistentRow, pi.column(), pi.internalPointer()); | 0 | ||||||||||||||||||||||||||||||
332 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
333 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
334 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
335 | - | |||||||||||||||||||||||||||||||
336 | if (changed
| 0 | ||||||||||||||||||||||||||||||
337 | layoutAboutToBeChanged(); | - | ||||||||||||||||||||||||||||||
338 | items = tmp; | - | ||||||||||||||||||||||||||||||
339 | changePersistentIndexList(oldPersistentIndexes, newPersistentIndexes); | - | ||||||||||||||||||||||||||||||
340 | layoutChanged(); | - | ||||||||||||||||||||||||||||||
341 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
342 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
343 | - | |||||||||||||||||||||||||||||||
344 | bool QListModel::itemLessThan(const QPair<QListWidgetItem*,int> &left, | - | ||||||||||||||||||||||||||||||
345 | const QPair<QListWidgetItem*,int> &right) | - | ||||||||||||||||||||||||||||||
346 | { | - | ||||||||||||||||||||||||||||||
347 | return never executed: (*left.first) < (*right.first);return (*left.first) < (*right.first); never executed: return (*left.first) < (*right.first); | 0 | ||||||||||||||||||||||||||||||
348 | } | - | ||||||||||||||||||||||||||||||
349 | - | |||||||||||||||||||||||||||||||
350 | bool QListModel::itemGreaterThan(const QPair<QListWidgetItem*,int> &left, | - | ||||||||||||||||||||||||||||||
351 | const QPair<QListWidgetItem*,int> &right) | - | ||||||||||||||||||||||||||||||
352 | { | - | ||||||||||||||||||||||||||||||
353 | return never executed: (*right.first) < (*left.first);return (*right.first) < (*left.first); never executed: return (*right.first) < (*left.first); | 0 | ||||||||||||||||||||||||||||||
354 | } | - | ||||||||||||||||||||||||||||||
355 | - | |||||||||||||||||||||||||||||||
356 | QList<QListWidgetItem*>::iterator QListModel::sortedInsertionIterator( | - | ||||||||||||||||||||||||||||||
357 | const QList<QListWidgetItem*>::iterator &begin, | - | ||||||||||||||||||||||||||||||
358 | const QList<QListWidgetItem*>::iterator &end, | - | ||||||||||||||||||||||||||||||
359 | Qt::SortOrder order, QListWidgetItem *item) | - | ||||||||||||||||||||||||||||||
360 | { | - | ||||||||||||||||||||||||||||||
361 | if (order == Qt::AscendingOrder
| 0 | ||||||||||||||||||||||||||||||
362 | return never executed: std::lower_bound(begin, end, item, QListModelLessThan());return std::lower_bound(begin, end, item, QListModelLessThan()); never executed: return std::lower_bound(begin, end, item, QListModelLessThan()); | 0 | ||||||||||||||||||||||||||||||
363 | return never executed: std::lower_bound(begin, end, item, QListModelGreaterThan());return std::lower_bound(begin, end, item, QListModelGreaterThan()); never executed: return std::lower_bound(begin, end, item, QListModelGreaterThan()); | 0 | ||||||||||||||||||||||||||||||
364 | } | - | ||||||||||||||||||||||||||||||
365 | - | |||||||||||||||||||||||||||||||
366 | void QListModel::itemChanged(QListWidgetItem *item) | - | ||||||||||||||||||||||||||||||
367 | { | - | ||||||||||||||||||||||||||||||
368 | QModelIndex idx = index(item); | - | ||||||||||||||||||||||||||||||
369 | dataChanged(idx, idx); | - | ||||||||||||||||||||||||||||||
370 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
371 | - | |||||||||||||||||||||||||||||||
372 | QStringList QListModel::mimeTypes() const | - | ||||||||||||||||||||||||||||||
373 | { | - | ||||||||||||||||||||||||||||||
374 | const QListWidget *view = qobject_cast<const QListWidget*>(QObject::parent()); | - | ||||||||||||||||||||||||||||||
375 | return never executed: view->mimeTypes();return view->mimeTypes(); never executed: return view->mimeTypes(); | 0 | ||||||||||||||||||||||||||||||
376 | } | - | ||||||||||||||||||||||||||||||
377 | - | |||||||||||||||||||||||||||||||
378 | QMimeData *QListModel::internalMimeData() const | - | ||||||||||||||||||||||||||||||
379 | { | - | ||||||||||||||||||||||||||||||
380 | return never executed: QAbstractItemModel::mimeData(cachedIndexes);return QAbstractItemModel::mimeData(cachedIndexes); never executed: return QAbstractItemModel::mimeData(cachedIndexes); | 0 | ||||||||||||||||||||||||||||||
381 | } | - | ||||||||||||||||||||||||||||||
382 | - | |||||||||||||||||||||||||||||||
383 | QMimeData *QListModel::mimeData(const QModelIndexList &indexes) const | - | ||||||||||||||||||||||||||||||
384 | { | - | ||||||||||||||||||||||||||||||
385 | QList<QListWidgetItem*> itemlist; | - | ||||||||||||||||||||||||||||||
386 | const int indexesCount = indexes.count(); | - | ||||||||||||||||||||||||||||||
387 | itemlist.reserve(indexesCount); | - | ||||||||||||||||||||||||||||||
388 | for (int i = 0; i < indexesCount
| 0 | ||||||||||||||||||||||||||||||
389 | itemlist << at(indexes.at(i).row()); never executed: itemlist << at(indexes.at(i).row()); | 0 | ||||||||||||||||||||||||||||||
390 | const QListWidget *view = qobject_cast<const QListWidget*>(QObject::parent()); | - | ||||||||||||||||||||||||||||||
391 | - | |||||||||||||||||||||||||||||||
392 | cachedIndexes = indexes; | - | ||||||||||||||||||||||||||||||
393 | QMimeData *mimeData = view->mimeData(itemlist); | - | ||||||||||||||||||||||||||||||
394 | cachedIndexes.clear(); | - | ||||||||||||||||||||||||||||||
395 | return never executed: mimeData;return mimeData; never executed: return mimeData; | 0 | ||||||||||||||||||||||||||||||
396 | } | - | ||||||||||||||||||||||||||||||
397 | - | |||||||||||||||||||||||||||||||
398 | - | |||||||||||||||||||||||||||||||
399 | bool QListModel::dropMimeData(const QMimeData *data, Qt::DropAction action, | - | ||||||||||||||||||||||||||||||
400 | int row, int column, const QModelIndex &index) | - | ||||||||||||||||||||||||||||||
401 | { | - | ||||||||||||||||||||||||||||||
402 | (void)column;; | - | ||||||||||||||||||||||||||||||
403 | QListWidget *view = qobject_cast<QListWidget*>(QObject::parent()); | - | ||||||||||||||||||||||||||||||
404 | if (index.isValid()
| 0 | ||||||||||||||||||||||||||||||
405 | row = index.row(); never executed: row = index.row(); | 0 | ||||||||||||||||||||||||||||||
406 | else if (row == -1
| 0 | ||||||||||||||||||||||||||||||
407 | row = items.count(); never executed: row = items.count(); | 0 | ||||||||||||||||||||||||||||||
408 | - | |||||||||||||||||||||||||||||||
409 | return never executed: view->dropMimeData(row, data, action);return view->dropMimeData(row, data, action); never executed: return view->dropMimeData(row, data, action); | 0 | ||||||||||||||||||||||||||||||
410 | } | - | ||||||||||||||||||||||||||||||
411 | - | |||||||||||||||||||||||||||||||
412 | Qt::DropActions QListModel::supportedDropActions() const | - | ||||||||||||||||||||||||||||||
413 | { | - | ||||||||||||||||||||||||||||||
414 | const QListWidget *view = qobject_cast<const QListWidget*>(QObject::parent()); | - | ||||||||||||||||||||||||||||||
415 | return never executed: view->supportedDropActions();return view->supportedDropActions(); never executed: return view->supportedDropActions(); | 0 | ||||||||||||||||||||||||||||||
416 | } | - | ||||||||||||||||||||||||||||||
417 | QListWidgetItem::QListWidgetItem(QListWidget *view, int type) | - | ||||||||||||||||||||||||||||||
418 | : rtti(type), view(view), d(new QListWidgetItemPrivate(this)), | - | ||||||||||||||||||||||||||||||
419 | itemFlags(Qt::ItemIsSelectable | - | ||||||||||||||||||||||||||||||
420 | |Qt::ItemIsUserCheckable | - | ||||||||||||||||||||||||||||||
421 | |Qt::ItemIsEnabled | - | ||||||||||||||||||||||||||||||
422 | |Qt::ItemIsDragEnabled) | - | ||||||||||||||||||||||||||||||
423 | { | - | ||||||||||||||||||||||||||||||
424 | if (QListModel *model = (view
| 0 | ||||||||||||||||||||||||||||||
425 | model->insert(model->rowCount(), this); never executed: model->insert(model->rowCount(), this); | 0 | ||||||||||||||||||||||||||||||
426 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
427 | QListWidgetItem::QListWidgetItem(const QString &text, QListWidget *view, int type) | - | ||||||||||||||||||||||||||||||
428 | : rtti(type), view(0), d(new QListWidgetItemPrivate(this)), | - | ||||||||||||||||||||||||||||||
429 | itemFlags(Qt::ItemIsSelectable | - | ||||||||||||||||||||||||||||||
430 | |Qt::ItemIsUserCheckable | - | ||||||||||||||||||||||||||||||
431 | |Qt::ItemIsEnabled | - | ||||||||||||||||||||||||||||||
432 | |Qt::ItemIsDragEnabled) | - | ||||||||||||||||||||||||||||||
433 | { | - | ||||||||||||||||||||||||||||||
434 | setData(Qt::DisplayRole, text); | - | ||||||||||||||||||||||||||||||
435 | this->view = view; | - | ||||||||||||||||||||||||||||||
436 | if (QListModel *model = (view
| 0 | ||||||||||||||||||||||||||||||
437 | model->insert(model->rowCount(), this); never executed: model->insert(model->rowCount(), this); | 0 | ||||||||||||||||||||||||||||||
438 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
439 | QListWidgetItem::QListWidgetItem(const QIcon &icon,const QString &text, | - | ||||||||||||||||||||||||||||||
440 | QListWidget *view, int type) | - | ||||||||||||||||||||||||||||||
441 | : rtti(type), view(0), d(new QListWidgetItemPrivate(this)), | - | ||||||||||||||||||||||||||||||
442 | itemFlags(Qt::ItemIsSelectable | - | ||||||||||||||||||||||||||||||
443 | |Qt::ItemIsUserCheckable | - | ||||||||||||||||||||||||||||||
444 | |Qt::ItemIsEnabled | - | ||||||||||||||||||||||||||||||
445 | |Qt::ItemIsDragEnabled) | - | ||||||||||||||||||||||||||||||
446 | { | - | ||||||||||||||||||||||||||||||
447 | setData(Qt::DisplayRole, text); | - | ||||||||||||||||||||||||||||||
448 | setData(Qt::DecorationRole, icon); | - | ||||||||||||||||||||||||||||||
449 | this->view = view; | - | ||||||||||||||||||||||||||||||
450 | if (QListModel *model = (view
| 0 | ||||||||||||||||||||||||||||||
451 | model->insert(model->rowCount(), this); never executed: model->insert(model->rowCount(), this); | 0 | ||||||||||||||||||||||||||||||
452 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
453 | - | |||||||||||||||||||||||||||||||
454 | - | |||||||||||||||||||||||||||||||
455 | - | |||||||||||||||||||||||||||||||
456 | - | |||||||||||||||||||||||||||||||
457 | QListWidgetItem::~QListWidgetItem() | - | ||||||||||||||||||||||||||||||
458 | { | - | ||||||||||||||||||||||||||||||
459 | if (QListModel *model = (view
| 0 | ||||||||||||||||||||||||||||||
460 | model->remove(this); never executed: model->remove(this); | 0 | ||||||||||||||||||||||||||||||
461 | delete d; | - | ||||||||||||||||||||||||||||||
462 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
463 | - | |||||||||||||||||||||||||||||||
464 | - | |||||||||||||||||||||||||||||||
465 | - | |||||||||||||||||||||||||||||||
466 | - | |||||||||||||||||||||||||||||||
467 | QListWidgetItem *QListWidgetItem::clone() const | - | ||||||||||||||||||||||||||||||
468 | { | - | ||||||||||||||||||||||||||||||
469 | return never executed: new QListWidgetItem(*this);return new QListWidgetItem(*this); never executed: return new QListWidgetItem(*this); | 0 | ||||||||||||||||||||||||||||||
470 | } | - | ||||||||||||||||||||||||||||||
471 | - | |||||||||||||||||||||||||||||||
472 | - | |||||||||||||||||||||||||||||||
473 | - | |||||||||||||||||||||||||||||||
474 | - | |||||||||||||||||||||||||||||||
475 | - | |||||||||||||||||||||||||||||||
476 | - | |||||||||||||||||||||||||||||||
477 | - | |||||||||||||||||||||||||||||||
478 | void QListWidgetItem::setData(int role, const QVariant &value) | - | ||||||||||||||||||||||||||||||
479 | { | - | ||||||||||||||||||||||||||||||
480 | bool found = false; | - | ||||||||||||||||||||||||||||||
481 | role = (role == Qt::EditRole
| 0 | ||||||||||||||||||||||||||||||
482 | for (int i = 0; i < d->values.count()
| 0 | ||||||||||||||||||||||||||||||
483 | if (d->values.at(i).role == role
| 0 | ||||||||||||||||||||||||||||||
484 | if (d->values.at(i).value == value
| 0 | ||||||||||||||||||||||||||||||
485 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
486 | d->values[i].value = value; | - | ||||||||||||||||||||||||||||||
487 | found = true; | - | ||||||||||||||||||||||||||||||
488 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||
489 | } | - | ||||||||||||||||||||||||||||||
490 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
491 | if (!found
| 0 | ||||||||||||||||||||||||||||||
492 | d->values.append(QWidgetItemData(role, value)); never executed: d->values.append(QWidgetItemData(role, value)); | 0 | ||||||||||||||||||||||||||||||
493 | if (QListModel *model = (view
| 0 | ||||||||||||||||||||||||||||||
494 | model->itemChanged(this); never executed: model->itemChanged(this); | 0 | ||||||||||||||||||||||||||||||
495 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
496 | - | |||||||||||||||||||||||||||||||
497 | - | |||||||||||||||||||||||||||||||
498 | - | |||||||||||||||||||||||||||||||
499 | - | |||||||||||||||||||||||||||||||
500 | - | |||||||||||||||||||||||||||||||
501 | - | |||||||||||||||||||||||||||||||
502 | - | |||||||||||||||||||||||||||||||
503 | QVariant QListWidgetItem::data(int role) const | - | ||||||||||||||||||||||||||||||
504 | { | - | ||||||||||||||||||||||||||||||
505 | role = (role == Qt::EditRole
| 0 | ||||||||||||||||||||||||||||||
506 | for (int i = 0; i < d->values.count()
| 0 | ||||||||||||||||||||||||||||||
507 | if (d->values.at(i).role == role
| 0 | ||||||||||||||||||||||||||||||
508 | return never executed: d->values.at(i).value;return d->values.at(i).value; never executed: return d->values.at(i).value; | 0 | ||||||||||||||||||||||||||||||
509 | return never executed: QVariant();return QVariant(); never executed: return QVariant(); | 0 | ||||||||||||||||||||||||||||||
510 | } | - | ||||||||||||||||||||||||||||||
511 | - | |||||||||||||||||||||||||||||||
512 | - | |||||||||||||||||||||||||||||||
513 | - | |||||||||||||||||||||||||||||||
514 | - | |||||||||||||||||||||||||||||||
515 | - | |||||||||||||||||||||||||||||||
516 | bool QListWidgetItem::operator<(const QListWidgetItem &other) const | - | ||||||||||||||||||||||||||||||
517 | { | - | ||||||||||||||||||||||||||||||
518 | const QVariant v1 = data(Qt::DisplayRole), v2 = other.data(Qt::DisplayRole); | - | ||||||||||||||||||||||||||||||
519 | return never executed: QAbstractItemModelPrivate::variantLessThan(v1, v2);return QAbstractItemModelPrivate::variantLessThan(v1, v2); never executed: return QAbstractItemModelPrivate::variantLessThan(v1, v2); | 0 | ||||||||||||||||||||||||||||||
520 | } | - | ||||||||||||||||||||||||||||||
521 | void QListWidgetItem::read(QDataStream &in) | - | ||||||||||||||||||||||||||||||
522 | { | - | ||||||||||||||||||||||||||||||
523 | in >> d->values; | - | ||||||||||||||||||||||||||||||
524 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
525 | - | |||||||||||||||||||||||||||||||
526 | - | |||||||||||||||||||||||||||||||
527 | - | |||||||||||||||||||||||||||||||
528 | - | |||||||||||||||||||||||||||||||
529 | - | |||||||||||||||||||||||||||||||
530 | - | |||||||||||||||||||||||||||||||
531 | void QListWidgetItem::write(QDataStream &out) const | - | ||||||||||||||||||||||||||||||
532 | { | - | ||||||||||||||||||||||||||||||
533 | out << d->values; | - | ||||||||||||||||||||||||||||||
534 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
535 | QListWidgetItem::QListWidgetItem(const QListWidgetItem &other) | - | ||||||||||||||||||||||||||||||
536 | : rtti(Type), view(0), | - | ||||||||||||||||||||||||||||||
537 | d(new QListWidgetItemPrivate(this)), | - | ||||||||||||||||||||||||||||||
538 | itemFlags(other.itemFlags) | - | ||||||||||||||||||||||||||||||
539 | { | - | ||||||||||||||||||||||||||||||
540 | d->values = other.d->values; | - | ||||||||||||||||||||||||||||||
541 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
542 | QListWidgetItem &QListWidgetItem::operator=(const QListWidgetItem &other) | - | ||||||||||||||||||||||||||||||
543 | { | - | ||||||||||||||||||||||||||||||
544 | d->values = other.d->values; | - | ||||||||||||||||||||||||||||||
545 | itemFlags = other.itemFlags; | - | ||||||||||||||||||||||||||||||
546 | return never executed: *this;return *this; never executed: return *this; | 0 | ||||||||||||||||||||||||||||||
547 | } | - | ||||||||||||||||||||||||||||||
548 | QDataStream &operator<<(QDataStream &out, const QListWidgetItem &item) | - | ||||||||||||||||||||||||||||||
549 | { | - | ||||||||||||||||||||||||||||||
550 | item.write(out); | - | ||||||||||||||||||||||||||||||
551 | return never executed: out;return out; never executed: return out; | 0 | ||||||||||||||||||||||||||||||
552 | } | - | ||||||||||||||||||||||||||||||
553 | QDataStream &operator>>(QDataStream &in, QListWidgetItem &item) | - | ||||||||||||||||||||||||||||||
554 | { | - | ||||||||||||||||||||||||||||||
555 | item.read(in); | - | ||||||||||||||||||||||||||||||
556 | return never executed: in;return in; never executed: return in; | 0 | ||||||||||||||||||||||||||||||
557 | } | - | ||||||||||||||||||||||||||||||
558 | void QListWidgetItem::setFlags(Qt::ItemFlags aflags) { | - | ||||||||||||||||||||||||||||||
559 | itemFlags = aflags; | - | ||||||||||||||||||||||||||||||
560 | if (QListModel *model = (view
| 0 | ||||||||||||||||||||||||||||||
561 | model->itemChanged(this); never executed: model->itemChanged(this); | 0 | ||||||||||||||||||||||||||||||
562 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
563 | void QListWidgetPrivate::setup() | - | ||||||||||||||||||||||||||||||
564 | { | - | ||||||||||||||||||||||||||||||
565 | QListWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||
566 | q->QListView::setModel(new QListModel(q)); | - | ||||||||||||||||||||||||||||||
567 | - | |||||||||||||||||||||||||||||||
568 | QObject::connect(q, qFlagLocation("2""pressed(QModelIndex)" "\0" __FILE__ ":" "1057"), q, qFlagLocation("1""_q_emitItemPressed(QModelIndex)" "\0" __FILE__ ":" "1057")); | - | ||||||||||||||||||||||||||||||
569 | QObject::connect(q, qFlagLocation("2""clicked(QModelIndex)" "\0" __FILE__ ":" "1058"), q, qFlagLocation("1""_q_emitItemClicked(QModelIndex)" "\0" __FILE__ ":" "1058")); | - | ||||||||||||||||||||||||||||||
570 | QObject::connect(q, qFlagLocation("2""doubleClicked(QModelIndex)" "\0" __FILE__ ":" "1059"), | - | ||||||||||||||||||||||||||||||
571 | q, qFlagLocation("1""_q_emitItemDoubleClicked(QModelIndex)" "\0" __FILE__ ":" "1060")); | - | ||||||||||||||||||||||||||||||
572 | QObject::connect(q, qFlagLocation("2""activated(QModelIndex)" "\0" __FILE__ ":" "1061"), | - | ||||||||||||||||||||||||||||||
573 | q, qFlagLocation("1""_q_emitItemActivated(QModelIndex)" "\0" __FILE__ ":" "1062")); | - | ||||||||||||||||||||||||||||||
574 | QObject::connect(q, qFlagLocation("2""entered(QModelIndex)" "\0" __FILE__ ":" "1063"), q, qFlagLocation("1""_q_emitItemEntered(QModelIndex)" "\0" __FILE__ ":" "1063")); | - | ||||||||||||||||||||||||||||||
575 | QObject::connect(model, qFlagLocation("2""dataChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "1064"), | - | ||||||||||||||||||||||||||||||
576 | q, qFlagLocation("1""_q_emitItemChanged(QModelIndex)" "\0" __FILE__ ":" "1065")); | - | ||||||||||||||||||||||||||||||
577 | QObject::connect(q->selectionModel(), qFlagLocation("2""currentChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "1066"), | - | ||||||||||||||||||||||||||||||
578 | q, qFlagLocation("1""_q_emitCurrentItemChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "1067")); | - | ||||||||||||||||||||||||||||||
579 | QObject::connect(q->selectionModel(), qFlagLocation("2""selectionChanged(QItemSelection,QItemSelection)" "\0" __FILE__ ":" "1068"), | - | ||||||||||||||||||||||||||||||
580 | q, qFlagLocation("2""itemSelectionChanged()" "\0" __FILE__ ":" "1069")); | - | ||||||||||||||||||||||||||||||
581 | QObject::connect(model, qFlagLocation("2""dataChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "1070"), | - | ||||||||||||||||||||||||||||||
582 | q, qFlagLocation("1""_q_dataChanged(QModelIndex,QModelIndex)" "\0" __FILE__ ":" "1071")); | - | ||||||||||||||||||||||||||||||
583 | QObject::connect(model, qFlagLocation("2""columnsRemoved(QModelIndex,int,int)" "\0" __FILE__ ":" "1072"), q, qFlagLocation("1""_q_sort()" "\0" __FILE__ ":" "1072")); | - | ||||||||||||||||||||||||||||||
584 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
585 | - | |||||||||||||||||||||||||||||||
586 | void QListWidgetPrivate::_q_emitItemPressed(const QModelIndex &index) | - | ||||||||||||||||||||||||||||||
587 | { | - | ||||||||||||||||||||||||||||||
588 | QListWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||
589 | q->itemPressed(listModel()->at(index.row())); | - | ||||||||||||||||||||||||||||||
590 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
591 | - | |||||||||||||||||||||||||||||||
592 | void QListWidgetPrivate::_q_emitItemClicked(const QModelIndex &index) | - | ||||||||||||||||||||||||||||||
593 | { | - | ||||||||||||||||||||||||||||||
594 | QListWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||
595 | q->itemClicked(listModel()->at(index.row())); | - | ||||||||||||||||||||||||||||||
596 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
597 | - | |||||||||||||||||||||||||||||||
598 | void QListWidgetPrivate::_q_emitItemDoubleClicked(const QModelIndex &index) | - | ||||||||||||||||||||||||||||||
599 | { | - | ||||||||||||||||||||||||||||||
600 | QListWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||
601 | q->itemDoubleClicked(listModel()->at(index.row())); | - | ||||||||||||||||||||||||||||||
602 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
603 | - | |||||||||||||||||||||||||||||||
604 | void QListWidgetPrivate::_q_emitItemActivated(const QModelIndex &index) | - | ||||||||||||||||||||||||||||||
605 | { | - | ||||||||||||||||||||||||||||||
606 | QListWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||
607 | q->itemActivated(listModel()->at(index.row())); | - | ||||||||||||||||||||||||||||||
608 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
609 | - | |||||||||||||||||||||||||||||||
610 | void QListWidgetPrivate::_q_emitItemEntered(const QModelIndex &index) | - | ||||||||||||||||||||||||||||||
611 | { | - | ||||||||||||||||||||||||||||||
612 | QListWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||
613 | q->itemEntered(listModel()->at(index.row())); | - | ||||||||||||||||||||||||||||||
614 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
615 | - | |||||||||||||||||||||||||||||||
616 | void QListWidgetPrivate::_q_emitItemChanged(const QModelIndex &index) | - | ||||||||||||||||||||||||||||||
617 | { | - | ||||||||||||||||||||||||||||||
618 | QListWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||
619 | q->itemChanged(listModel()->at(index.row())); | - | ||||||||||||||||||||||||||||||
620 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
621 | - | |||||||||||||||||||||||||||||||
622 | void QListWidgetPrivate::_q_emitCurrentItemChanged(const QModelIndex ¤t, | - | ||||||||||||||||||||||||||||||
623 | const QModelIndex &previous) | - | ||||||||||||||||||||||||||||||
624 | { | - | ||||||||||||||||||||||||||||||
625 | QListWidget * const q = q_func(); | - | ||||||||||||||||||||||||||||||
626 | QPersistentModelIndex persistentCurrent = current; | - | ||||||||||||||||||||||||||||||
627 | QListWidgetItem *currentItem = listModel()->at(persistentCurrent.row()); | - | ||||||||||||||||||||||||||||||
628 | q->currentItemChanged(currentItem, listModel()->at(previous.row())); | - | ||||||||||||||||||||||||||||||
629 | - | |||||||||||||||||||||||||||||||
630 | - | |||||||||||||||||||||||||||||||
631 | - | |||||||||||||||||||||||||||||||
632 | if (!persistentCurrent.isValid()
| 0 | ||||||||||||||||||||||||||||||
633 | currentItem = 0; | - | ||||||||||||||||||||||||||||||
634 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
635 | - | |||||||||||||||||||||||||||||||
636 | q->currentTextChanged(currentItem ? currentItem->text() : QString()); | - | ||||||||||||||||||||||||||||||
637 | q->currentRowChanged(persistentCurrent.row()); | - | ||||||||||||||||||||||||||||||
638 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
639 | - | |||||||||||||||||||||||||||||||
640 | void QListWidgetPrivate::_q_sort() | - | ||||||||||||||||||||||||||||||
641 | { | - | ||||||||||||||||||||||||||||||
642 | if (sortingEnabled
| 0 | ||||||||||||||||||||||||||||||
643 | model->sort(0, sortOrder); never executed: model->sort(0, sortOrder); | 0 | ||||||||||||||||||||||||||||||
644 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
645 | - | |||||||||||||||||||||||||||||||
646 | void QListWidgetPrivate::_q_dataChanged(const QModelIndex &topLeft, | - | ||||||||||||||||||||||||||||||
647 | const QModelIndex &bottomRight) | - | ||||||||||||||||||||||||||||||
648 | { | - | ||||||||||||||||||||||||||||||
649 | if (sortingEnabled
| 0 | ||||||||||||||||||||||||||||||
650 | listModel()->ensureSorted(topLeft.column(), sortOrder, never executed: listModel()->ensureSorted(topLeft.column(), sortOrder, topLeft.row(), bottomRight.row()); | 0 | ||||||||||||||||||||||||||||||
651 | topLeft.row(), bottomRight.row()); never executed: listModel()->ensureSorted(topLeft.column(), sortOrder, topLeft.row(), bottomRight.row()); | 0 | ||||||||||||||||||||||||||||||
652 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
653 | QListWidget::QListWidget(QWidget *parent) | - | ||||||||||||||||||||||||||||||
654 | : QListView(*new QListWidgetPrivate(), parent) | - | ||||||||||||||||||||||||||||||
655 | { | - | ||||||||||||||||||||||||||||||
656 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
657 | d->setup(); | - | ||||||||||||||||||||||||||||||
658 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
659 | - | |||||||||||||||||||||||||||||||
660 | - | |||||||||||||||||||||||||||||||
661 | - | |||||||||||||||||||||||||||||||
662 | - | |||||||||||||||||||||||||||||||
663 | - | |||||||||||||||||||||||||||||||
664 | QListWidget::~QListWidget() | - | ||||||||||||||||||||||||||||||
665 | { | - | ||||||||||||||||||||||||||||||
666 | } | - | ||||||||||||||||||||||||||||||
667 | QListWidgetItem *QListWidget::item(int row) const | - | ||||||||||||||||||||||||||||||
668 | { | - | ||||||||||||||||||||||||||||||
669 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
670 | if (row < 0
| 0 | ||||||||||||||||||||||||||||||
671 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||
672 | return never executed: d->listModel()->at(row);return d->listModel()->at(row); never executed: return d->listModel()->at(row); | 0 | ||||||||||||||||||||||||||||||
673 | } | - | ||||||||||||||||||||||||||||||
674 | - | |||||||||||||||||||||||||||||||
675 | - | |||||||||||||||||||||||||||||||
676 | - | |||||||||||||||||||||||||||||||
677 | - | |||||||||||||||||||||||||||||||
678 | - | |||||||||||||||||||||||||||||||
679 | - | |||||||||||||||||||||||||||||||
680 | - | |||||||||||||||||||||||||||||||
681 | int QListWidget::row(const QListWidgetItem *item) const | - | ||||||||||||||||||||||||||||||
682 | { | - | ||||||||||||||||||||||||||||||
683 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
684 | return never executed: d->listModel()->index(const_cast<QListWidgetItem*>(item)).row();return d->listModel()->index(const_cast<QListWidgetItem*>(item)).row(); never executed: return d->listModel()->index(const_cast<QListWidgetItem*>(item)).row(); | 0 | ||||||||||||||||||||||||||||||
685 | } | - | ||||||||||||||||||||||||||||||
686 | void QListWidget::insertItem(int row, QListWidgetItem *item) | - | ||||||||||||||||||||||||||||||
687 | { | - | ||||||||||||||||||||||||||||||
688 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
689 | if (item
| 0 | ||||||||||||||||||||||||||||||
690 | d->listModel()->insert(row, item); never executed: d->listModel()->insert(row, item); | 0 | ||||||||||||||||||||||||||||||
691 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
692 | void QListWidget::insertItem(int row, const QString &label) | - | ||||||||||||||||||||||||||||||
693 | { | - | ||||||||||||||||||||||||||||||
694 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
695 | d->listModel()->insert(row, new QListWidgetItem(label)); | - | ||||||||||||||||||||||||||||||
696 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
697 | void QListWidget::insertItems(int row, const QStringList &labels) | - | ||||||||||||||||||||||||||||||
698 | { | - | ||||||||||||||||||||||||||||||
699 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
700 | d->listModel()->insert(row, labels); | - | ||||||||||||||||||||||||||||||
701 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
702 | QListWidgetItem *QListWidget::takeItem(int row) | - | ||||||||||||||||||||||||||||||
703 | { | - | ||||||||||||||||||||||||||||||
704 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
705 | if (row < 0
| 0 | ||||||||||||||||||||||||||||||
706 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||
707 | return never executed: d->listModel()->take(row);return d->listModel()->take(row); never executed: return d->listModel()->take(row); | 0 | ||||||||||||||||||||||||||||||
708 | } | - | ||||||||||||||||||||||||||||||
709 | - | |||||||||||||||||||||||||||||||
710 | - | |||||||||||||||||||||||||||||||
711 | - | |||||||||||||||||||||||||||||||
712 | - | |||||||||||||||||||||||||||||||
713 | - | |||||||||||||||||||||||||||||||
714 | - | |||||||||||||||||||||||||||||||
715 | int QListWidget::count() const | - | ||||||||||||||||||||||||||||||
716 | { | - | ||||||||||||||||||||||||||||||
717 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
718 | return never executed: d->model->rowCount();return d->model->rowCount(); never executed: return d->model->rowCount(); | 0 | ||||||||||||||||||||||||||||||
719 | } | - | ||||||||||||||||||||||||||||||
720 | - | |||||||||||||||||||||||||||||||
721 | - | |||||||||||||||||||||||||||||||
722 | - | |||||||||||||||||||||||||||||||
723 | - | |||||||||||||||||||||||||||||||
724 | QListWidgetItem *QListWidget::currentItem() const | - | ||||||||||||||||||||||||||||||
725 | { | - | ||||||||||||||||||||||||||||||
726 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
727 | return never executed: d->listModel()->at(currentIndex().row());return d->listModel()->at(currentIndex().row()); never executed: return d->listModel()->at(currentIndex().row()); | 0 | ||||||||||||||||||||||||||||||
728 | } | - | ||||||||||||||||||||||||||||||
729 | void QListWidget::setCurrentItem(QListWidgetItem *item) | - | ||||||||||||||||||||||||||||||
730 | { | - | ||||||||||||||||||||||||||||||
731 | setCurrentRow(row(item)); | - | ||||||||||||||||||||||||||||||
732 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
733 | - | |||||||||||||||||||||||||||||||
734 | - | |||||||||||||||||||||||||||||||
735 | - | |||||||||||||||||||||||||||||||
736 | - | |||||||||||||||||||||||||||||||
737 | - | |||||||||||||||||||||||||||||||
738 | void QListWidget::setCurrentItem(QListWidgetItem *item, QItemSelectionModel::SelectionFlags command) | - | ||||||||||||||||||||||||||||||
739 | { | - | ||||||||||||||||||||||||||||||
740 | setCurrentRow(row(item), command); | - | ||||||||||||||||||||||||||||||
741 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
742 | int QListWidget::currentRow() const | - | ||||||||||||||||||||||||||||||
743 | { | - | ||||||||||||||||||||||||||||||
744 | return never executed: currentIndex().row();return currentIndex().row(); never executed: return currentIndex().row(); | 0 | ||||||||||||||||||||||||||||||
745 | } | - | ||||||||||||||||||||||||||||||
746 | - | |||||||||||||||||||||||||||||||
747 | void QListWidget::setCurrentRow(int row) | - | ||||||||||||||||||||||||||||||
748 | { | - | ||||||||||||||||||||||||||||||
749 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
750 | QModelIndex index = d->listModel()->index(row); | - | ||||||||||||||||||||||||||||||
751 | if (d->selectionMode == SingleSelection
| 0 | ||||||||||||||||||||||||||||||
752 | selectionModel()->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect); never executed: selectionModel()->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect); | 0 | ||||||||||||||||||||||||||||||
753 | else if (d->selectionMode == NoSelection
| 0 | ||||||||||||||||||||||||||||||
754 | selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate); never executed: selectionModel()->setCurrentIndex(index, QItemSelectionModel::NoUpdate); | 0 | ||||||||||||||||||||||||||||||
755 | else | - | ||||||||||||||||||||||||||||||
756 | selectionModel()->setCurrentIndex(index, QItemSelectionModel::SelectCurrent); never executed: selectionModel()->setCurrentIndex(index, QItemSelectionModel::SelectCurrent); | 0 | ||||||||||||||||||||||||||||||
757 | } | - | ||||||||||||||||||||||||||||||
758 | - | |||||||||||||||||||||||||||||||
759 | - | |||||||||||||||||||||||||||||||
760 | - | |||||||||||||||||||||||||||||||
761 | - | |||||||||||||||||||||||||||||||
762 | - | |||||||||||||||||||||||||||||||
763 | - | |||||||||||||||||||||||||||||||
764 | void QListWidget::setCurrentRow(int row, QItemSelectionModel::SelectionFlags command) | - | ||||||||||||||||||||||||||||||
765 | { | - | ||||||||||||||||||||||||||||||
766 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
767 | d->selectionModel->setCurrentIndex(d->listModel()->index(row), command); | - | ||||||||||||||||||||||||||||||
768 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
769 | - | |||||||||||||||||||||||||||||||
770 | - | |||||||||||||||||||||||||||||||
771 | - | |||||||||||||||||||||||||||||||
772 | - | |||||||||||||||||||||||||||||||
773 | - | |||||||||||||||||||||||||||||||
774 | - | |||||||||||||||||||||||||||||||
775 | QListWidgetItem *QListWidget::itemAt(const QPoint &p) const | - | ||||||||||||||||||||||||||||||
776 | { | - | ||||||||||||||||||||||||||||||
777 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
778 | return never executed: d->listModel()->at(indexAt(p).row());return d->listModel()->at(indexAt(p).row()); never executed: return d->listModel()->at(indexAt(p).row()); | 0 | ||||||||||||||||||||||||||||||
779 | - | |||||||||||||||||||||||||||||||
780 | } | - | ||||||||||||||||||||||||||||||
781 | QRect QListWidget::visualItemRect(const QListWidgetItem *item) const | - | ||||||||||||||||||||||||||||||
782 | { | - | ||||||||||||||||||||||||||||||
783 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
784 | QModelIndex index = d->listModel()->index(const_cast<QListWidgetItem*>(item)); | - | ||||||||||||||||||||||||||||||
785 | return never executed: visualRect(index);return visualRect(index); never executed: return visualRect(index); | 0 | ||||||||||||||||||||||||||||||
786 | } | - | ||||||||||||||||||||||||||||||
787 | - | |||||||||||||||||||||||||||||||
788 | - | |||||||||||||||||||||||||||||||
789 | - | |||||||||||||||||||||||||||||||
790 | - | |||||||||||||||||||||||||||||||
791 | void QListWidget::sortItems(Qt::SortOrder order) | - | ||||||||||||||||||||||||||||||
792 | { | - | ||||||||||||||||||||||||||||||
793 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
794 | d->sortOrder = order; | - | ||||||||||||||||||||||||||||||
795 | d->listModel()->sort(0, order); | - | ||||||||||||||||||||||||||||||
796 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
797 | void QListWidget::setSortingEnabled(bool enable) | - | ||||||||||||||||||||||||||||||
798 | { | - | ||||||||||||||||||||||||||||||
799 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
800 | d->sortingEnabled = enable; | - | ||||||||||||||||||||||||||||||
801 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
802 | - | |||||||||||||||||||||||||||||||
803 | bool QListWidget::isSortingEnabled() const | - | ||||||||||||||||||||||||||||||
804 | { | - | ||||||||||||||||||||||||||||||
805 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
806 | return never executed: d->sortingEnabled;return d->sortingEnabled; never executed: return d->sortingEnabled; | 0 | ||||||||||||||||||||||||||||||
807 | } | - | ||||||||||||||||||||||||||||||
808 | - | |||||||||||||||||||||||||||||||
809 | - | |||||||||||||||||||||||||||||||
810 | - | |||||||||||||||||||||||||||||||
811 | - | |||||||||||||||||||||||||||||||
812 | Qt::SortOrder QListWidget::sortOrder() const | - | ||||||||||||||||||||||||||||||
813 | { | - | ||||||||||||||||||||||||||||||
814 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
815 | return never executed: d->sortOrder;return d->sortOrder; never executed: return d->sortOrder; | 0 | ||||||||||||||||||||||||||||||
816 | } | - | ||||||||||||||||||||||||||||||
817 | - | |||||||||||||||||||||||||||||||
818 | - | |||||||||||||||||||||||||||||||
819 | - | |||||||||||||||||||||||||||||||
820 | - | |||||||||||||||||||||||||||||||
821 | - | |||||||||||||||||||||||||||||||
822 | void QListWidget::editItem(QListWidgetItem *item) | - | ||||||||||||||||||||||||||||||
823 | { | - | ||||||||||||||||||||||||||||||
824 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
825 | edit(d->listModel()->index(item)); | - | ||||||||||||||||||||||||||||||
826 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
827 | - | |||||||||||||||||||||||||||||||
828 | - | |||||||||||||||||||||||||||||||
829 | - | |||||||||||||||||||||||||||||||
830 | - | |||||||||||||||||||||||||||||||
831 | - | |||||||||||||||||||||||||||||||
832 | - | |||||||||||||||||||||||||||||||
833 | - | |||||||||||||||||||||||||||||||
834 | void QListWidget::openPersistentEditor(QListWidgetItem *item) | - | ||||||||||||||||||||||||||||||
835 | { | - | ||||||||||||||||||||||||||||||
836 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
837 | QModelIndex index = d->listModel()->index(item); | - | ||||||||||||||||||||||||||||||
838 | QAbstractItemView::openPersistentEditor(index); | - | ||||||||||||||||||||||||||||||
839 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
840 | - | |||||||||||||||||||||||||||||||
841 | - | |||||||||||||||||||||||||||||||
842 | - | |||||||||||||||||||||||||||||||
843 | - | |||||||||||||||||||||||||||||||
844 | - | |||||||||||||||||||||||||||||||
845 | - | |||||||||||||||||||||||||||||||
846 | void QListWidget::closePersistentEditor(QListWidgetItem *item) | - | ||||||||||||||||||||||||||||||
847 | { | - | ||||||||||||||||||||||||||||||
848 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
849 | QModelIndex index = d->listModel()->index(item); | - | ||||||||||||||||||||||||||||||
850 | QAbstractItemView::closePersistentEditor(index); | - | ||||||||||||||||||||||||||||||
851 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
852 | QWidget *QListWidget::itemWidget(QListWidgetItem *item) const | - | ||||||||||||||||||||||||||||||
853 | { | - | ||||||||||||||||||||||||||||||
854 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
855 | QModelIndex index = d->listModel()->index(item); | - | ||||||||||||||||||||||||||||||
856 | return never executed: QAbstractItemView::indexWidget(index);return QAbstractItemView::indexWidget(index); never executed: return QAbstractItemView::indexWidget(index); | 0 | ||||||||||||||||||||||||||||||
857 | } | - | ||||||||||||||||||||||||||||||
858 | void QListWidget::setItemWidget(QListWidgetItem *item, QWidget *widget) | - | ||||||||||||||||||||||||||||||
859 | { | - | ||||||||||||||||||||||||||||||
860 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
861 | QModelIndex index = d->listModel()->index(item); | - | ||||||||||||||||||||||||||||||
862 | QAbstractItemView::setIndexWidget(index, widget); | - | ||||||||||||||||||||||||||||||
863 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
864 | bool QListWidget::isItemSelected(const QListWidgetItem *item) const | - | ||||||||||||||||||||||||||||||
865 | { | - | ||||||||||||||||||||||||||||||
866 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
867 | QModelIndex index = d->listModel()->index(const_cast<QListWidgetItem*>(item)); | - | ||||||||||||||||||||||||||||||
868 | return never executed: selectionModel()->isSelected(index);return selectionModel()->isSelected(index); never executed: return selectionModel()->isSelected(index); | 0 | ||||||||||||||||||||||||||||||
869 | } | - | ||||||||||||||||||||||||||||||
870 | void QListWidget::setItemSelected(const QListWidgetItem *item, bool select) | - | ||||||||||||||||||||||||||||||
871 | { | - | ||||||||||||||||||||||||||||||
872 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
873 | QModelIndex index = d->listModel()->index(const_cast<QListWidgetItem*>(item)); | - | ||||||||||||||||||||||||||||||
874 | - | |||||||||||||||||||||||||||||||
875 | if (d->selectionMode == SingleSelection
| 0 | ||||||||||||||||||||||||||||||
876 | selectionModel()->select(index, select | - | ||||||||||||||||||||||||||||||
877 | ? QItemSelectionModel::ClearAndSelect | - | ||||||||||||||||||||||||||||||
878 | : QItemSelectionModel::Deselect); | - | ||||||||||||||||||||||||||||||
879 | } never executed: else if (d->selectionMode != NoSelectionend of block
| 0 | ||||||||||||||||||||||||||||||
880 | selectionModel()->select(index, select | - | ||||||||||||||||||||||||||||||
881 | ? QItemSelectionModel::Select | - | ||||||||||||||||||||||||||||||
882 | : QItemSelectionModel::Deselect); | - | ||||||||||||||||||||||||||||||
883 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
884 | - | |||||||||||||||||||||||||||||||
885 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
886 | - | |||||||||||||||||||||||||||||||
887 | - | |||||||||||||||||||||||||||||||
888 | - | |||||||||||||||||||||||||||||||
889 | - | |||||||||||||||||||||||||||||||
890 | - | |||||||||||||||||||||||||||||||
891 | QList<QListWidgetItem*> QListWidget::selectedItems() const | - | ||||||||||||||||||||||||||||||
892 | { | - | ||||||||||||||||||||||||||||||
893 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
894 | QModelIndexList indexes = selectionModel()->selectedIndexes(); | - | ||||||||||||||||||||||||||||||
895 | QList<QListWidgetItem*> items; | - | ||||||||||||||||||||||||||||||
896 | const int numIndexes = indexes.count(); | - | ||||||||||||||||||||||||||||||
897 | items.reserve(numIndexes); | - | ||||||||||||||||||||||||||||||
898 | for (int i = 0; i < numIndexes
| 0 | ||||||||||||||||||||||||||||||
899 | items.append(d->listModel()->at(indexes.at(i).row())); never executed: items.append(d->listModel()->at(indexes.at(i).row())); | 0 | ||||||||||||||||||||||||||||||
900 | return never executed: items;return items; never executed: return items; | 0 | ||||||||||||||||||||||||||||||
901 | } | - | ||||||||||||||||||||||||||||||
902 | - | |||||||||||||||||||||||||||||||
903 | - | |||||||||||||||||||||||||||||||
904 | - | |||||||||||||||||||||||||||||||
905 | - | |||||||||||||||||||||||||||||||
906 | - | |||||||||||||||||||||||||||||||
907 | - | |||||||||||||||||||||||||||||||
908 | QList<QListWidgetItem*> QListWidget::findItems(const QString &text, Qt::MatchFlags flags) const | - | ||||||||||||||||||||||||||||||
909 | { | - | ||||||||||||||||||||||||||||||
910 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
911 | QModelIndexList indexes = d->listModel()->match(model()->index(0, 0, QModelIndex()), | - | ||||||||||||||||||||||||||||||
912 | Qt::DisplayRole, text, -1, flags); | - | ||||||||||||||||||||||||||||||
913 | QList<QListWidgetItem*> items; | - | ||||||||||||||||||||||||||||||
914 | const int indexesSize = indexes.size(); | - | ||||||||||||||||||||||||||||||
915 | items.reserve(indexesSize); | - | ||||||||||||||||||||||||||||||
916 | for (int i = 0; i < indexesSize
| 0 | ||||||||||||||||||||||||||||||
917 | items.append(d->listModel()->at(indexes.at(i).row())); never executed: items.append(d->listModel()->at(indexes.at(i).row())); | 0 | ||||||||||||||||||||||||||||||
918 | return never executed: items;return items; never executed: return items; | 0 | ||||||||||||||||||||||||||||||
919 | } | - | ||||||||||||||||||||||||||||||
920 | bool QListWidget::isItemHidden(const QListWidgetItem *item) const | - | ||||||||||||||||||||||||||||||
921 | { | - | ||||||||||||||||||||||||||||||
922 | return never executed: isRowHidden(row(item));return isRowHidden(row(item)); never executed: return isRowHidden(row(item)); | 0 | ||||||||||||||||||||||||||||||
923 | } | - | ||||||||||||||||||||||||||||||
924 | void QListWidget::setItemHidden(const QListWidgetItem *item, bool hide) | - | ||||||||||||||||||||||||||||||
925 | { | - | ||||||||||||||||||||||||||||||
926 | setRowHidden(row(item), hide); | - | ||||||||||||||||||||||||||||||
927 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
928 | - | |||||||||||||||||||||||||||||||
929 | - | |||||||||||||||||||||||||||||||
930 | - | |||||||||||||||||||||||||||||||
931 | - | |||||||||||||||||||||||||||||||
932 | - | |||||||||||||||||||||||||||||||
933 | - | |||||||||||||||||||||||||||||||
934 | - | |||||||||||||||||||||||||||||||
935 | void QListWidget::scrollToItem(const QListWidgetItem *item, QAbstractItemView::ScrollHint hint) | - | ||||||||||||||||||||||||||||||
936 | { | - | ||||||||||||||||||||||||||||||
937 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
938 | QModelIndex index = d->listModel()->index(const_cast<QListWidgetItem*>(item)); | - | ||||||||||||||||||||||||||||||
939 | QListView::scrollTo(index, hint); | - | ||||||||||||||||||||||||||||||
940 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
941 | - | |||||||||||||||||||||||||||||||
942 | - | |||||||||||||||||||||||||||||||
943 | - | |||||||||||||||||||||||||||||||
944 | - | |||||||||||||||||||||||||||||||
945 | - | |||||||||||||||||||||||||||||||
946 | - | |||||||||||||||||||||||||||||||
947 | void QListWidget::clear() | - | ||||||||||||||||||||||||||||||
948 | { | - | ||||||||||||||||||||||||||||||
949 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
950 | selectionModel()->clear(); | - | ||||||||||||||||||||||||||||||
951 | d->listModel()->clear(); | - | ||||||||||||||||||||||||||||||
952 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
953 | - | |||||||||||||||||||||||||||||||
954 | - | |||||||||||||||||||||||||||||||
955 | - | |||||||||||||||||||||||||||||||
956 | - | |||||||||||||||||||||||||||||||
957 | - | |||||||||||||||||||||||||||||||
958 | - | |||||||||||||||||||||||||||||||
959 | - | |||||||||||||||||||||||||||||||
960 | QStringList QListWidget::mimeTypes() const | - | ||||||||||||||||||||||||||||||
961 | { | - | ||||||||||||||||||||||||||||||
962 | return never executed: d_func()->listModel()->QAbstractListModel::mimeTypes();return d_func()->listModel()->QAbstractListModel::mimeTypes(); never executed: return d_func()->listModel()->QAbstractListModel::mimeTypes(); | 0 | ||||||||||||||||||||||||||||||
963 | } | - | ||||||||||||||||||||||||||||||
964 | QMimeData *QListWidget::mimeData(const QList<QListWidgetItem*> items) const | - | ||||||||||||||||||||||||||||||
965 | - | |||||||||||||||||||||||||||||||
966 | { | - | ||||||||||||||||||||||||||||||
967 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
968 | - | |||||||||||||||||||||||||||||||
969 | QModelIndexList &cachedIndexes = d->listModel()->cachedIndexes; | - | ||||||||||||||||||||||||||||||
970 | - | |||||||||||||||||||||||||||||||
971 | - | |||||||||||||||||||||||||||||||
972 | if (cachedIndexes.isEmpty()
| 0 | ||||||||||||||||||||||||||||||
973 | cachedIndexes.reserve(items.count()); | - | ||||||||||||||||||||||||||||||
974 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(items)>::type> _container_((items)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QListWidgetItem *item = *_container_.i; _container_.control; _container_.control = 0) | - | ||||||||||||||||||||||||||||||
975 | cachedIndexes << indexFromItem(item); never executed: cachedIndexes << indexFromItem(item); | 0 | ||||||||||||||||||||||||||||||
976 | - | |||||||||||||||||||||||||||||||
977 | QMimeData *result = d->listModel()->internalMimeData(); | - | ||||||||||||||||||||||||||||||
978 | - | |||||||||||||||||||||||||||||||
979 | cachedIndexes.clear(); | - | ||||||||||||||||||||||||||||||
980 | return never executed: result;return result; never executed: return result; | 0 | ||||||||||||||||||||||||||||||
981 | } | - | ||||||||||||||||||||||||||||||
982 | - | |||||||||||||||||||||||||||||||
983 | return never executed: d->listModel()->internalMimeData();return d->listModel()->internalMimeData(); never executed: return d->listModel()->internalMimeData(); | 0 | ||||||||||||||||||||||||||||||
984 | } | - | ||||||||||||||||||||||||||||||
985 | bool QListWidget::dropMimeData(int index, const QMimeData *data, Qt::DropAction action) | - | ||||||||||||||||||||||||||||||
986 | { | - | ||||||||||||||||||||||||||||||
987 | QModelIndex idx; | - | ||||||||||||||||||||||||||||||
988 | int row = index; | - | ||||||||||||||||||||||||||||||
989 | int column = 0; | - | ||||||||||||||||||||||||||||||
990 | if (dropIndicatorPosition() == QAbstractItemView::OnItem
| 0 | ||||||||||||||||||||||||||||||
991 | - | |||||||||||||||||||||||||||||||
992 | idx = model()->index(row, column); | - | ||||||||||||||||||||||||||||||
993 | row = -1; | - | ||||||||||||||||||||||||||||||
994 | column = -1; | - | ||||||||||||||||||||||||||||||
995 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
996 | return never executed: d_func()->listModel()->QAbstractListModel::dropMimeData(data, action , row, column, idx);return d_func()->listModel()->QAbstractListModel::dropMimeData(data, action , row, column, idx); never executed: return d_func()->listModel()->QAbstractListModel::dropMimeData(data, action , row, column, idx); | 0 | ||||||||||||||||||||||||||||||
997 | } | - | ||||||||||||||||||||||||||||||
998 | - | |||||||||||||||||||||||||||||||
999 | - | |||||||||||||||||||||||||||||||
1000 | void QListWidget::dropEvent(QDropEvent *event) { | - | ||||||||||||||||||||||||||||||
1001 | QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
1002 | if (event->source() == this
| 0 | ||||||||||||||||||||||||||||||
1003 | QListView::dropEvent(event); | - | ||||||||||||||||||||||||||||||
1004 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
1005 | } | - | ||||||||||||||||||||||||||||||
1006 | - | |||||||||||||||||||||||||||||||
1007 | if (event->source() == this
| 0 | ||||||||||||||||||||||||||||||
1008 | dragDropMode() == QAbstractItemView::InternalMove
| 0 | ||||||||||||||||||||||||||||||
1009 | QModelIndex topIndex; | - | ||||||||||||||||||||||||||||||
1010 | int col = -1; | - | ||||||||||||||||||||||||||||||
1011 | int row = -1; | - | ||||||||||||||||||||||||||||||
1012 | if (d->dropOn(event, &row, &col, &topIndex)
| 0 | ||||||||||||||||||||||||||||||
1013 | QList<QModelIndex> selIndexes = selectedIndexes(); | - | ||||||||||||||||||||||||||||||
1014 | QList<QPersistentModelIndex> persIndexes; | - | ||||||||||||||||||||||||||||||
1015 | const int selIndexesCount = selIndexes.count(); | - | ||||||||||||||||||||||||||||||
1016 | persIndexes.reserve(selIndexesCount); | - | ||||||||||||||||||||||||||||||
1017 | for (int i = 0; i < selIndexesCount
| 0 | ||||||||||||||||||||||||||||||
1018 | persIndexes.append(selIndexes.at(i)); never executed: persIndexes.append(selIndexes.at(i)); | 0 | ||||||||||||||||||||||||||||||
1019 | - | |||||||||||||||||||||||||||||||
1020 | if (persIndexes.contains(topIndex)
| 0 | ||||||||||||||||||||||||||||||
1021 | return; never executed: return; | 0 | ||||||||||||||||||||||||||||||
1022 | std::sort(persIndexes.begin(), persIndexes.end()); | - | ||||||||||||||||||||||||||||||
1023 | - | |||||||||||||||||||||||||||||||
1024 | QPersistentModelIndex dropRow = model()->index(row, col, topIndex); | - | ||||||||||||||||||||||||||||||
1025 | - | |||||||||||||||||||||||||||||||
1026 | int r = row == -1
| 0 | ||||||||||||||||||||||||||||||
1027 | for (int i = 0; i < persIndexes.count()
| 0 | ||||||||||||||||||||||||||||||
1028 | const QPersistentModelIndex &pIndex = persIndexes.at(i); | - | ||||||||||||||||||||||||||||||
1029 | d->listModel()->move(pIndex.row(), r); | - | ||||||||||||||||||||||||||||||
1030 | r = pIndex.row() + 1; | - | ||||||||||||||||||||||||||||||
1031 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
1032 | - | |||||||||||||||||||||||||||||||
1033 | event->accept(); | - | ||||||||||||||||||||||||||||||
1034 | - | |||||||||||||||||||||||||||||||
1035 | event->setDropAction(Qt::CopyAction); | - | ||||||||||||||||||||||||||||||
1036 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
1037 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
1038 | - | |||||||||||||||||||||||||||||||
1039 | QListView::dropEvent(event); | - | ||||||||||||||||||||||||||||||
1040 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
1041 | - | |||||||||||||||||||||||||||||||
1042 | - | |||||||||||||||||||||||||||||||
1043 | - | |||||||||||||||||||||||||||||||
1044 | - | |||||||||||||||||||||||||||||||
1045 | - | |||||||||||||||||||||||||||||||
1046 | - | |||||||||||||||||||||||||||||||
1047 | Qt::DropActions QListWidget::supportedDropActions() const | - | ||||||||||||||||||||||||||||||
1048 | { | - | ||||||||||||||||||||||||||||||
1049 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
1050 | return never executed: d->listModel()->QAbstractListModel::supportedDropActions() | Qt::MoveAction;return d->listModel()->QAbstractListModel::supportedDropActions() | Qt::MoveAction; never executed: return d->listModel()->QAbstractListModel::supportedDropActions() | Qt::MoveAction; | 0 | ||||||||||||||||||||||||||||||
1051 | } | - | ||||||||||||||||||||||||||||||
1052 | - | |||||||||||||||||||||||||||||||
1053 | - | |||||||||||||||||||||||||||||||
1054 | - | |||||||||||||||||||||||||||||||
1055 | - | |||||||||||||||||||||||||||||||
1056 | - | |||||||||||||||||||||||||||||||
1057 | - | |||||||||||||||||||||||||||||||
1058 | - | |||||||||||||||||||||||||||||||
1059 | QList<QListWidgetItem*> QListWidget::items(const QMimeData *data) const | - | ||||||||||||||||||||||||||||||
1060 | { | - | ||||||||||||||||||||||||||||||
1061 | const QListWidgetMimeData *lwd = qobject_cast<const QListWidgetMimeData*>(data); | - | ||||||||||||||||||||||||||||||
1062 | if (lwd
| 0 | ||||||||||||||||||||||||||||||
1063 | return never executed: lwd->items;return lwd->items; never executed: return lwd->items; | 0 | ||||||||||||||||||||||||||||||
1064 | return never executed: QList<QListWidgetItem*>();return QList<QListWidgetItem*>(); never executed: return QList<QListWidgetItem*>(); | 0 | ||||||||||||||||||||||||||||||
1065 | } | - | ||||||||||||||||||||||||||||||
1066 | - | |||||||||||||||||||||||||||||||
1067 | - | |||||||||||||||||||||||||||||||
1068 | - | |||||||||||||||||||||||||||||||
1069 | - | |||||||||||||||||||||||||||||||
1070 | - | |||||||||||||||||||||||||||||||
1071 | QModelIndex QListWidget::indexFromItem(QListWidgetItem *item) const | - | ||||||||||||||||||||||||||||||
1072 | { | - | ||||||||||||||||||||||||||||||
1073 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
1074 | return never executed: d->listModel()->index(item);return d->listModel()->index(item); never executed: return d->listModel()->index(item); | 0 | ||||||||||||||||||||||||||||||
1075 | } | - | ||||||||||||||||||||||||||||||
1076 | - | |||||||||||||||||||||||||||||||
1077 | - | |||||||||||||||||||||||||||||||
1078 | - | |||||||||||||||||||||||||||||||
1079 | - | |||||||||||||||||||||||||||||||
1080 | - | |||||||||||||||||||||||||||||||
1081 | QListWidgetItem *QListWidget::itemFromIndex(const QModelIndex &index) const | - | ||||||||||||||||||||||||||||||
1082 | { | - | ||||||||||||||||||||||||||||||
1083 | const QListWidgetPrivate * const d = d_func(); | - | ||||||||||||||||||||||||||||||
1084 | if (d->isIndexValid(index)
| 0 | ||||||||||||||||||||||||||||||
1085 | return never executed: d->listModel()->at(index.row());return d->listModel()->at(index.row()); never executed: return d->listModel()->at(index.row()); | 0 | ||||||||||||||||||||||||||||||
1086 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||||||||
1087 | } | - | ||||||||||||||||||||||||||||||
1088 | - | |||||||||||||||||||||||||||||||
1089 | - | |||||||||||||||||||||||||||||||
1090 | - | |||||||||||||||||||||||||||||||
1091 | - | |||||||||||||||||||||||||||||||
1092 | void QListWidget::setModel(QAbstractItemModel * ) | - | ||||||||||||||||||||||||||||||
1093 | { | - | ||||||||||||||||||||||||||||||
1094 | ((!(!"QListWidget::setModel() - Changing the model of the QListWidget is not allowed.")) ? qt_assert("!\"QListWidget::setModel() - Changing the model of the QListWidget is not allowed.\"",__FILE__,1937) : qt_noop()); | - | ||||||||||||||||||||||||||||||
1095 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
1096 | - | |||||||||||||||||||||||||||||||
1097 | - | |||||||||||||||||||||||||||||||
1098 | - | |||||||||||||||||||||||||||||||
1099 | - | |||||||||||||||||||||||||||||||
1100 | bool QListWidget::event(QEvent *e) | - | ||||||||||||||||||||||||||||||
1101 | { | - | ||||||||||||||||||||||||||||||
1102 | return never executed: QListView::event(e);return QListView::event(e); never executed: return QListView::event(e); | 0 | ||||||||||||||||||||||||||||||
1103 | } | - | ||||||||||||||||||||||||||||||
1104 | - | |||||||||||||||||||||||||||||||
1105 | - | |||||||||||||||||||||||||||||||
1106 | - | |||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |