aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qmlcompiler/CMakeLists.txt2
-rw-r--r--src/qmlcompiler/importedmembersvisitor.cpp14
-rw-r--r--src/qmlcompiler/qmlcompiler.pro2
-rw-r--r--src/qmlcompiler/qmljstypereader.cpp4
-rw-r--r--src/qmlcompiler/qqmljsmetatypes_p.h (renamed from src/qmlcompiler/metatypes_p.h)22
-rw-r--r--src/qmlcompiler/qqmljsscope.cpp4
-rw-r--r--src/qmlcompiler/qqmljsscope_p.h24
-rw-r--r--src/qmlcompiler/typedescriptionreader.cpp14
-rw-r--r--src/qmlcompiler/typedescriptionreader_p.h4
-rw-r--r--tools/qmllint/checkidentifiers.cpp2
-rw-r--r--tools/qmllint/checkidentifiers.h4
-rw-r--r--tools/qmllint/findwarnings.cpp16
12 files changed, 56 insertions, 56 deletions
diff --git a/src/qmlcompiler/CMakeLists.txt b/src/qmlcompiler/CMakeLists.txt
index 62853541e5..c015a339a9 100644
--- a/src/qmlcompiler/CMakeLists.txt
+++ b/src/qmlcompiler/CMakeLists.txt
@@ -9,10 +9,10 @@ qt_add_module(QmlCompiler
INTERNAL_MODULE
SOURCES
importedmembersvisitor.cpp importedmembersvisitor_p.h
- metatypes_p.h
qmljsimporter.cpp qmljsimporter_p.h
qmljstypereader.cpp qmljstypereader_p.h
qmlstreamwriter.cpp qmlstreamwriter_p.h
+ qqmljsmetatypes_p.h
qqmljsscope.cpp qqmljsscope_p.h
resourcefilemapper.cpp resourcefilemapper_p.h
typedescriptionreader.cpp typedescriptionreader_p.h
diff --git a/src/qmlcompiler/importedmembersvisitor.cpp b/src/qmlcompiler/importedmembersvisitor.cpp
index 6b0cd1b9c9..95edc74d27 100644
--- a/src/qmlcompiler/importedmembersvisitor.cpp
+++ b/src/qmlcompiler/importedmembersvisitor.cpp
@@ -83,8 +83,8 @@ bool ImportedMembersVisitor::visit(UiPublicMember *publicMember)
switch (publicMember->type) {
case UiPublicMember::Signal: {
UiParameterList *param = publicMember->parameters;
- MetaMethod method;
- method.setMethodType(MetaMethod::Signal);
+ QQmlJSMetaMethod method;
+ method.setMethodType(QQmlJSMetaMethod::Signal);
method.setMethodName(publicMember->name.toString());
while (param) {
method.addParameter(param->name.toString(), param->type->name.toString());
@@ -101,7 +101,7 @@ bool ImportedMembersVisitor::visit(UiPublicMember *publicMember)
if (const auto idExpression = cast<IdentifierExpression *>(expression->expression))
typeName = idExpression->name;
}
- MetaProperty prop {
+ QQmlJSMetaProperty prop {
publicMember->name.toString(),
typeName.toString(),
false,
@@ -120,9 +120,9 @@ bool ImportedMembersVisitor::visit(UiPublicMember *publicMember)
bool ImportedMembersVisitor::visit(UiSourceElement *sourceElement)
{
if (FunctionExpression *fexpr = sourceElement->sourceElement->asFunctionDefinition()) {
- MetaMethod method;
+ QQmlJSMetaMethod method;
method.setMethodName(fexpr->name.toString());
- method.setMethodType(MetaMethod::Method);
+ method.setMethodType(QQmlJSMetaMethod::Method);
FormalParameterList *parameters = fexpr->formals;
while (parameters) {
method.addParameter(parameters->element->bindingIdentifier.toString(), QString());
@@ -130,7 +130,7 @@ bool ImportedMembersVisitor::visit(UiSourceElement *sourceElement)
}
currentObject()->addMethod(method);
} else if (ClassExpression *clexpr = sourceElement->sourceElement->asClassDefinition()) {
- MetaProperty prop { clexpr->name.toString(), QString(), false, false, false, false, 1 };
+ QQmlJSMetaProperty prop { clexpr->name.toString(), QString(), false, false, false, false, 1 };
currentObject()->addProperty(prop);
} else if (cast<VariableStatement *>(sourceElement->sourceElement)) {
// nothing to do
@@ -156,7 +156,7 @@ bool ImportedMembersVisitor::visit(UiScriptBinding *scriptBinding)
bool ImportedMembersVisitor::visit(QQmlJS::AST::UiEnumDeclaration *uied)
{
- MetaEnum qmlEnum(uied->name.toString());
+ QQmlJSMetaEnum qmlEnum(uied->name.toString());
for (const auto *member = uied->members; member; member = member->next)
qmlEnum.addKey(member->member.toString());
currentObject()->addEnum(qmlEnum);
diff --git a/src/qmlcompiler/qmlcompiler.pro b/src/qmlcompiler/qmlcompiler.pro
index 2605eb8daf..159c7c40ed 100644
--- a/src/qmlcompiler/qmlcompiler.pro
+++ b/src/qmlcompiler/qmlcompiler.pro
@@ -17,7 +17,7 @@ HEADERS = \
importedmembersvisitor_p.h \
qmljsimporter_p.h \
qmljstypereader_p.h \
- metatypes_p.h \
+ qqmljsmetatypes_p.h \
qqmljsscope_p.h \
typedescriptionreader_p.h \
qmlstreamwriter_p.h
diff --git a/src/qmlcompiler/qmljstypereader.cpp b/src/qmlcompiler/qmljstypereader.cpp
index 1b7587c107..2ffa10d3f4 100644
--- a/src/qmlcompiler/qmljstypereader.cpp
+++ b/src/qmlcompiler/qmljstypereader.cpp
@@ -73,8 +73,8 @@ static QQmlJSScope::Ptr parseProgram(QQmlJS::AST::Program *program, const QStrin
result->setInternalName(name);
for (auto *statement = program->statements; statement; statement = statement->next) {
if (auto *function = cast<FunctionDeclaration *>(statement->statement)) {
- MetaMethod method(function->name.toString());
- method.setMethodType(MetaMethod::Method);
+ QQmlJSMetaMethod method(function->name.toString());
+ method.setMethodType(QQmlJSMetaMethod::Method);
for (auto *parameters = function->formals; parameters; parameters = parameters->next)
method.addParameter(parameters->element->bindingIdentifier.toString(), QString());
result->addMethod(method);
diff --git a/src/qmlcompiler/metatypes_p.h b/src/qmlcompiler/qqmljsmetatypes_p.h
index a821e3f0b6..fdd93ed71a 100644
--- a/src/qmlcompiler/metatypes_p.h
+++ b/src/qmlcompiler/qqmljsmetatypes_p.h
@@ -26,8 +26,8 @@
**
****************************************************************************/
-#ifndef METATYPES_H
-#define METATYPES_H
+#ifndef QQMLJSMETATYPES_P_H
+#define QQMLJSMETATYPES_P_H
//
// W A R N I N G
@@ -54,7 +54,7 @@
// some other Item with custom properties.
class QQmlJSScope;
-class MetaEnum
+class QQmlJSMetaEnum
{
QStringList m_keys;
QString m_name;
@@ -62,8 +62,8 @@ class MetaEnum
bool m_isFlag = false;
public:
- MetaEnum() = default;
- explicit MetaEnum(QString name) : m_name(std::move(name)) {}
+ QQmlJSMetaEnum() = default;
+ explicit QQmlJSMetaEnum(QString name) : m_name(std::move(name)) {}
bool isValid() const { return !m_name.isEmpty(); }
@@ -80,7 +80,7 @@ public:
QStringList keys() const { return m_keys; }
};
-class MetaMethod
+class QQmlJSMetaMethod
{
public:
enum Type {
@@ -95,8 +95,8 @@ public:
Public
};
- MetaMethod() = default;
- explicit MetaMethod(QString name, QString returnType = QString())
+ QQmlJSMetaMethod() = default;
+ explicit QQmlJSMetaMethod(QString name, QString returnType = QString())
: m_name(std::move(name))
, m_returnTypeName(std::move(returnType))
, m_methodType(Method)
@@ -160,7 +160,7 @@ private:
int m_revision = 0;
};
-class MetaProperty
+class QQmlJSMetaProperty
{
QString m_propertyName;
QString m_typeName;
@@ -172,7 +172,7 @@ class MetaProperty
int m_revision;
public:
- MetaProperty(QString propertyName, QString typeName,
+ QQmlJSMetaProperty(QString propertyName, QString typeName,
bool isList, bool isWritable, bool isPointer, bool isAlias,
int revision)
: m_propertyName(std::move(propertyName))
@@ -197,4 +197,4 @@ public:
int revision() const { return m_revision; }
};
-#endif // METATYPES_H
+#endif // QQMLJSMETATYPES_P_H
diff --git a/src/qmlcompiler/qqmljsscope.cpp b/src/qmlcompiler/qqmljsscope.cpp
index 0d226e5c5c..6f02070b71 100644
--- a/src/qmlcompiler/qqmljsscope.cpp
+++ b/src/qmlcompiler/qqmljsscope.cpp
@@ -64,10 +64,10 @@ void QQmlJSScope::insertJSIdentifier(const QString &name, const JavaScriptIdenti
}
}
-void QQmlJSScope::insertPropertyIdentifier(const MetaProperty &property)
+void QQmlJSScope::insertPropertyIdentifier(const QQmlJSMetaProperty &property)
{
addProperty(property);
- MetaMethod method(property.propertyName() + QLatin1String("Changed"), QLatin1String("void"));
+ QQmlJSMetaMethod method(property.propertyName() + QLatin1String("Changed"), QLatin1String("void"));
addMethod(method);
}
diff --git a/src/qmlcompiler/qqmljsscope_p.h b/src/qmlcompiler/qqmljsscope_p.h
index 9d38ee7047..3fb501f976 100644
--- a/src/qmlcompiler/qqmljsscope_p.h
+++ b/src/qmlcompiler/qqmljsscope_p.h
@@ -39,7 +39,7 @@
//
// We mean it.
-#include "metatypes_p.h"
+#include "qqmljsmetatypes_p.h"
#include <QtQml/private/qqmljssourcelocation_p.h>
@@ -126,18 +126,18 @@ public:
void insertJSIdentifier(const QString &name, const JavaScriptIdentifier &identifier);
// inserts property as qml identifier as well as the corresponding
- void insertPropertyIdentifier(const MetaProperty &prop);
+ void insertPropertyIdentifier(const QQmlJSMetaProperty &prop);
bool isIdInCurrentScope(const QString &id) const;
ScopeType scopeType() const { return m_scopeType; }
- void addMethods(const QMultiHash<QString, MetaMethod> &methods) { m_methods.unite(methods); }
- void addMethod(const MetaMethod &method) { m_methods.insert(method.methodName(), method); }
- QMultiHash<QString, MetaMethod> methods() const { return m_methods; }
+ void addMethods(const QMultiHash<QString, QQmlJSMetaMethod> &methods) { m_methods.unite(methods); }
+ void addMethod(const QQmlJSMetaMethod &method) { m_methods.insert(method.methodName(), method); }
+ QMultiHash<QString, QQmlJSMetaMethod> methods() const { return m_methods; }
- void addEnum(const MetaEnum &fakeEnum) { m_enums.insert(fakeEnum.name(), fakeEnum); }
- QHash<QString, MetaEnum> enums() const { return m_enums; }
+ void addEnum(const QQmlJSMetaEnum &fakeEnum) { m_enums.insert(fakeEnum.name(), fakeEnum); }
+ QHash<QString, QQmlJSMetaEnum> enums() const { return m_enums; }
QString fileName() const { return m_fileName; }
void setFileName(const QString &file) { m_fileName = file; }
@@ -157,8 +157,8 @@ public:
QString baseTypeName() const { return m_baseTypeName; }
QQmlJSScope::ConstPtr baseType() const { return m_baseType; }
- void addProperty(const MetaProperty &prop) { m_properties.insert(prop.propertyName(), prop); }
- QHash<QString, MetaProperty> properties() const { return m_properties; }
+ void addProperty(const QQmlJSMetaProperty &prop) { m_properties.insert(prop.propertyName(), prop); }
+ QHash<QString, QQmlJSMetaProperty> properties() const { return m_properties; }
QString defaultPropertyName() const { return m_defaultPropertyName; }
void setDefaultPropertyName(const QString &name) { m_defaultPropertyName = name; }
@@ -195,9 +195,9 @@ private:
QHash<QString, JavaScriptIdentifier> m_jsIdentifiers;
- QMultiHash<QString, MetaMethod> m_methods;
- QHash<QString, MetaProperty> m_properties;
- QHash<QString, MetaEnum> m_enums;
+ QMultiHash<QString, QQmlJSMetaMethod> m_methods;
+ QHash<QString, QQmlJSMetaProperty> m_properties;
+ QHash<QString, QQmlJSMetaEnum> m_enums;
QVector<QQmlJSScope::Ptr> m_childScopes;
QQmlJSScope::WeakPtr m_parentScope;
diff --git a/src/qmlcompiler/typedescriptionreader.cpp b/src/qmlcompiler/typedescriptionreader.cpp
index c5df5f12a6..4c7d655385 100644
--- a/src/qmlcompiler/typedescriptionreader.cpp
+++ b/src/qmlcompiler/typedescriptionreader.cpp
@@ -263,12 +263,12 @@ void TypeDescriptionReader::readComponent(UiObjectDefinition *ast)
void TypeDescriptionReader::readSignalOrMethod(UiObjectDefinition *ast, bool isMethod,
const QQmlJSScope::Ptr &scope)
{
- MetaMethod metaMethod;
+ QQmlJSMetaMethod metaMethod;
// ### confusion between Method and Slot. Method should be removed.
if (isMethod)
- metaMethod.setMethodType(MetaMethod::Slot);
+ metaMethod.setMethodType(QQmlJSMetaMethod::Slot);
else
- metaMethod.setMethodType(MetaMethod::Signal);
+ metaMethod.setMethodType(QQmlJSMetaMethod::Signal);
for (UiObjectMemberList *it = ast->initializer->members; it; it = it->next) {
UiObjectMember *member = it->member;
@@ -352,12 +352,12 @@ void TypeDescriptionReader::readProperty(UiObjectDefinition *ast, const QQmlJSSc
return;
}
- scope->addProperty(MetaProperty(name, type, isList, !isReadonly, isPointer, false, revision));
+ scope->addProperty(QQmlJSMetaProperty(name, type, isList, !isReadonly, isPointer, false, revision));
}
void TypeDescriptionReader::readEnum(UiObjectDefinition *ast, const QQmlJSScope::Ptr &scope)
{
- MetaEnum metaEnum;
+ QQmlJSMetaEnum metaEnum;
for (UiObjectMemberList *it = ast->initializer->members; it; it = it->next) {
UiObjectMember *member = it->member;
@@ -385,7 +385,7 @@ void TypeDescriptionReader::readEnum(UiObjectDefinition *ast, const QQmlJSScope:
scope->addEnum(metaEnum);
}
-void TypeDescriptionReader::readParameter(UiObjectDefinition *ast, MetaMethod *metaMethod)
+void TypeDescriptionReader::readParameter(UiObjectDefinition *ast, QQmlJSMetaMethod *metaMethod)
{
QString name;
QString type;
@@ -647,7 +647,7 @@ void TypeDescriptionReader::readMetaObjectRevisions(UiScriptBinding *ast,
}
}
-void TypeDescriptionReader::readEnumValues(UiScriptBinding *ast, MetaEnum *metaEnum)
+void TypeDescriptionReader::readEnumValues(UiScriptBinding *ast, QQmlJSMetaEnum *metaEnum)
{
if (!ast)
return;
diff --git a/src/qmlcompiler/typedescriptionreader_p.h b/src/qmlcompiler/typedescriptionreader_p.h
index 91fc373656..f2f80d9d01 100644
--- a/src/qmlcompiler/typedescriptionreader_p.h
+++ b/src/qmlcompiler/typedescriptionreader_p.h
@@ -70,7 +70,7 @@ private:
const QQmlJSScope::Ptr &scope);
void readProperty(QQmlJS::AST::UiObjectDefinition *ast, const QQmlJSScope::Ptr &scope);
void readEnum(QQmlJS::AST::UiObjectDefinition *ast, const QQmlJSScope::Ptr &scope);
- void readParameter(QQmlJS::AST::UiObjectDefinition *ast, MetaMethod *metaMethod);
+ void readParameter(QQmlJS::AST::UiObjectDefinition *ast, QQmlJSMetaMethod *metaMethod);
QString readStringBinding(QQmlJS::AST::UiScriptBinding *ast);
bool readBoolBinding(QQmlJS::AST::UiScriptBinding *ast);
@@ -79,7 +79,7 @@ private:
int readIntBinding(QQmlJS::AST::UiScriptBinding *ast);
void readExports(QQmlJS::AST::UiScriptBinding *ast, const QQmlJSScope::Ptr &scope);
void readMetaObjectRevisions(QQmlJS::AST::UiScriptBinding *ast, const QQmlJSScope::Ptr &scope);
- void readEnumValues(QQmlJS::AST::UiScriptBinding *ast, MetaEnum *metaEnum);
+ void readEnumValues(QQmlJS::AST::UiScriptBinding *ast, QQmlJSMetaEnum *metaEnum);
void addError(const QQmlJS::SourceLocation &loc, const QString &message);
void addWarning(const QQmlJS::SourceLocation &loc, const QString &message);
diff --git a/tools/qmllint/checkidentifiers.cpp b/tools/qmllint/checkidentifiers.cpp
index e5337df195..acbadf2300 100644
--- a/tools/qmllint/checkidentifiers.cpp
+++ b/tools/qmllint/checkidentifiers.cpp
@@ -109,7 +109,7 @@ static bool walkViaParentAndAttachedScopes(QQmlJSScope::ConstPtr rootType,
bool CheckIdentifiers::checkMemberAccess(const QVector<FieldMember> &members,
const QQmlJSScope::ConstPtr &outerScope,
- const MetaProperty *prop) const
+ const QQmlJSMetaProperty *prop) const
{
QStringList expectedNext;
diff --git a/tools/qmllint/checkidentifiers.h b/tools/qmllint/checkidentifiers.h
index 93b6a13745..cf5d71e670 100644
--- a/tools/qmllint/checkidentifiers.h
+++ b/tools/qmllint/checkidentifiers.h
@@ -35,7 +35,7 @@
class ColorOutput;
struct SignalHandler {
- MetaMethod signal;
+ QQmlJSMetaMethod signal;
bool isMultiline;
};
@@ -67,7 +67,7 @@ public:
private:
bool checkMemberAccess(const QVector<FieldMember> &members,
const QQmlJSScope::ConstPtr &outerScope,
- const MetaProperty *prop = nullptr) const;
+ const QQmlJSMetaProperty *prop = nullptr) const;
ColorOutput *m_colorOut = nullptr;
QString m_code;
diff --git a/tools/qmllint/findwarnings.cpp b/tools/qmllint/findwarnings.cpp
index c0750814a0..7050b40e17 100644
--- a/tools/qmllint/findwarnings.cpp
+++ b/tools/qmllint/findwarnings.cpp
@@ -337,7 +337,7 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiScriptBinding *uisb)
const auto methods = m_currentScope->methods();
const auto methodsRange = methods.equal_range(signal);
for (auto method = methodsRange.first; method != methodsRange.second; ++method) {
- if (method->methodType() != MetaMethod::Signal)
+ if (method->methodType() != QQmlJSMetaMethod::Signal)
continue;
const auto firstSourceLocation = statement->firstSourceLocation();
@@ -355,8 +355,8 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiScriptBinding *uisb)
bool FindWarningVisitor::visit(QQmlJS::AST::UiPublicMember *uipm)
{
if (uipm->type == QQmlJS::AST::UiPublicMember::Signal) {
- MetaMethod method;
- method.setMethodType(MetaMethod::Signal);
+ QQmlJSMetaMethod method;
+ method.setMethodType(QQmlJSMetaMethod::Signal);
method.setMethodName(uipm->name.toString());
QQmlJS::AST::UiParameterList *param = uipm->parameters;
while (param) {
@@ -367,7 +367,7 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiPublicMember *uipm)
} else {
// property bool inactive: !active
// extract name inactive
- MetaProperty property(
+ QQmlJSMetaProperty property(
uipm->name.toString(),
// TODO: complex types etc.
uipm->memberType ? uipm->memberType->name.toString() : QString(),
@@ -479,7 +479,7 @@ void FindWarningVisitor::visitFunctionExpressionHelper(QQmlJS::AST::FunctionExpr
auto name = fexpr->name.toString();
if (!name.isEmpty()) {
if (m_currentScope->scopeType() == ScopeType::QMLScope) {
- m_currentScope->addMethod(MetaMethod(name, QLatin1String("void")));
+ m_currentScope->addMethod(QQmlJSMetaMethod(name, QLatin1String("void")));
} else {
m_currentScope->insertJSIdentifier(
name,
@@ -569,7 +569,7 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiImport *import)
bool FindWarningVisitor::visit(QQmlJS::AST::UiEnumDeclaration *uied)
{
- MetaEnum qmlEnum(uied->name.toString());
+ QQmlJSMetaEnum qmlEnum(uied->name.toString());
for (const auto *member = uied->members; member; member = member->next)
qmlEnum.addKey(member->member.toString());
m_currentScope->addEnum(qmlEnum);
@@ -586,7 +586,7 @@ bool FindWarningVisitor::visit(QQmlJS::AST::UiObjectBinding *uiob)
name.chop(1);
- MetaProperty prop(uiob->qualifiedId->name.toString(), name, false, true, true,
+ QQmlJSMetaProperty prop(uiob->qualifiedId->name.toString(), name, false, true, true,
name == QLatin1String("alias"), 0);
prop.setType(m_rootScopeImports.value(uiob->qualifiedTypeNameId->name.toString()));
m_currentScope->addProperty(prop);
@@ -601,7 +601,7 @@ void FindWarningVisitor::endVisit(QQmlJS::AST::UiObjectBinding *uiob)
{
const auto childScope = m_currentScope;
leaveEnvironment();
- MetaProperty property(uiob->qualifiedId->name.toString(),
+ QQmlJSMetaProperty property(uiob->qualifiedId->name.toString(),
uiob->qualifiedTypeNameId->name.toString(),
false, true, true,
uiob->qualifiedTypeNameId->name == QLatin1String("alias"),