Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquick3drepeater_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DREPEATER_P_H
5#define QQUICK3DREPEATER_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 <QtQuick3D/private/qquick3dnode_p.h>
19
20#include <QtCore/qvector.h>
21#include <QtCore/qpointer.h>
22
24class QQmlChangeSet;
25class QQmlContext;
27class QQuick3DRepeaterPrivate;
28
29class Q_QUICK3D_EXPORT QQuick3DRepeater : public QQuick3DNode
30{
32
33 Q_PROPERTY(QVariant model READ model WRITE setModel NOTIFY modelChanged)
34 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
35 Q_PROPERTY(int count READ count NOTIFY countChanged)
36 Q_CLASSINFO("DefaultProperty", "delegate")
37
38 QML_NAMED_ELEMENT(Repeater3D)
39
40public:
41 QQuick3DRepeater(QQuick3DNode *parent = nullptr);
42 ~QQuick3DRepeater() override;
43
44 QVariant model() const;
45 void setModel(const QVariant &);
46
47 QQmlComponent *delegate() const;
48 void setDelegate(QQmlComponent *);
49
50 int count() const;
51
52 Q_INVOKABLE QQuick3DObject *objectAt(int index) const;
53
55 void modelChanged();
56 void delegateChanged();
57 void countChanged();
58
59 void objectAdded(int index, QQuick3DObject *object);
60 void objectRemoved(int index, QQuick3DObject *object);
61
63 void clear();
64 void regenerate();
65
66protected:
67 void componentComplete() override;
68 void itemChange(ItemChange change, const ItemChangeData &value) override;
69 virtual void initDelegate(int, QQuick3DNode *) {}
70
71private Q_SLOTS:
72 void createdObject(int index, QObject *item);
73 void initObject(int, QObject *item);
74 void modelUpdated(const QQmlChangeSet &changeSet, bool reset);
75
76private:
77 Q_DISABLE_COPY(QQuick3DRepeater)
78
79 void requestItems();
80
81 QPointer<QQmlInstanceModel> m_model;
82 QVariant m_dataSource;
83 QPointer<QObject> m_dataSourceAsObject;
84 int m_itemCount;
85 bool m_ownModel : 1;
86 bool m_dataSourceIsObject : 1;
87 bool m_delegateValidated : 1;
88
89 QVector<QPointer<QQuick3DNode> > m_deletables;
90};
91
93
95
96#endif // QQUICK3DREPEATER_P_H
\inmodule QtCore
Definition qobject.h:103
The QQmlChangeSet class stores an ordered list of notifications about changes to a linear data set.
The QQmlComponent class encapsulates a QML component definition.
The QQmlContext class defines a context within a QML engine.
Definition qqmlcontext.h:25
\qmltype Object3D \inqmlmodule QtQuick3D \instantiates QQuick3DObject \inherits QtObject
\inmodule QtCore
Definition qvariant.h:65
b clear()
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLuint index
[2]
GLenum GLenum GLsizei count
GLboolean reset
#define QML_DECLARE_TYPE(TYPE)
Definition qqml.h:19
#define QML_NAMED_ELEMENT(NAME)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_CLASSINFO(name, value)
#define Q_INVOKABLE
#define Q_SLOTS
#define Q_SIGNALS
view setModel(model)
[17] //! [18]
QSqlQueryModel * model
[16]
QGraphicsItem * item