diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2021-05-26 16:59:17 +0200 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2021-05-27 11:30:12 +0200 |
commit | 3826fe59619410a3259683b31c76e35cc68a6afd (patch) | |
tree | d9427c4aff7190d9b193cb6734460894d0ce3ca6 /src | |
parent | bc7c2710eb4eadc3675d6be5cd3a179db6a8a652 (diff) |
Add NOTIFY method to QQmlJSMetaProperty
Since now it is available in qmltypes, we can store it for later use
Change-Id: Ic641308d960e2b19959d398dd333b147c4e5cfb1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qmlcompiler/qqmljsmetatypes_p.h | 4 | ||||
-rw-r--r-- | src/qmlcompiler/qqmljstypedescriptionreader.cpp | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/qmlcompiler/qqmljsmetatypes_p.h b/src/qmlcompiler/qqmljsmetatypes_p.h index 49eeea3a00..17631cca81 100644 --- a/src/qmlcompiler/qqmljsmetatypes_p.h +++ b/src/qmlcompiler/qqmljsmetatypes_p.h @@ -254,6 +254,7 @@ class QQmlJSMetaProperty QString m_read; QString m_write; QString m_bindable; + QString m_notify; QWeakPointer<const QQmlJSScope> m_type; QVector<QQmlJSAnnotation> m_annotations; bool m_isList = false; @@ -281,6 +282,9 @@ public: void setBindable(const QString &bindable) { m_bindable = bindable; } QString bindable() const { return m_bindable; } + void setNotify(const QString ¬ify) { m_notify = notify; } + QString notify() const { return m_notify; } + void setType(const QSharedPointer<const QQmlJSScope> &type) { m_type = type; } QSharedPointer<const QQmlJSScope> type() const { return m_type.toStrongRef(); } diff --git a/src/qmlcompiler/qqmljstypedescriptionreader.cpp b/src/qmlcompiler/qqmljstypedescriptionreader.cpp index a932120ad1..5c26ae3025 100644 --- a/src/qmlcompiler/qqmljstypedescriptionreader.cpp +++ b/src/qmlcompiler/qqmljstypedescriptionreader.cpp @@ -364,10 +364,12 @@ void QQmlJSTypeDescriptionReader::readProperty(UiObjectDefinition *ast, const QQ property.setRead(readStringBinding(script)); } else if (id == QLatin1String("write")) { property.setWrite(readStringBinding(script)); + } else if (id == QLatin1String("notify")) { + property.setNotify(readStringBinding(script)); } else { addWarning(script->firstSourceLocation(), tr("Expected only type, name, revision, isPointer, isReadonly, isRequired, " - "isFinal, bindable, read, write, and isList script bindings.")); + "isFinal, bindable, read, write, notify and isList script bindings.")); } } |