aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmllint/metatypes.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-11-08 14:48:32 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-01-13 16:54:08 +0100
commitd0b2a3b5eb4021fb19b634e550cbc6f6664ad775 (patch)
tree4fd37a9c1993451554d0a694bcfaf0cfc5c07a1e /tools/qmllint/metatypes.h
parentd2b3cb0a8794dacbe929ae67447d16377efbccd7 (diff)
qmllint: Analyze member access
We can analyze access to many field member expressions and figure out if the accessed members exist. There are limits to this, of course. Generic JavaScript values are out of scope here. Change-Id: Id2e7613e56f06555cc3a2ba1c51683d9ea0bb84b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools/qmllint/metatypes.h')
-rw-r--r--tools/qmllint/metatypes.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/tools/qmllint/metatypes.h b/tools/qmllint/metatypes.h
index 24f8aa291e..4710ac1613 100644
--- a/tools/qmllint/metatypes.h
+++ b/tools/qmllint/metatypes.h
@@ -114,28 +114,33 @@ private:
int m_revision = 0;
};
+class ScopeTree;
class MetaProperty
{
QString m_propertyName;
- QString m_type;
+ QString m_typeName;
+ const ScopeTree *m_type = nullptr;
bool m_isList;
bool m_isWritable;
bool m_isPointer;
int m_revision;
public:
- MetaProperty(QString name, QString type,
- bool isList, bool isWritable, bool isPointer, int revision)
- : m_propertyName(std::move(name))
- , m_type(std::move(type))
+ MetaProperty(QString propertyName, QString typeName,
+ bool isList, bool isWritable, bool isPointer, int revision)
+ : m_propertyName(std::move(propertyName))
+ , m_typeName(std::move(typeName))
, m_isList(isList)
, m_isWritable(isWritable)
, m_isPointer(isPointer)
, m_revision(revision)
{}
- QString name() const { return m_propertyName; }
- QString typeName() const { return m_type; }
+ QString propertyName() const { return m_propertyName; }
+ QString typeName() const { return m_typeName; }
+
+ void setType(const ScopeTree *type) { m_type = type; }
+ const ScopeTree *type() const { return m_type; }
bool isList() const { return m_isList; }
bool isWritable() const { return m_isWritable; }