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

Alex Blasche alexander.blasche at qt.io
Fri Feb 21 09:40:23 CET 2020


> -----Original Message-----
> From: Kai Köhne

> Another alternative is to actually use C++ attributes for this:
> 
>   [[qt::emit]] somethingChanged();

I think a fallback to 

somethingChanged() 

without any annotation is not what we want. We'd miss vital information and reduce readability. Having said that I hate Q_EMIT even more. It just is ugly as hell. Therefore, I am very glad about Kai's suggestion. Personally, I don't think we need an extra namespace after all what are the odds to have a clash here 😉 but.... that's details. 

Last but not least, I don't see why we'd want to disable all other keywords when only one of them has a clash. If the current macro enforces this then we should differentiate more. Let's not be too hasty when there is no need.

--
Alex 



More information about the Development mailing list