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
qqmljstypedescriptionreader_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 QQMLJSTYPEDESCRIPTIONREADER_P_H
5#define QQMLJSTYPEDESCRIPTIONREADER_P_H
6
7#include <qtqmlcompilerexports.h>
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18
19#include "qqmljsscope_p.h"
20
21#include <QtQml/private/qqmljsastfwd_p.h>
22
23// for Q_DECLARE_TR_FUNCTIONS
24#include <QtCore/qcoreapplication.h>
25
27
28class Q_QMLCOMPILER_EXPORT QQmlJSTypeDescriptionReader
29{
31public:
34 : m_fileName(std::move(fileName)), m_source(std::move(data)) {}
35
36 bool operator()(QList<QQmlJSExportedScope> *objects, QStringList *dependencies);
37
38 QString errorMessage() const { return m_errorMessage; }
39 QString warningMessage() const { return m_warningMessage; }
40
41private:
42 void readDocument(QQmlJS::AST::UiProgram *ast);
43 void readModule(QQmlJS::AST::UiObjectDefinition *ast);
45 void readComponent(QQmlJS::AST::UiObjectDefinition *ast);
46 void readSignalOrMethod(QQmlJS::AST::UiObjectDefinition *ast, bool isMethod,
47 const QQmlJSScope::Ptr &scope);
48 void readProperty(QQmlJS::AST::UiObjectDefinition *ast, const QQmlJSScope::Ptr &scope);
49 void readEnum(QQmlJS::AST::UiObjectDefinition *ast, const QQmlJSScope::Ptr &scope);
50 void readParameter(QQmlJS::AST::UiObjectDefinition *ast, QQmlJSMetaMethod *metaMethod);
51
52 QString readStringBinding(QQmlJS::AST::UiScriptBinding *ast);
53 bool readBoolBinding(QQmlJS::AST::UiScriptBinding *ast);
54 double readNumericBinding(QQmlJS::AST::UiScriptBinding *ast);
55 QTypeRevision readNumericVersionBinding(QQmlJS::AST::UiScriptBinding *ast);
56 int readIntBinding(QQmlJS::AST::UiScriptBinding *ast);
57 QList<QQmlJSScope::Export> readExports(QQmlJS::AST::UiScriptBinding *ast);
58 void readAliases(QQmlJS::AST::UiScriptBinding *ast, const QQmlJSScope::Ptr &scope);
59 void readInterfaces(QQmlJS::AST::UiScriptBinding *ast, const QQmlJSScope::Ptr &scope);
60 void checkMetaObjectRevisions(
61 QQmlJS::AST::UiScriptBinding *ast, QList<QQmlJSScope::Export> *exports);
62
63 QStringList readStringList(QQmlJS::AST::UiScriptBinding *ast);
64 void readDeferredNames(QQmlJS::AST::UiScriptBinding *ast, const QQmlJSScope::Ptr &scope);
65 void readImmediateNames(QQmlJS::AST::UiScriptBinding *ast, const QQmlJSScope::Ptr &scope);
66 void readEnumValues(QQmlJS::AST::UiScriptBinding *ast, QQmlJSMetaEnum *metaEnum);
67
68 void addError(const QQmlJS::SourceLocation &loc, const QString &message);
69 void addWarning(const QQmlJS::SourceLocation &loc, const QString &message);
70
72
73 QString m_fileName;
74 QString m_source;
75 QString m_errorMessage;
76 QString m_warningMessage;
77 QList<QQmlJSExportedScope> *m_objects = nullptr;
78 QStringList *m_dependencies = nullptr;
79 int m_currentCtorIndex = 0;
80};
81
83
84#endif // QQMLJSTYPEDESCRIPTIONREADER_P_H
QQmlJSTypeDescriptionReader(QString fileName, QString data)
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Combined button and popup list for selecting options.
#define Q_DECLARE_TR_FUNCTIONS(context)
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLsizei const GLchar * message
bool readDependencies(Options *options)
Definition main.cpp:2515