Qt 6.x
The Qt SDK
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
24
25class Q_QUICK3DASSETUTILS_EXPORT QQuick3DRuntimeLoader : public QQuick3DNode
26{
28
29 QML_NAMED_ELEMENT(RuntimeLoader)
31
32 Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
33 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
34 Q_PROPERTY(QString errorString READ errorString NOTIFY errorStringChanged)
35 Q_PROPERTY(QQuick3DBounds3 bounds READ bounds NOTIFY boundsChanged)
36 Q_PROPERTY(QQuick3DInstancing *instancing READ instancing WRITE setInstancing NOTIFY instancingChanged)
37
38public:
39 explicit QQuick3DRuntimeLoader(QQuick3DNode *parent = nullptr);
40
41 QUrl source() const;
42 void setSource(const QUrl &newSource);
43 void componentComplete() override;
44
45 enum class Status { Empty, Success, Error };
46 Q_ENUM(Status)
47 Status status() const;
48 QString errorString() const;
49 const QQuick3DBounds3 &bounds() const;
50
51 QQuick3DInstancing *instancing() const;
52 void setInstancing(QQuick3DInstancing *newInstancing);
53
60
61protected:
63
64private:
65 void calculateBounds();
66 void loadSource();
67 void updateModels();
68
70 QPointer<QQuick3DNode> m_imported;
71 QString m_assetId; // Used to release runtime assets in the buffer manager.
72 QUrl m_source;
73 Status m_status = Status::Empty;
74 QString m_errorString;
75 bool m_boundsDirty = false;
76 QQuick3DBounds3 m_bounds;
77 QQuick3DInstancing *m_instancing = nullptr;
78 bool m_instancingChanged = false;
79};
80
82
83#endif // QQUICK3DRUNTIMELOADER_H
\inmodule QtCore
Definition qpointer.h:18
\inmodule QtQuick3D \inherits QQuick3DObject
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
QSSGRenderGraphObject * updateSpatialNode(QSSGRenderGraphObject *node) override
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\inmodule QtCore
Definition qurl.h:94
void statusChanged(QDeclarativeComponent::Status status)
[1]
Definition qlogging.cpp:9
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:3197
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SIGNALS
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent