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
instancerepeater_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the Qt API. It exists purely as an
9// implementation detail. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13//
14
15#ifndef INSTANCEREPEATER_P_H
16#define INSTANCEREPEATER_P_H
17
18#include <QtQuick3D/qquick3dinstancing.h>
19#include <QtQuick3D/private/qquick3drepeater_p.h>
20#include <QAbstractListModel>
21
22// Workaround for QTBUG-94099, ensures qml_register_types...() is exported
24
26
28{
33
34public:
36
37 QVariant data(const QModelIndex &index, int role) const override;
38 int rowCount(const QModelIndex &parent) const override;
39
40 QQuick3DInstancing *instancing() const { return m_instancing; }
42
44
48
49 QHash<int, QByteArray> roleNames() const override {
50 return {
51 { ColorRole, "modelColor" },
52 { PositionRole, "modelPosition" },
53 { RotationRole, "modelRotation"},
54 { ScaleRole, "modelScale"},
55 { CustomDataRole, "modelData"}
56 };
57 }
58
59private slots:
60 void reset();
61
64
65private:
66 void ensureTable() const;
67
68 QQuick3DInstancing *m_instancing = nullptr;
69
70 QByteArray m_instanceData;
71 int m_count = 0;
72 QMetaObject::Connection m_tableConnection;
73};
74
94#endif // INSTANCEREPEATER_P_H
int rowCount(const QModelIndex &parent) const override
Returns the number of rows under the given parent.
void setInstancing(QQuick3DInstancing *instancing)
const QQuick3DInstancing::InstanceTableEntry * instanceData(int index) const
QHash< int, QByteArray > roleNames() const override
QQuick3DInstancing * instancingTable
QQuick3DInstancing * instancing() const
void instancingChanged()
QQuick3DInstancing * instancing() const
QQuick3DInstancing * instancingTable
void instancingChanged()
void setInstancing(QQuick3DInstancing *instancing)
void initDelegate(int index, QQuick3DNode *node) override
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore Represents a handle to a signal-slot (or signal-functor) connection.
\inmodule QtCore
\inmodule QtCore
Definition qobject.h:103
\inmodule QtQuick3D \inherits QQuick3DObject
QQuick3DObject * parent
\qmlproperty Object3D QtQuick3D::Object3D::parent This property holds the parent of the Object3D in a...
\inmodule QtCore
Definition qvariant.h:65
Combined button and popup list for selecting options.
GLuint index
[2]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLboolean reset
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define slots
#define signals
#define explicit