| 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 |  | 
| 4 | #ifndef QABSTRACTPROXYMODEL_P_H | 
| 5 | #define QABSTRACTPROXYMODEL_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 "qabstractproxymodel.h" | 
| 20 | #include "private/qabstractitemmodel_p.h" | 
| 21 | #include "private/qproperty_p.h" | 
| 22 |  | 
| 23 | QT_REQUIRE_CONFIG(proxymodel); | 
| 24 |  | 
| 25 | QT_BEGIN_NAMESPACE | 
| 26 |  | 
| 27 | class Q_CORE_EXPORT QAbstractProxyModelPrivate : public QAbstractItemModelPrivate | 
| 28 | { | 
| 29 |     Q_DECLARE_PUBLIC(QAbstractProxyModel) | 
| 30 | public: | 
| 31 |     QAbstractProxyModelPrivate() | 
| 32 |         : QAbstractItemModelPrivate(), | 
| 33 |         sourceHadZeroRows(false), | 
| 34 |         sourceHadZeroColumns(false), | 
| 35 |         updateVerticalHeader(false), | 
| 36 |         updateHorizontalHeader(false) | 
| 37 |     {} | 
| 38 |     void setModelForwarder(QAbstractItemModel *sourceModel) | 
| 39 |     { | 
| 40 |         q_func()->setSourceModel(sourceModel); | 
| 41 |     } | 
| 42 |     void modelChangedForwarder() | 
| 43 |     { | 
| 44 |         Q_EMIT q_func()->sourceModelChanged(QAbstractProxyModel::QPrivateSignal()); | 
| 45 |     } | 
| 46 |     QAbstractItemModel *getModelForwarder() const { return q_func()->sourceModel(); } | 
| 47 |  | 
| 48 |     Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS(QAbstractProxyModelPrivate, QAbstractItemModel *, model, | 
| 49 |                                        &QAbstractProxyModelPrivate::setModelForwarder, | 
| 50 |                                        &QAbstractProxyModelPrivate::modelChangedForwarder, | 
| 51 |                                        &QAbstractProxyModelPrivate::getModelForwarder, nullptr) | 
| 52 |     virtual void _q_sourceModelDestroyed(); | 
| 53 |     void _q_sourceModelRowsAboutToBeInserted(const QModelIndex &parent, int first, int last); | 
| 54 |     void _q_sourceModelRowsInserted(const QModelIndex &parent, int first, int last); | 
| 55 |     void _q_sourceModelRowsRemoved(const QModelIndex &parent, int first, int last); | 
| 56 |     void _q_sourceModelColumnsAboutToBeInserted(const QModelIndex &parent, int first, int last); | 
| 57 |     void _q_sourceModelColumnsInserted(const QModelIndex &parent, int first, int last); | 
| 58 |     void _q_sourceModelColumnsRemoved(const QModelIndex &parent, int first, int last); | 
| 59 |  | 
| 60 |     void mapDropCoordinatesToSource(int row, int column, const QModelIndex &parent, | 
| 61 |                                     int *source_row, int *source_column, QModelIndex *source_parent) const; | 
| 62 |  | 
| 63 |     void (Qt::Orientation orientation); | 
| 64 |     void (); | 
| 65 |  | 
| 66 |     unsigned int sourceHadZeroRows : 1; | 
| 67 |     unsigned int sourceHadZeroColumns : 1; | 
| 68 |     unsigned int  : 1; | 
| 69 |     unsigned int  : 1; | 
| 70 | }; | 
| 71 |  | 
| 72 | QT_END_NAMESPACE | 
| 73 |  | 
| 74 | #endif // QABSTRACTPROXYMODEL_P_H | 
| 75 |  |