diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2021-05-26 16:47:06 +0200 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2021-05-27 11:30:12 +0200 |
commit | bc7c2710eb4eadc3675d6be5cd3a179db6a8a652 (patch) | |
tree | ff55975ba171afaf3a7a7e067298f26fbf0e9e22 /src | |
parent | a10eeee97d42f05409074f69cc99d9a8da5db077 (diff) |
Propagate NOTIFY from moc output to qmltypes
This is useful for the object creation compiler when generated aliases
should really have a notify which is bound to the origin's notify
Change-Id: I805d0d461490da7122e37345914dec4140f342ff
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/tooling/Property.qml | 1 | ||||
-rw-r--r-- | src/qmltyperegistrar/qmltypescreator.cpp | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/imports/tooling/Property.qml b/src/imports/tooling/Property.qml index 01c7e38bb0..96cf1a3758 100644 --- a/src/imports/tooling/Property.qml +++ b/src/imports/tooling/Property.qml @@ -50,4 +50,5 @@ Member { property string bindable property string read property string write + property string notify } diff --git a/src/qmltyperegistrar/qmltypescreator.cpp b/src/qmltyperegistrar/qmltypescreator.cpp index a47e22c264..a79c1326a0 100644 --- a/src/qmltyperegistrar/qmltypescreator.cpp +++ b/src/qmltyperegistrar/qmltypescreator.cpp @@ -190,6 +190,9 @@ void QmlTypesCreator::writeProperties(const QJsonArray &properties) const auto write = obj.constFind(QLatin1String("write")); if (write != obj.constEnd()) m_qml.writeScriptBinding(QLatin1String("write"), enquote(write->toString())); + const auto notify = obj.constFind(QLatin1String("notify")); + if (notify != obj.constEnd()) + m_qml.writeScriptBinding(QLatin1String("notify"), enquote(notify->toString())); } if (!obj.contains(QLatin1String("write")) && !obj.contains(QLatin1String("member"))) |