diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-06-24 08:25:17 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-06-25 14:11:56 +0200 |
commit | 844e4f7b982f2622dbdce0c4b70775d5bd17f043 (patch) | |
tree | 9e08cb29125b2b3ef5198b98ad70ea4841198089 /src/tools/moc/moc.h | |
parent | b20c7df63aec36cb3cb871e4b898b0e684dcb59a (diff) |
moc: Fix QProperty code generation
This addresses two issues:
1. The generated code for QNotifiedProperty<T, ...> was broken when T is
a pointer. Notably, const S* & is not a constant reference to S*.
This is addressed by consistently using T const& instead of const T&.
2. The Q_PRIVATE_QPROPERTY approach assumed that the property name and
the getter are equal. This does break when they are not, and we are
unable to change either of them due to API compatibility concerns. An
example of this would be QQuickItem's parent property with a
parentItem getter. Therefore, we now allow the usage of NAME to
override the name of the property.
Change-Id: Idf2e85576c74371b5b0f6db15dbe6f2d17c5e33d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/tools/moc/moc.h')
-rw-r--r-- | src/tools/moc/moc.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h index 0f05685327..549b3cdd39 100644 --- a/src/tools/moc/moc.h +++ b/src/tools/moc/moc.h @@ -132,7 +132,7 @@ struct PropertyDef return (s == write); } - QByteArray name, type, member, read, write, reset, designable, scriptable, stored, user, notify, inPrivateClass; + QByteArray name, type, member, read, write, reset, designable, scriptable, stored, user, notify, inPrivateClass, qpropertyname; int notifyId = -1; // -1 means no notifyId, >= 0 means signal defined in this class, < -1 means signal not defined in this class enum Specification { ValueSpec, ReferenceSpec, PointerSpec }; Specification gspec = ValueSpec; |