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
qquick3druntimeloader_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DRUNTIMELOADER_H
5#define QQUICK3DRUNTIMELOADER_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/qquick3dmodel_p.h>
19#include <QtQuick3D/private/qquick3dinstancing_p.h>
20
22
23#include <QtCore/qpointer.h>
24#include <QtCore/qlist.h>
25#include <QtCore/qmimetype.h>
26
28
29class Q_QUICK3DASSETUTILS_EXPORT QQuick3DRuntimeLoader : public QQuick3DNode
30{
32
33 QML_NAMED_ELEMENT(RuntimeLoader)
35
36 Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
37 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
38 Q_PROPERTY(QString errorString READ errorString NOTIFY errorStringChanged)
39 Q_PROPERTY(QQuick3DBounds3 bounds READ bounds NOTIFY boundsChanged)
40 Q_PROPERTY(QQuick3DInstancing *instancing READ instancing WRITE setInstancing NOTIFY instancingChanged)
41 Q_PROPERTY(QStringList supportedExtensions READ supportedExtensions CONSTANT REVISION(6, 7))
42 Q_PROPERTY(QList<QMimeType> supportedMimeTypes READ supportedMimeTypes CONSTANT REVISION(6, 7))
43
44public:
46
47 QUrl source() const;
48 void setSource(const QUrl &newSource);
49 void componentComplete() override;
50 Q_REVISION(6, 7) static QStringList supportedExtensions();
51 Q_REVISION(6, 7) static QList<QMimeType> supportedMimeTypes();
52
53 enum class Status { Empty, Success, Error };
54 Q_ENUM(Status)
55 Status status() const;
56 QString errorString() const;
57 const QQuick3DBounds3 &bounds() const;
58
59 QQuick3DInstancing *instancing() const;
60 void setInstancing(QQuick3DInstancing *newInstancing);
61
68
69protected:
70 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
71
72private:
73 void calculateBounds();
74 void loadSource();
75 void updateModels();
76
77 QPointer<QQuick3DNode> m_root;
78 QPointer<QQuick3DNode> m_imported;
79 QString m_assetId; // Used to release runtime assets in the buffer manager.
80 QUrl m_source;
81 Status m_status = Status::Empty;
82 QString m_errorString;
83 bool m_boundsDirty = false;
84 QQuick3DBounds3 m_bounds;
85 QQuick3DInstancing *m_instancing = nullptr;
86 bool m_instancingChanged = false;
87};
88
90
91#endif // QQUICK3DRUNTIMELOADER_H
Definition qlist.h:75
\inmodule QtCore
Definition qmimetype.h:25
\inmodule QtQuick3D \inherits QQuick3DObject
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qurl.h:94
void statusChanged(QQmlComponent::Status status)
[1]
Definition qlogging.cpp:11
Combined button and popup list for selecting options.
GLsizei GLsizei GLchar * source
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
static void setInstancing(QQuick3DNode *node, QQuick3DInstancing *instanceTable, float bias)
@ Success
Definition main.cpp:3325
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_REVISION(...)
#define Q_SIGNALS
#define explicit