| 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 QQUICKREPEATER_P_P_H |
| 5 | #define QQUICKREPEATER_P_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 purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include "qquickrepeater_p.h" |
| 19 | #include "qquickitem_p.h" |
| 20 | |
| 21 | #include <private/qqmldelegatemodel_p.h> |
| 22 | |
| 23 | #include <QtCore/qpointer.h> |
| 24 | |
| 25 | QT_REQUIRE_CONFIG(quick_repeater); |
| 26 | |
| 27 | QT_BEGIN_NAMESPACE |
| 28 | |
| 29 | class QQmlContext; |
| 30 | class QQmlInstanceModel; |
| 31 | class QQuickRepeaterPrivate : public QQuickItemPrivate |
| 32 | { |
| 33 | Q_DECLARE_PUBLIC(QQuickRepeater) |
| 34 | |
| 35 | public: |
| 36 | QQuickRepeaterPrivate(); |
| 37 | ~QQuickRepeaterPrivate(); |
| 38 | |
| 39 | private: |
| 40 | friend class QQmlDelegateModel; |
| 41 | |
| 42 | void requestItems(); |
| 43 | void applyDelegateChange() |
| 44 | { |
| 45 | QQmlDelegateModel::applyDelegateChangeOnView(q: q_func(), d: this); |
| 46 | } |
| 47 | void applyDelegateModelAccessChange() |
| 48 | { |
| 49 | QQmlDelegateModel::applyDelegateModelAccessChangeOnView(q: q_func(), d: this); |
| 50 | } |
| 51 | |
| 52 | void connectModel(QQuickRepeater *q, QQmlDelegateModelPointer *model); |
| 53 | void disconnectModel(QQuickRepeater *q, QQmlDelegateModelPointer *model); |
| 54 | |
| 55 | QPointer<QQmlInstanceModel> model; |
| 56 | QVariant dataSource; |
| 57 | QPointer<QObject> dataSourceAsObject; |
| 58 | bool ownModel : 1; |
| 59 | bool dataSourceIsObject : 1; |
| 60 | bool delegateValidated : 1; |
| 61 | bool explicitDelegate : 1; |
| 62 | bool explicitDelegateModelAccess : 1; |
| 63 | int itemCount; |
| 64 | |
| 65 | QVector<QPointer<QQuickItem> > deletables; |
| 66 | }; |
| 67 | |
| 68 | QT_END_NAMESPACE |
| 69 | |
| 70 | #endif // QQUICKREPEATER_P_P_H |
| 71 |
