OpenCoverage

qtreewidgetitemiterator.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/itemviews/qtreewidgetitemiterator.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtWidgets module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include <private/qtreewidgetitemiterator_p.h>-
41#include "qtreewidget.h"-
42#include "qtreewidget_p.h"-
43#include "qwidgetitemdata_p.h"-
44-
45#ifndef QT_NO_TREEWIDGET-
46-
47QT_BEGIN_NAMESPACE-
48-
49/*!-
50 \class QTreeWidgetItemIterator-
51 \ingroup model-view-
52 \inmodule QtWidgets-
53-
54 \brief The QTreeWidgetItemIterator class provides a way to iterate over the-
55 items in a QTreeWidget instance.-
56-
57 The iterator will walk the items in a pre-order traversal order, thus visiting the-
58 parent node \e before it continues to the child nodes.-
59-
60 For example, the following code examples each item in a tree, checking the-
61 text in the first column against a user-specified search string:-
62-
63 \snippet qtreewidgetitemiterator-using/mainwindow.cpp 0-
64-
65 It is also possible to filter out certain types of node by passing certain-
66 \l{IteratorFlag}{flags} to the constructor of QTreeWidgetItemIterator.-
67-
68 \sa QTreeWidget, {Model/View Programming}, QTreeWidgetItem-
69*/-
70-
71/*!-
72 Constructs an iterator for the same QTreeWidget as \a it. The-
73 current iterator item is set to point on the current item of \a it.-
74*/-
75-
76QTreeWidgetItemIterator::QTreeWidgetItemIterator(const QTreeWidgetItemIterator &it)-
77 : d_ptr(new QTreeWidgetItemIteratorPrivate(*(it.d_ptr))),-
78 current(it.current), flags(it.flags)-
79{-
80 Q_D(QTreeWidgetItemIterator);-
81 Q_ASSERT(d->m_model);-
82 d->m_model->iterators.append(this);-
83}
never executed: end of block
0
84-
85/*!-
86 Constructs an iterator for the given \a widget that uses the specified \a flags-
87 to determine which items are found during iteration.-
88 The iterator is set to point to the first top-level item contained in the widget,-
89 or the next matching item if the top-level item doesn't match the flags.-
90-
91 \sa QTreeWidgetItemIterator::IteratorFlag-
92*/-
93-
94QTreeWidgetItemIterator::QTreeWidgetItemIterator(QTreeWidget *widget, IteratorFlags flags)-
95: current(0), flags(flags)-
96{-
97 Q_ASSERT(widget);-
98 QTreeModel *model = qobject_cast<QTreeModel*>(widget->model());-
99 Q_ASSERT(model);-
100 d_ptr.reset(new QTreeWidgetItemIteratorPrivate(this, model));-
101 model->iterators.append(this);-
102 if (!model->rootItem->children.isEmpty()) current = model->rootItem->child(0);
never executed: current = model->rootItem->child(0);
!model->rootIt...dren.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
0
103 if (current && !matchesFlags(current))
currentDescription
TRUEnever evaluated
FALSEnever evaluated
!matchesFlags(current)Description
TRUEnever evaluated
FALSEnever evaluated
0
104 ++(*this);
never executed: ++(*this);
0
105}
never executed: end of block
0
106-
107/*!-
108 Constructs an iterator for the given \a item that uses the specified \a flags-
109 to determine which items are found during iteration.-
110 The iterator is set to point to \a item, or the next matching item if \a item-
111 doesn't match the flags.-
112-
113 \sa QTreeWidgetItemIterator::IteratorFlag-
114*/-
115-
116QTreeWidgetItemIterator::QTreeWidgetItemIterator(QTreeWidgetItem *item, IteratorFlags flags)-
117 : d_ptr(new QTreeWidgetItemIteratorPrivate(-
118 this, qobject_cast<QTreeModel*>(item->view->model()))),-
119 current(item), flags(flags)-
120{-
121 Q_D(QTreeWidgetItemIterator);-
122 Q_ASSERT(item);-
123 QTreeModel *model = qobject_cast<QTreeModel*>(item->view->model());-
124 Q_ASSERT(model);-
125 model->iterators.append(this);-
126-
127 // Initialize m_currentIndex and m_parentIndex as it would be if we had traversed from-
128 // the beginning.-
129 QTreeWidgetItem *parent = item;-
130 parent = parent->parent();-
131 QTreeWidgetItem *root = d->m_model->rootItem;-
132 d->m_currentIndex = (parent ? parent : root)->indexOfChild(item);
parentDescription
TRUEnever evaluated
FALSEnever evaluated
0
133-
134 while (parent) {
parentDescription
TRUEnever evaluated
FALSEnever evaluated
0
135 QTreeWidgetItem *itm = parent;-
136 parent = parent->parent();-
137 const int index = (parent ? parent : root)->indexOfChild(itm);
parentDescription
TRUEnever evaluated
FALSEnever evaluated
0
138 d->m_parentIndex.prepend(index);-
139 }
never executed: end of block
0
140-
141 if (current && !matchesFlags(current))
currentDescription
TRUEnever evaluated
FALSEnever evaluated
!matchesFlags(current)Description
TRUEnever evaluated
FALSEnever evaluated
0
142 ++(*this);
never executed: ++(*this);
0
143}
never executed: end of block
0
144-
145/*!-
146 Destroys the iterator.-
147*/-
148-
149QTreeWidgetItemIterator::~QTreeWidgetItemIterator()-
150{-
151 d_func()->m_model->iterators.removeAll(this);-
152}
never executed: end of block
0
153-
154/*!-
155 Assignment. Makes a copy of \a it and returns a reference to its-
156 iterator.-
157*/-
158-
159QTreeWidgetItemIterator &QTreeWidgetItemIterator::operator=(const QTreeWidgetItemIterator &it)-
160{-
161 Q_D(QTreeWidgetItemIterator);-
162 if (d_func()->m_model != it.d_func()->m_model) {
d_func()->m_mo...unc()->m_modelDescription
TRUEnever evaluated
FALSEnever evaluated
0
163 d_func()->m_model->iterators.removeAll(this);-
164 it.d_func()->m_model->iterators.append(this);-
165 }
never executed: end of block
0
166 current = it.current;-
167 flags = it.flags;-
168 d->operator=(*it.d_func());-
169 return *this;
never executed: return *this;
0
170}-
171-
172/*!-
173 The prefix ++ operator (++it) advances the iterator to the next matching item-
174 and returns a reference to the resulting iterator.-
175 Sets the current pointer to 0 if the current item is the last matching item.-
176*/-
177-
178QTreeWidgetItemIterator &QTreeWidgetItemIterator::operator++()-
179{-
180 if (current)
currentDescription
TRUEnever evaluated
FALSEnever evaluated
0
181 do {-
182 current = d_func()->next(current);-
183 } while (current && !matchesFlags(current));
never executed: end of block
currentDescription
TRUEnever evaluated
FALSEnever evaluated
!matchesFlags(current)Description
TRUEnever evaluated
FALSEnever evaluated
0
184 return *this;
never executed: return *this;
0
185}-
186-
187/*!-
188 The prefix -- operator (--it) advances the iterator to the previous matching item-
189 and returns a reference to the resulting iterator.-
190 Sets the current pointer to 0 if the current item is the first matching item.-
191*/-
192-
193QTreeWidgetItemIterator &QTreeWidgetItemIterator::operator--()-
194{-
195 if (current)
currentDescription
TRUEnever evaluated
FALSEnever evaluated
0
196 do {-
197 current = d_func()->previous(current);-
198 } while (current && !matchesFlags(current));
never executed: end of block
currentDescription
TRUEnever evaluated
FALSEnever evaluated
!matchesFlags(current)Description
TRUEnever evaluated
FALSEnever evaluated
0
199 return *this;
never executed: return *this;
0
200}-
201-
202/*!-
203 \internal-
204*/-
205bool QTreeWidgetItemIterator::matchesFlags(const QTreeWidgetItem *item) const-
206{-
207 if (!item)
!itemDescription
TRUEnever evaluated
FALSEnever evaluated
0
208 return false;
never executed: return false;
0
209-
210 if (flags == All)
flags == AllDescription
TRUEnever evaluated
FALSEnever evaluated
0
211 return true;
never executed: return true;
0
212-
213 {-
214 Qt::ItemFlags itemFlags = item->flags();-
215 if ((flags & Selectable) && !(itemFlags & Qt::ItemIsSelectable))
(flags & Selectable)Description
TRUEnever evaluated
FALSEnever evaluated
!(itemFlags & ...mIsSelectable)Description
TRUEnever evaluated
FALSEnever evaluated
0
216 return false;
never executed: return false;
0
217 if ((flags & NotSelectable) && (itemFlags & Qt::ItemIsSelectable))
(flags & NotSelectable)Description
TRUEnever evaluated
FALSEnever evaluated
(itemFlags & Q...mIsSelectable)Description
TRUEnever evaluated
FALSEnever evaluated
0
218 return false;
never executed: return false;
0
219 if ((flags & DragEnabled) && !(itemFlags & Qt::ItemIsDragEnabled))
(flags & DragEnabled)Description
TRUEnever evaluated
FALSEnever evaluated
!(itemFlags & ...IsDragEnabled)Description
TRUEnever evaluated
FALSEnever evaluated
0
220 return false;
never executed: return false;
0
221 if ((flags & DragDisabled) && (itemFlags & Qt::ItemIsDragEnabled))
(flags & DragDisabled)Description
TRUEnever evaluated
FALSEnever evaluated
(itemFlags & Q...IsDragEnabled)Description
TRUEnever evaluated
FALSEnever evaluated
0
222 return false;
never executed: return false;
0
223 if ((flags & DropEnabled) && !(itemFlags & Qt::ItemIsDropEnabled))
(flags & DropEnabled)Description
TRUEnever evaluated
FALSEnever evaluated
!(itemFlags & ...IsDropEnabled)Description
TRUEnever evaluated
FALSEnever evaluated
0
224 return false;
never executed: return false;
0
225 if ((flags & DropDisabled) && (itemFlags & Qt::ItemIsDropEnabled))
(flags & DropDisabled)Description
TRUEnever evaluated
FALSEnever evaluated
(itemFlags & Q...IsDropEnabled)Description
TRUEnever evaluated
FALSEnever evaluated
0
226 return false;
never executed: return false;
0
227 if ((flags & Enabled) && !(itemFlags & Qt::ItemIsEnabled))
(flags & Enabled)Description
TRUEnever evaluated
FALSEnever evaluated
!(itemFlags & ...ItemIsEnabled)Description
TRUEnever evaluated
FALSEnever evaluated
0
228 return false;
never executed: return false;
0
229 if ((flags & Disabled) && (itemFlags & Qt::ItemIsEnabled))
(flags & Disabled)Description
TRUEnever evaluated
FALSEnever evaluated
(itemFlags & Q...ItemIsEnabled)Description
TRUEnever evaluated
FALSEnever evaluated
0
230 return false;
never executed: return false;
0
231 if ((flags & Editable) && !(itemFlags & Qt::ItemIsEditable))
(flags & Editable)Description
TRUEnever evaluated
FALSEnever evaluated
!(itemFlags & ...temIsEditable)Description
TRUEnever evaluated
FALSEnever evaluated
0
232 return false;
never executed: return false;
0
233 if ((flags & NotEditable) && (itemFlags & Qt::ItemIsEditable))
(flags & NotEditable)Description
TRUEnever evaluated
FALSEnever evaluated
(itemFlags & Q...temIsEditable)Description
TRUEnever evaluated
FALSEnever evaluated
0
234 return false;
never executed: return false;
0
235 }-
236-
237 if (flags & (Checked|NotChecked)) {
flags & (Checked|NotChecked)Description
TRUEnever evaluated
FALSEnever evaluated
0
238 // ### We only test the check state for column 0-
239 Qt::CheckState check = item->checkState(0);-
240 // PartiallyChecked matches as Checked.-
241 if ((flags & Checked) && (check == Qt::Unchecked))
(flags & Checked)Description
TRUEnever evaluated
FALSEnever evaluated
(check == Qt::Unchecked)Description
TRUEnever evaluated
FALSEnever evaluated
0
242 return false;
never executed: return false;
0
243 if ((flags & NotChecked) && (check != Qt::Unchecked))
(flags & NotChecked)Description
TRUEnever evaluated
FALSEnever evaluated
(check != Qt::Unchecked)Description
TRUEnever evaluated
FALSEnever evaluated
0
244 return false;
never executed: return false;
0
245 }
never executed: end of block
0
246-
247 if ((flags & HasChildren) && !item->childCount())
(flags & HasChildren)Description
TRUEnever evaluated
FALSEnever evaluated
!item->childCount()Description
TRUEnever evaluated
FALSEnever evaluated
0
248 return false;
never executed: return false;
0
249 if ((flags & NoChildren) && item->childCount())
(flags & NoChildren)Description
TRUEnever evaluated
FALSEnever evaluated
item->childCount()Description
TRUEnever evaluated
FALSEnever evaluated
0
250 return false;
never executed: return false;
0
251-
252 if ((flags & Hidden) && !item->isHidden())
(flags & Hidden)Description
TRUEnever evaluated
FALSEnever evaluated
!item->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
0
253 return false;
never executed: return false;
0
254 if ((flags & NotHidden) && item->isHidden())
(flags & NotHidden)Description
TRUEnever evaluated
FALSEnever evaluated
item->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
0
255 return false;
never executed: return false;
0
256-
257 if ((flags & Selected) && !item->isSelected())
(flags & Selected)Description
TRUEnever evaluated
FALSEnever evaluated
!item->isSelected()Description
TRUEnever evaluated
FALSEnever evaluated
0
258 return false;
never executed: return false;
0
259 if ((flags & Unselected) && item->isSelected())
(flags & Unselected)Description
TRUEnever evaluated
FALSEnever evaluated
item->isSelected()Description
TRUEnever evaluated
FALSEnever evaluated
0
260 return false;
never executed: return false;
0
261-
262 return true;
never executed: return true;
0
263}-
264-
265/*-
266 * Implementation of QTreeWidgetItemIteratorPrivate-
267 */-
268QTreeWidgetItem* QTreeWidgetItemIteratorPrivate::nextSibling(const QTreeWidgetItem* item) const-
269{-
270 Q_ASSERT(item);-
271 QTreeWidgetItem *next = 0;-
272 if (QTreeWidgetItem *par = item->parent()) {
QTreeWidgetIte...item->parent()Description
TRUEnever evaluated
FALSEnever evaluated
0
273 int i = par->indexOfChild(const_cast<QTreeWidgetItem*>(item));-
274 next = par->child(i + 1);-
275 } else {
never executed: end of block
0
276 QTreeWidget *tw = item->treeWidget();-
277 int i = tw->indexOfTopLevelItem(const_cast<QTreeWidgetItem*>(item));-
278 next = tw->topLevelItem(i + 1);-
279 }
never executed: end of block
0
280 return next;
never executed: return next;
0
281}-
282-
283QTreeWidgetItem *QTreeWidgetItemIteratorPrivate::next(const QTreeWidgetItem *current)-
284{-
285 if (!current) return 0;
never executed: return 0;
!currentDescription
TRUEnever evaluated
FALSEnever evaluated
0
286-
287 QTreeWidgetItem *next = 0;-
288 if (current->childCount()) {
current->childCount()Description
TRUEnever evaluated
FALSEnever evaluated
0
289 // walk the child-
290 m_parentIndex.push(m_currentIndex);-
291 m_currentIndex = 0;-
292 next = current->child(0);-
293 } else {
never executed: end of block
0
294 // walk the sibling-
295 QTreeWidgetItem *parent = current->parent();-
296 next = parent ? parent->child(m_currentIndex + 1)
parentDescription
TRUEnever evaluated
FALSEnever evaluated
0
297 : m_model->rootItem->child(m_currentIndex + 1);-
298 while (!next && parent) {
!nextDescription
TRUEnever evaluated
FALSEnever evaluated
parentDescription
TRUEnever evaluated
FALSEnever evaluated
0
299 // if we had no sibling walk up the parent and try the sibling of that-
300 parent = parent->parent();-
301 m_currentIndex = m_parentIndex.pop();-
302 next = parent ? parent->child(m_currentIndex + 1)
parentDescription
TRUEnever evaluated
FALSEnever evaluated
0
303 : m_model->rootItem->child(m_currentIndex + 1);-
304 }
never executed: end of block
0
305 if (next) ++(m_currentIndex);
never executed: ++(m_currentIndex);
nextDescription
TRUEnever evaluated
FALSEnever evaluated
0
306 }
never executed: end of block
0
307 return next;
never executed: return next;
0
308}-
309-
310QTreeWidgetItem *QTreeWidgetItemIteratorPrivate::previous(const QTreeWidgetItem *current)-
311{-
312 if (!current) return 0;
never executed: return 0;
!currentDescription
TRUEnever evaluated
FALSEnever evaluated
0
313-
314 QTreeWidgetItem *prev = 0;-
315 // walk the previous sibling-
316 QTreeWidgetItem *parent = current->parent();-
317 prev = parent ? parent->child(m_currentIndex - 1)
parentDescription
TRUEnever evaluated
FALSEnever evaluated
0
318 : m_model->rootItem->child(m_currentIndex - 1);-
319 if (prev) {
prevDescription
TRUEnever evaluated
FALSEnever evaluated
0
320 // Yes, we had a previous sibling but we need go down to the last leafnode.-
321 --m_currentIndex;-
322 while (prev && prev->childCount()) {
prevDescription
TRUEnever evaluated
FALSEnever evaluated
prev->childCount()Description
TRUEnever evaluated
FALSEnever evaluated
0
323 m_parentIndex.push(m_currentIndex);-
324 m_currentIndex = prev->childCount() - 1;-
325 prev = prev->child(m_currentIndex);-
326 }
never executed: end of block
0
327 } else if (parent) {
never executed: end of block
parentDescription
TRUEnever evaluated
FALSEnever evaluated
0
328 m_currentIndex = m_parentIndex.pop();-
329 prev = parent;-
330 }
never executed: end of block
0
331 return prev;
never executed: return prev;
0
332}-
333-
334void QTreeWidgetItemIteratorPrivate::ensureValidIterator(const QTreeWidgetItem *itemToBeRemoved)-
335{-
336 Q_Q(QTreeWidgetItemIterator);-
337 Q_ASSERT(itemToBeRemoved);-
338-
339 if (!q->current) return;
never executed: return;
!q->currentDescription
TRUEnever evaluated
FALSEnever evaluated
0
340 QTreeWidgetItem *nextItem = q->current;-
341-
342 // Do not walk to the ancestor to find the other item if they have the same parent.-
343 if (nextItem->parent() != itemToBeRemoved->parent()) {
nextItem->pare...oved->parent()Description
TRUEnever evaluated
FALSEnever evaluated
0
344 while (nextItem->parent() && nextItem != itemToBeRemoved) {
nextItem->parent()Description
TRUEnever evaluated
FALSEnever evaluated
nextItem != itemToBeRemovedDescription
TRUEnever evaluated
FALSEnever evaluated
0
345 nextItem = nextItem->parent();-
346 }
never executed: end of block
0
347 }
never executed: end of block
0
348 // If the item to be removed is an ancestor of the current iterator item,-
349 // we need to adjust the iterator.-
350 if (nextItem == itemToBeRemoved) {
nextItem == itemToBeRemovedDescription
TRUEnever evaluated
FALSEnever evaluated
0
351 QTreeWidgetItem *parent = nextItem;-
352 nextItem = 0;-
353 while (parent && !nextItem) {
parentDescription
TRUEnever evaluated
FALSEnever evaluated
!nextItemDescription
TRUEnever evaluated
FALSEnever evaluated
0
354 nextItem = nextSibling(parent);-
355 parent = parent->parent();-
356 }
never executed: end of block
0
357 if (nextItem) {
nextItemDescription
TRUEnever evaluated
FALSEnever evaluated
0
358 // Ooooh... Set the iterator to the next valid item-
359 *q = QTreeWidgetItemIterator(nextItem, q->flags);-
360 if (!(q->matchesFlags(nextItem))) ++(*q);
never executed: ++(*q);
!(q->matchesFlags(nextItem))Description
TRUEnever evaluated
FALSEnever evaluated
0
361 } else {
never executed: end of block
0
362 // set it to null.-
363 q->current = 0;-
364 m_parentIndex.clear();-
365 return;
never executed: return;
0
366 }-
367 }-
368 if (nextItem->parent() == itemToBeRemoved->parent()) {
nextItem->pare...oved->parent()Description
TRUEnever evaluated
FALSEnever evaluated
0
369 // They have the same parent, i.e. we have to adjust the m_currentIndex member of the iterator-
370 // if the deleted item is to the left of the nextItem.-
371-
372 QTreeWidgetItem *par = itemToBeRemoved->parent(); // We know they both have the same parent.-
373 QTreeWidget *tw = itemToBeRemoved->treeWidget(); // ..and widget-
374 int indexOfItemToBeRemoved = par ? par->indexOfChild(const_cast<QTreeWidgetItem *>(itemToBeRemoved))
parDescription
TRUEnever evaluated
FALSEnever evaluated
0
375 : tw->indexOfTopLevelItem(const_cast<QTreeWidgetItem *>(itemToBeRemoved));-
376 int indexOfNextItem = par ? par->indexOfChild(nextItem) : tw->indexOfTopLevelItem(nextItem);
parDescription
TRUEnever evaluated
FALSEnever evaluated
0
377-
378 if (indexOfItemToBeRemoved <= indexOfNextItem) {
indexOfItemToB...ndexOfNextItemDescription
TRUEnever evaluated
FALSEnever evaluated
0
379 // A sibling to the left of us was deleted, adjust the m_currentIndex member of the iterator.-
380 // Note that the m_currentIndex will be wrong until the item is actually removed!-
381 m_currentIndex--;-
382 }
never executed: end of block
0
383 }
never executed: end of block
0
384}
never executed: end of block
0
385-
386/*!-
387 \fn const QTreeWidgetItemIterator QTreeWidgetItemIterator::operator++(int)-
388-
389 The postfix ++ operator (it++) advances the iterator to the next matching item-
390 and returns an iterator to the previously current item.-
391*/-
392-
393/*!-
394 \fn QTreeWidgetItemIterator &QTreeWidgetItemIterator::operator+=(int n)-
395-
396 Makes the iterator go forward by \a n matching items. (If n is negative, the-
397 iterator goes backward.)-
398-
399 If the current item is beyond the last item, the current item pointer is-
400 set to 0. Returns the resulting iterator.-
401*/-
402-
403/*!-
404 \fn const QTreeWidgetItemIterator QTreeWidgetItemIterator::operator--(int)-
405-
406 The postfix -- operator (it--) makes the preceding matching item current and returns an iterator to the previously current item.-
407*/-
408-
409/*!-
410 \fn QTreeWidgetItemIterator &QTreeWidgetItemIterator::operator-=(int n)-
411-
412 Makes the iterator go backward by \a n matching items. (If n is negative, the-
413 iterator goes forward.)-
414-
415 If the current item is ahead of the last item, the current item pointer is-
416 set to 0. Returns the resulting iterator.-
417*/-
418-
419/*!-
420 \fn QTreeWidgetItem *QTreeWidgetItemIterator::operator*() const-
421-
422 Dereference operator. Returns a pointer to the current item.-
423*/-
424-
425-
426/*!-
427 \enum QTreeWidgetItemIterator::IteratorFlag-
428-
429 These flags can be passed to a QTreeWidgetItemIterator constructor-
430 (OR-ed together if more than one is used), so that the iterator-
431 will only iterate over items that match the given flags.-
432-
433 \value All-
434 \value Hidden-
435 \value NotHidden-
436 \value Selected-
437 \value Unselected-
438 \value Selectable-
439 \value NotSelectable-
440 \value DragEnabled-
441 \value DragDisabled-
442 \value DropEnabled-
443 \value DropDisabled-
444 \value HasChildren-
445 \value NoChildren-
446 \value Checked-
447 \value NotChecked-
448 \value Enabled-
449 \value Disabled-
450 \value Editable-
451 \value NotEditable-
452 \value UserFlag-
453*/-
454-
455QT_END_NAMESPACE-
456-
457#endif // QT_NO_TREEWIDGET-
Source codeSwitch to Preprocessed file

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