[Development] QProperty and library coding guide

Edward Welbourne edward.welbourne at qt.io
Thu Jul 16 13:08:40 CEST 2020


Il 16/07/20 12:43, Volker Hilsheimer ha scritto:
>> For pre-C++20 (where it’s possible to have zero-size structs), and
>> for compilers that don’t respect the [[no_unqiue_address]] attribute,
>> all these struct-instances are put into a union. In that case, a
>> class using QProperty will be larger (by the same amount no matter
>> the number of properties) than the same class in Qt 5. With C+++ 20
>> and compilers that do respect [[no_unique_address]], the size and
>> layout of these classes will be the same.

Giuseppe D'Angelo (16 July 2020 12:58) requested:
> Could anyone please illustrate with some code snippets how to achieve
> this, in practice, in a number of use cases? E.g. client code (non
> pimpled QObject subclass), (Qt) library code (pimpled QObject
> subclass), etc.; gadgets (does QProperty work there?); with and
> without other Q_PROPERTY/QProperty already present, etc.

As noted in my last mail, documentation is still lagging.  Several of us
- previously ignorant of the new system - are currently helping Ulf and
Fabian with conversion.  We are, in the process, helping to debug the
draft instructions for how to convert and point out gaps in the system
that make this harder than it should be.  Hopefully, once we've spent a
week or two hassling Ulf and Fabian with questions, they'll have the
right things in place and know how to document it clearly.  However,
doing so today would soak up some of their time that is better spent
getting the system into the right state so that the documentation
doesn't need repeated updates ...

Please be patient, we are working on this,

	Eddy.


More information about the Development mailing list