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
qqmltypescreator_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 WITH Qt-GPL-exception-1.0
3
4#ifndef QMLTYPESCREATOR_P_H
5#define QMLTYPESCREATOR_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
20
21#include <QtCore/qstring.h>
22#include <QtCore/qset.h>
23
25
27{
28public:
29 QmlTypesCreator() : m_qml(&m_output) {}
30
31 bool generate(const QString &outFileName);
32
33 void setOwnTypes(QVector<MetaType> ownTypes) { m_ownTypes = std::move(ownTypes); }
34 void setForeignTypes(QVector<MetaType> foreignTypes) { m_foreignTypes = std::move(foreignTypes); }
35 void setReferencedTypes(QList<QAnyStringView> referencedTypes) { m_referencedTypes = std::move(referencedTypes); }
36 void setModule(QByteArray module) { m_module = std::move(module); }
37 void setVersion(QTypeRevision version) { m_version = version; }
38
39private:
40 void writeComponent(const QmlTypesClassDescription &collector);
41 void writeClassProperties(const QmlTypesClassDescription &collector);
42 void writeType(QAnyStringView type);
43 void writeProperties(const Property::Container &properties);
44 void writeMethods(const Method::Container &methods, QLatin1StringView type);
45
46 enum class EnumClassesMode { Scoped, Unscoped };
47 void writeEnums(const Enum::Container &enums, EnumClassesMode enumClassesMode);
48
49 void writeComponents();
50 void writeRootMethods(const MetaType &classDef);
51
52 QByteArray m_output;
54 QVector<MetaType> m_ownTypes;
55 QVector<MetaType> m_foreignTypes;
56 QList<QAnyStringView> m_referencedTypes;
57 QByteArray m_module;
59};
60
62
63#endif // QMLTYPESCREATOR_P_H
static JNINativeMethod methods[]
\inmodule QtCore
\inmodule QtCore
Definition qbytearray.h:57
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
static constexpr QTypeRevision zero()
Produces a QTypeRevision with major and minor version {0}.
void setForeignTypes(QVector< MetaType > foreignTypes)
bool generate(const QString &outFileName)
void setModule(QByteArray module)
void setOwnTypes(QVector< MetaType > ownTypes)
void setVersion(QTypeRevision version)
void setReferencedTypes(QList< QAnyStringView > referencedTypes)
Combined button and popup list for selecting options.
static const QCssKnownValue properties[NumProperties - 1]
GLenum type
std::vector< Enum > Container
std::vector< Method > Container