[Development] Changed enum property behaviour in Qt v6.8
Mårten Nordheim
marten.nordheim at qt.io
Thu Oct 3 13:51:10 CEST 2024
Hello!
Do you mean this change? https://codereview.qt-project.org/c/qt/qtbase/+/559265
If so, my bad!
My motivation is described in the commit, but basically QtProtobuf is quite heavy on
QMetaProperty usage, and trying to resolve the 'menum' was quite a bottleneck for
properties that were not known as enums in the metatype system (and thus treated
differently).
When you say you are doing 'this' dynamically, do you mean building a meta-object?
Or enum?
Mårten
> -----Original Message-----
> From: Development <development-bounces at qt-project.org> On Behalf Of
> Phil Thompson via Development
> Sent: torsdag 3. oktober 2024 13:40
> To: development at qt-project.org
> Subject: [Development] Changed enum property behaviour in Qt v6.8
>
> Hi,
>
> Prior to Qt v6.8 it was possible to define a meta-object property with
> an enum type where the enum was *not* registered with Q_ENUM and the
> result of QMetaProperty::isEnumType() would be true.
>
> With v6.8 isEnumType() will return false. The change is the extra test
> on the meta-type in the private QMetaProperty ctor. In this situation
> the property does not have a valid meta-type and so the extra test
> fails.
>
> What was the reasoning behind the change?
>
> The best solution would be to ensure the enum was registered with the
> type system, however I am doing this dynamically (including building the
> whole meta-object) and so Q_ENUM is inappropriate and I'm not seeing an
> obvious alternative.
>
> Any help would be appreciated.
>
> Phil
> --
> Development mailing list
> Development at qt-project.org
> https://lists.qt-project.org/listinfo/development
More information about the Development
mailing list