42 #include <private/qtreewidgetitemiterator_p.h> 47 #ifndef QT_NO_TREEWIDGET 85 d->m_model->iterators.append(
this);
133 parent = parent->
parent();
135 d->m_currentIndex = (parent ?
parent : root)->indexOfChild(item);
139 parent = parent->
parent();
140 const int index = (parent ?
parent : root)->indexOfChild(itm);
141 d->m_parentIndex.prepend(index);
154 d_func()->m_model->iterators.removeAll(
this);
165 if (d_func()->m_model != it.d_func()->m_model) {
166 d_func()->m_model->iterators.removeAll(
this);
167 it.d_func()->m_model->iterators.append(
this);
171 d->operator=(*it.d_func());
217 Qt::ItemFlags itemFlags = item->
flags();
276 int i = par->
indexOfChild(const_cast<QTreeWidgetItem*>(item));
277 next = par->
child(i + 1);
288 if (!current)
return 0;
293 m_parentIndex.push(m_currentIndex);
295 next = current->
child(0);
299 next = parent ? parent->
child(m_currentIndex + 1)
300 : m_model->rootItem->
child(m_currentIndex + 1);
301 while (!next && parent) {
303 parent = parent->
parent();
304 m_currentIndex = m_parentIndex.pop();
305 next = parent ? parent->
child(m_currentIndex + 1)
306 : m_model->rootItem->
child(m_currentIndex + 1);
308 if (next) ++(m_currentIndex);
315 if (!current)
return 0;
320 prev = parent ? parent->
child(m_currentIndex - 1)
321 : m_model->rootItem->
child(m_currentIndex - 1);
326 m_parentIndex.push(m_currentIndex);
328 prev = prev->
child(m_currentIndex);
331 m_currentIndex = m_parentIndex.pop();
342 if (!q->current)
return;
347 while (nextItem->
parent() && nextItem != itemToBeRemoved) {
348 nextItem = nextItem->
parent();
353 if (nextItem == itemToBeRemoved) {
356 while (parent && !nextItem) {
357 nextItem = nextSibling(parent);
358 parent = parent->
parent();
363 if (!(q->matchesFlags(nextItem))) ++(*q);
367 m_parentIndex.clear();
377 int indexOfItemToBeRemoved = par ? par->
indexOfChild(const_cast<QTreeWidgetItem *>(itemToBeRemoved))
381 if (indexOfItemToBeRemoved <= indexOfNextItem) {
475 #endif // QT_NO_TREEWIDGET T qobject_cast(QObject *object)
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
#define it(className, varName)
QTreeWidgetItem * item(const QModelIndex &index) const
Returns the tree view item corresponding to the index given.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QList< QTreeWidgetItemIterator * > iterators
QTreeWidget * view() const
QTreeWidgetItem * rootItem
friend class QTreeWidgetItemIteratorPrivate
void reset(T *other=0)
Deletes the existing object it is pointing to if any, and sets its pointer to other.
QObject * parent() const
Returns a pointer to the parent object.
QScopedPointer< QObjectData > d_ptr
QAbstractItemModel * model() const
Returns the model that this view is presenting.
Qt::ItemFlags flags(const QModelIndex &index) const
Returns the flags for the item referred to the given index.