Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-08 Thread Thiago Macieira
On Monday 7 October 2024 23:59:14 GMT-7 Fabian Kosmale via Development wrote: > as an additional heads-up: The QMetaObjectBuilder had a bug which caused > it to not actually store the metatypes for the enums. This should be > fixed (in dev and then 6.8(.1)) when > https://codereview.qt-project.org/

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-08 Thread Fabian Kosmale via Development
Hi, as an additional heads-up: The QMetaObjectBuilder had a bug which caused it to not actually store the metatypes for the enums. This should be fixed (in dev and then 6.8(.1)) when https://codereview.qt-project.org/c/qt/qtbase/+/596122 merges. Kind regards, Fabian On 05.10.24 18:37, Phil

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-06 Thread Phil Thompson via Development
On 05/10/2024 21:58, Thiago Macieira wrote: On Saturday 5 October 2024 10:16:49 GMT-7 Phil Thompson via Development wrote: Looking at the QMetaObjectBuilder source I can't see where the QMetaType passed to setMetaType() is actually used. As far as I can tell the enum meta-types should be stored

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-05 Thread Thiago Macieira
On Saturday 5 October 2024 10:16:49 GMT-7 Phil Thompson via Development wrote: > Looking at the QMetaObjectBuilder source I can't see where the QMetaType > passed to setMetaType() is actually used. As far as I can tell the enum > meta-types should be stored immediately after the property meta-types

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-05 Thread Phil Thompson via Development
Hi, Thanks for the hints - almost everything is now working (and you can ignore my original issue about changed behaviour). The remaining problem is that if I query the generated meta-object for the QMetaEnum then its QMetaType is always invalid. Looking at the QMetaObjectBuilder source I c

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-05 Thread Phil Thompson via Development
Thanks - that was extremely helpful. On 05/10/2024 01:50, Thiago Macieira wrote: On Friday 4 October 2024 07:42:39 GMT-7 Phil Thompson via Development wrote: Understood - but there seems to be no obvious way to dynamically create and register a valid QMetaType. What do you mean by a dynamic

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-04 Thread Thiago Macieira
On Friday 4 October 2024 07:42:39 GMT-7 Phil Thompson via Development wrote: > Understood - but there seems to be no obvious way to dynamically create > and register a valid QMetaType. What do you mean by a dynamic meta type? Are you trying to wrap some other language? Because if the type exists

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-04 Thread Phil Thompson via Development
On 04/10/2024 15:32, Thiago Macieira wrote: On Friday 4 October 2024 05:43:38 GMT-7 Phil Thompson via Development wrote: For dynamically created meta-objects... - the results were dependent on the version of Qt - QMetaProperty.metaType().isValid() always returned false - QMetaProperty.isEnumTyp

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-04 Thread Thiago Macieira
On Friday 4 October 2024 05:43:38 GMT-7 Phil Thompson via Development wrote: > For dynamically created meta-objects... > > - the results were dependent on the version of Qt > - QMetaProperty.metaType().isValid() always returned false > - QMetaProperty.isEnumType() returned true for v6.7.1 and fals

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-04 Thread Fabian Kosmale via Development
Hi, QMetaProperty::isEnumType's documentation probably should be adjusted to mention that it really is about having an enum marked with Q_ENUM, not about generic C++ enums. For your use-case: I suspect you need to create a dynamic meta-type for your enum (or rather, the QtPrivate::QMetaTypeI

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-04 Thread Thiago Macieira
On Thursday 3 October 2024 08:07:20 GMT-7 Phil Thompson via Development wrote: > > Or you can set the EnumOrFlag flag in the QMetaProperty flags field to > > force the > > constructor to search. > > Sorry, can you be more specific? I can't see how to do it given the > private nature of the flags.

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-04 Thread Phil Thompson via Development
Hi Fabian, The change was https://codereview.qt-project.org/c/qt/qtbase/+/559265 Reverting this change means I get the same behaviour as I get with v6.7. I am (and always have been) using QMetaObjectBuilder and addEnumerator() (the overload that takes a QByteArray argument). I've compared th

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-04 Thread Fabian Kosmale via Development
Hi Phil, I'm not quite sure which change caused the issue, and I believe a bugreport with a reproducer might shed some light on the issue. Nevertheless, if you're already using the private QMetaObjectBuilder API, I would expect that it should work if you build the enum also dynamically via a

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-03 Thread Phil Thompson via Development
On 03/10/2024 16:31, Volker Hilsheimer wrote: On 3 Oct 2024, at 17:07, Phil Thompson via Development wrote: On 03/10/2024 15:44, Thiago Macieira wrote: On Thursday 3 October 2024 05:06:08 GMT-7 Phil Thompson via Development wrote: Yes, that's the change - commenting out the new test fixes the

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-03 Thread Volker Hilsheimer via Development
> On 3 Oct 2024, at 17:07, Phil Thompson via Development > wrote: > > On 03/10/2024 15:44, Thiago Macieira wrote: >> On Thursday 3 October 2024 05:06:08 GMT-7 Phil Thompson via Development >> wrote: >>> Yes, that's the change - commenting out the new test fixes the problem. >>> I am dynamica

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-03 Thread Phil Thompson via Development
On 03/10/2024 15:44, Thiago Macieira wrote: On Thursday 3 October 2024 05:06:08 GMT-7 Phil Thompson via Development wrote: Yes, that's the change - commenting out the new test fixes the problem. I am dynamically building the meta-object. You don't really build an enum, you just provide a descr

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-03 Thread Thiago Macieira
On Thursday 3 October 2024 05:06:08 GMT-7 Phil Thompson via Development wrote: > Yes, that's the change - commenting out the new test fixes the problem. > > I am dynamically building the meta-object. You don't really build an > enum, you just provide a description of it to the meta-object. It woul

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-03 Thread Phil Thompson via Development
On Behalf Of Phil Thompson via Development Sent: torsdag 3. oktober 2024 13:40 To: development@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* registe

Re: [Development] Changed enum property behaviour in Qt v6.8

2024-10-03 Thread MÃ¥rten Nordheim via Development
t; Sent: torsdag 3. oktober 2024 13:40 > To: development@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

[Development] Changed enum property behaviour in Qt v6.8

2024-10-03 Thread Phil Thompson via Development
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