On Monday 9 September 2024 23:00:28 GMT-7 Eirik Aavitsland via Development wrote: > No idea if this is helpful, but it seems that what was later renamed > QFlag was introduced as QFlagInternal in this commit:
Thank you Aavit. Did already QFlags have the enum_type typedef in this commit?
What I find interesting is the code it generated for the getter prior to this
change:
fprintf(out, " case %d: *(%s*)_v = %s();
break;\n",
propindex,
- !isVariantType(p->type) ? "int" : (const
isVariantType was still present in 4.x and was renamed to isBuiltinType prior
to 5.0 and is still there. Enums are usually not built-in types[*], so this
meant that it would always expect that the array contain a pointer to an
integer. The question is why.
Another question: did QVariant in this commit already have userType()?
In Qt 3, QVariant could only contain a closed set of types, so QObject::
QObject::setProperty would only be able to write QFlags if the QVariant
contained an int, and QMetaProperty already had isEnumType() at this time
https://doc.qt.io/archives/3.3/qmetaproperty.html#isEnumType
and moc looked for functions taking or returning integers:
https://github.com/gnu-andrew/qt3/blob/master/src/moc/moc.y#L2566-L2586
[*] there is one built-in enum in QVariant/QMetaType today, QCborSimpleType. I
do remember needing to do something extra to add this built-in type compared
to the norm.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Principal Engineer - Intel DCAI Platform & System Engineering
smime.p7s
Description: S/MIME cryptographic signature
-- Development mailing list [email protected] https://lists.qt-project.org/listinfo/development
