[Development] A modest proposal: disable lower-case keywords (emit, foreach, forever, signals, slots) by default

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Fri Feb 21 14:08:59 CET 2020


Il 21/02/20 09:23, Kai Köhne ha scritto:
> Another alternative is to actually use C++ attributes for this:
> 
>    [[qt::emit]] somethingChanged();
> 
> C++ attributes are required since C++11, and since C++17 the compiler is also required to just ignore one's it doesn't know [1]. Because it is part of the core language, It is also something every C++ IDE and tool does accept (and could even check for) ...

This is a tad verbose, but agreeable IFF we also introduce 
[[qt:::slots]], [[qt::invokable]], [[qt::property()]], and so on -- in 
other words: if we have a _consistent_ set of keywords...

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/20200221/95fe7f26/attachment.bin>


More information about the Development mailing list