Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtreewidgetitemiterator_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QTREEWIDGETITEMITERATOR_P_H
6#define QTREEWIDGETITEMITERATOR_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/qstack.h>
20
22#include "private/qglobal_p.h"
23#if QT_CONFIG(treewidget)
24
25QT_BEGIN_NAMESPACE
26
27class QTreeModel;
28class QTreeWidgetItem;
29
30class QTreeWidgetItemIteratorPrivate {
31 Q_DECLARE_PUBLIC(QTreeWidgetItemIterator)
32public:
33 QTreeWidgetItemIteratorPrivate(QTreeWidgetItemIterator *q, QTreeModel *model)
34 : m_currentIndex(0), m_model(model), q_ptr(q)
35 {
36
37 }
38
39 QTreeWidgetItemIteratorPrivate(const QTreeWidgetItemIteratorPrivate& other)
40 : m_currentIndex(other.m_currentIndex), m_model(other.m_model),
41 m_parentIndex(other.m_parentIndex), q_ptr(other.q_ptr)
42 {
43
44 }
45
46 QTreeWidgetItemIteratorPrivate &operator=(const QTreeWidgetItemIteratorPrivate& other)
47 {
48 m_currentIndex = other.m_currentIndex;
49 m_parentIndex = other.m_parentIndex;
50 m_model = other.m_model;
51 return (*this);
52 }
53
54 ~QTreeWidgetItemIteratorPrivate()
55 {
56 }
57
58 QTreeWidgetItem* nextSibling(const QTreeWidgetItem* item) const;
59 void ensureValidIterator(const QTreeWidgetItem *itemToBeRemoved);
60
61 QTreeWidgetItem *next(const QTreeWidgetItem *current);
62 QTreeWidgetItem *previous(const QTreeWidgetItem *current);
63private:
64 int m_currentIndex;
65 QTreeModel *m_model; // This iterator class should not have ownership of the model.
66 QStack<int> m_parentIndex;
67 QTreeWidgetItemIterator *q_ptr;
68};
69
70QT_END_NAMESPACE
71
72#endif // QT_CONFIG(treewidget)
73
74#endif //QTREEWIDGETITEMITERATOR_P_H