Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmltyperegistrar_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// Qt-Security score:significant
4
5#ifndef QMLTYPEREGISTRAR_P_H
6#define QMLTYPEREGISTRAR_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/qcbormap.h>
20#include <QtCore/qhash.h>
21#include <QtCore/qversionnumber.h>
22
23#include <cstdlib>
24
26
28
30{
31 QString m_module;
32 QString m_targetNamespace;
33 QTypeRevision m_moduleVersion;
34 QList<quint8> m_pastMajorVersions;
35 QList<QString> m_includes;
36 bool m_followForeignVersioning = false;
37 QList<MetaType> m_types;
38 QList<MetaType> m_foreignTypes;
39 QList<QAnyStringView> m_referencedTypes;
40 QList<UsingDeclaration> m_usingDeclarations;
41 QHash<QAnyStringView, QAnyStringView> m_foreignTypeMetaObjectHashes;
42
43 MetaType findType(QAnyStringView name) const;
44 MetaType findTypeForeign(QAnyStringView name) const;
45
46public:
47 void write(QTextStream &os, QAnyStringView outFileName) const;
48 bool generatePluginTypes(const QString &pluginTypesFile, bool generatingJSRoot = false);
49 void setModuleNameAndNamespace(const QString &module, const QString &targetNamespace);
50 void setModuleVersions(QTypeRevision moduleVersion, const QList<quint8> &pastMajorVersions,
51 bool followForeignVersioning);
52 void setIncludes(const QList<QString> &includes);
53 void setTypes(const QList<MetaType> &types, const QList<MetaType> &foreignTypes);
54 void setReferencedTypes(const QList<QAnyStringView> &referencedTypes);
55 void setUsingDeclarations(const QList<UsingDeclaration> &usingDeclarations);
56 void setForeignTypeMetaObjectHashes(const QHash<QAnyStringView, QAnyStringView> &foreignHashes);
57
58 static bool argumentsFromCommandLineAndFile(QStringList &allArguments,
59 const QStringList &arguments);
60 static int runExtract(
61 const QString &baseName, const QString &nameSpace,
62 const MetaTypesJsonProcessor &processor);
63};
64
65QT_END_NAMESPACE
66#endif // QMLTYPEREGISTRAR_P_H
MetaType()=default
bool generatePluginTypes(const QString &pluginTypesFile, bool generatingJSRoot=false)
void setModuleNameAndNamespace(const QString &module, const QString &targetNamespace)
static bool argumentsFromCommandLineAndFile(QStringList &allArguments, const QStringList &arguments)
void setIncludes(const QList< QString > &includes)
static int runExtract(const QString &baseName, const QString &nameSpace, const MetaTypesJsonProcessor &processor)
void setTypes(const QList< MetaType > &types, const QList< MetaType > &foreignTypes)
void write(QTextStream &os, QAnyStringView outFileName) const
void setModuleVersions(QTypeRevision moduleVersion, const QList< quint8 > &pastMajorVersions, bool followForeignVersioning)
void setUsingDeclarations(const QList< UsingDeclaration > &usingDeclarations)
void setForeignTypeMetaObjectHashes(const QHash< QAnyStringView, QAnyStringView > &foreignHashes)
void setReferencedTypes(const QList< QAnyStringView > &referencedTypes)
void setGeneratingJSRoot(bool jsroot)
Combined button and popup list for selecting options.
static QString registrationVarName(const QString &module)
bool operator<(const ExclusiveVersionRange &x, const ExclusiveVersionRange &y)
True if x was removed before y was introduced.
QString conflictingVersionToString(const ExclusiveVersionRange &r)
bool operator==(const ExclusiveVersionRange &x, const ExclusiveVersionRange &y)
True when x and y share a common version.