diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-16 15:51:34 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-10-16 21:56:12 +0200 |
commit | 7feab1fb95317b924fe39c49dd9907ca3df61a40 (patch) | |
tree | 41db3b22d74c9971b7549c76d1f9a29af40fa14a /src/qmlcompiler/qqmljsmetatypes_p.h | |
parent | 813796b303af168045d43574321b48d82b41d48d (diff) |
QmlCompiler: Read the "bindable" attribute from plugins.qmltypes
And refactor QQmlJSMetaProperty to use setters rather than a gigantic
constructor. Also, notice that we don't have to construct the same
property twice just to update its type.
Change-Id: Ia6c195fa7088f6ecdff868daae17d4284c1edb22
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsmetatypes_p.h')
-rw-r--r-- | src/qmlcompiler/qqmljsmetatypes_p.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/qmlcompiler/qqmljsmetatypes_p.h b/src/qmlcompiler/qqmljsmetatypes_p.h index 89fdd7cd1b..dcb388abfb 100644 --- a/src/qmlcompiler/qqmljsmetatypes_p.h +++ b/src/qmlcompiler/qqmljsmetatypes_p.h @@ -166,6 +166,7 @@ class QQmlJSMetaProperty { QString m_propertyName; QString m_typeName; + QString m_bindable; QWeakPointer<const QQmlJSScope> m_type; bool m_isList = false; bool m_isWritable = false; @@ -175,28 +176,32 @@ class QQmlJSMetaProperty public: QQmlJSMetaProperty() = default; - QQmlJSMetaProperty(QString propertyName, QString typeName, - bool isList, bool isWritable, bool isPointer, bool isAlias, - int revision) - : m_propertyName(std::move(propertyName)) - , m_typeName(std::move(typeName)) - , m_isList(isList) - , m_isWritable(isWritable) - , m_isPointer(isPointer) - , m_isAlias(isAlias) - , m_revision(revision) - {} + void setPropertyName(const QString &propertyName) { m_propertyName = propertyName; } QString propertyName() const { return m_propertyName; } + + void setTypeName(const QString &typeName) { m_typeName = typeName; } QString typeName() const { return m_typeName; } + void setBindable(const QString &bindable) { m_bindable = bindable; } + QString bindable() const { return m_bindable; } + void setType(const QSharedPointer<const QQmlJSScope> &type) { m_type = type; } QSharedPointer<const QQmlJSScope> type() const { return m_type.toStrongRef(); } + void setIsList(bool isList) { m_isList = isList; } bool isList() const { return m_isList; } + + void setIsWritable(bool isWritable) { m_isWritable = isWritable; } bool isWritable() const { return m_isWritable; } + + void setIsPointer(bool isPointer) { m_isPointer = isPointer; } bool isPointer() const { return m_isPointer; } + + void setIsAlias(bool isAlias) { m_isAlias = isAlias; } bool isAlias() const { return m_isAlias; } + + void setRevision(int revision) { m_revision = revision; } int revision() const { return m_revision; } }; |