Add correctly named Q_PROPERTY for repeated message fields


The Qt protobuf generator uses message field names to generate
the corresponding Q_PROPERTY declarations in the message class.

For example, the following proto file:
message Bar {
    string name = 1;
    Foo foo = 2;
    repeated Foo foos = 3;
}

should produce the Bar class with the following properties:
class Bar : ... {
    Q_PROPERTY(QString name READ name WRITE setName SCRIPTABLE true)
    Q_PROPERTY(messages::Foo foo READ foo WRITE setFoo)
    Q_PROPERTY(QList<messages::Foo> foos READ foos WRITE setFoos ...)
    ...
}

However, the generator incorrectly produced "foosData" instead of "foos"
for repeated message fields:
Q_PROPERTY(QList<messages::Foo> foosData READ foos WRITE setFoos ...)

This broke the user experience by introducing an unexpected suffix.

The fix adds a correctly named Q_PROPERTY for repeated message fields
while keeping the old incorrectly named property for backward compatibility.
The old property should be deprecated, but there is currently no
mechanism to deprecate Q_PROPERTY. See QTBUG-132809.
For now, we can only document the deprecation in code comments.

[ChangeLog][QtProtobuf] Added correctly named Q_PROPERTY declarations
for repeated message fields. The old *Data-suffixed properties are
deprecated and will be removed in Qt 7.

Task-number: QTBUG-145124
Change-Id: Ibafd9ae5f908afca5193f21447a61f617c12946d
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
commit3bd1f97a3db50927bbdbf2402e8fcc08c34a8555
parent493a7a1e160b2a8edeba89d908102225a00743e7
authorTatiana Borisova <tatiana.borisova@qt.io>
committerTatiana Borisova <tatiana.borisova@qt.io>
commit timeThu, 23 Apr 2026 10:40:40 +0000