1// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
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 QUICKEXTRASERNODEFACTORY_H
5#define QUICKEXTRASERNODEFACTORY_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 for the convenience
12// of other Qt classes. 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 <private/qabstractnodefactory_p.h>
19#include <QtCore/qhash.h>
20#include <QtQml/private/qqmlmetatype_p.h>
21
22QT_BEGIN_NAMESPACE
23
24class QQmlType;
25
26namespace Qt3DExtras {
27
28class QuickExtrasNodeFactory : public Qt3DCore::QAbstractNodeFactory
29{
30public:
31 Qt3DCore::QNode *createNode(const char *type) override;
32
33 void registerType(const char *className, const char *quickName, int major, int minor);
34
35 static QuickExtrasNodeFactory *instance();
36
37private:
38 struct Type {
39 Type() : t(nullptr), resolved(false) { }
40 Type(const char *quickName, int major, int minor)
41 : quickName(quickName), version(major, minor), t(nullptr), resolved(false) { }
42 QByteArray quickName;
43 QPair<int, int> version;
44 QQmlType t;
45 bool resolved;
46 };
47 QHash<QByteArray, Type> m_types;
48};
49
50} // namespace Qt3DExtras
51
52QT_END_NAMESPACE
53
54#endif // QUICKEXTRASERNODEFACTORY_H
55

source code of qt3d/src/quick3d/quick3dextras/qt3dquickextrasnodefactory_p.h