| 1 | // Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly <stephen.kelly@kdab.com> | 
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only | 
| 3 |  | 
| 4 | #ifndef QIDENTITYPROXYMODEL_P_H | 
| 5 | #define QIDENTITYPROXYMODEL_P_H | 
| 6 |  | 
| 7 | // | 
| 8 | //  W A R N I N G | 
| 9 | //  ------------- | 
| 10 | // | 
| 11 | // This file is not part of the Qt API.  It exists for the convenience | 
| 12 | // of QAbstractItemModel*.  This header file may change from version | 
| 13 | // to version without notice, or even be removed. | 
| 14 | // | 
| 15 | // We mean it. | 
| 16 | // | 
| 17 | // | 
| 18 |  | 
| 19 | #include <QtCore/private/qabstractproxymodel_p.h> | 
| 20 | #include <QtCore/qidentityproxymodel.h> | 
| 21 |  | 
| 22 | QT_BEGIN_NAMESPACE | 
| 23 |  | 
| 24 | class Q_CORE_EXPORT QIdentityProxyModelPrivate : public QAbstractProxyModelPrivate | 
| 25 | { | 
| 26 |     Q_DECLARE_PUBLIC(QIdentityProxyModel) | 
| 27 |  | 
| 28 | public: | 
| 29 |     QIdentityProxyModelPrivate() | 
| 30 |     { | 
| 31 |     } | 
| 32 |     ~QIdentityProxyModelPrivate() override; | 
| 33 |  | 
| 34 |     QList<QPersistentModelIndex> layoutChangePersistentIndexes; | 
| 35 |     QModelIndexList proxyIndexes; | 
| 36 |  | 
| 37 |     void sourceRowsAboutToBeInserted(const QModelIndex &parent, int start, int end); | 
| 38 |     void sourceRowsInserted(const QModelIndex &parent, int start, int end); | 
| 39 |     void sourceRowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); | 
| 40 |     void sourceRowsRemoved(const QModelIndex &parent, int start, int end); | 
| 41 |     void sourceRowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, | 
| 42 |                                   const QModelIndex &destParent, int dest); | 
| 43 |     void sourceRowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, | 
| 44 |                          const QModelIndex &destParent, int dest); | 
| 45 |  | 
| 46 |     void sourceColumnsAboutToBeInserted(const QModelIndex &parent, int start, int end); | 
| 47 |     void sourceColumnsInserted(const QModelIndex &parent, int start, int end); | 
| 48 |     void sourceColumnsAboutToBeRemoved(const QModelIndex &parent, int start, int end); | 
| 49 |     void sourceColumnsRemoved(const QModelIndex &parent, int start, int end); | 
| 50 |     void sourceColumnsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, | 
| 51 |                                      int sourceEnd, const QModelIndex &destParent, int dest); | 
| 52 |     void sourceColumnsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, | 
| 53 |                             const QModelIndex &destParent, int dest); | 
| 54 |  | 
| 55 |     void sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, | 
| 56 |                            const QList<int> &roles); | 
| 57 |     void (Qt::Orientation orientation, int first, int last); | 
| 58 |  | 
| 59 |     void sourceLayoutAboutToBeChanged(const QList<QPersistentModelIndex> &sourceParents, | 
| 60 |                                       QAbstractItemModel::LayoutChangeHint hint); | 
| 61 |     void sourceLayoutChanged(const QList<QPersistentModelIndex> &sourceParents, | 
| 62 |                              QAbstractItemModel::LayoutChangeHint hint); | 
| 63 |     void sourceModelAboutToBeReset(); | 
| 64 |     void sourceModelReset(); | 
| 65 |  | 
| 66 | private: | 
| 67 |     bool m_handleLayoutChanges = true; | 
| 68 |     bool m_handleDataChanges = true; | 
| 69 |     QVarLengthArray<QMetaObject::Connection, 18> m_sourceModelConnections; | 
| 70 | }; | 
| 71 |  | 
| 72 | QT_END_NAMESPACE | 
| 73 |  | 
| 74 | #endif // QIDENTITYPROXYMODEL_P_H | 
| 75 |  |