[Development] QProperty and library coding guide

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Thu Jul 16 12:58:35 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.

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.

Thanks,
-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4329 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200716/4189e77a/attachment.bin>


More information about the Development mailing list