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

Sérgio Martins sergio.martins at kdab.com
Fri Feb 28 21:18:53 CET 2020


On 2020-02-28 18:32, Thiago Macieira wrote:
> On Friday, 28 February 2020 07:28:34 PST Matthew Woehlke wrote:
>> If we had to do it over again, it might make sense to follow Python 
>> and
>> make signals *objects* instead of *methods*. Then the code would look 
>> like:
>> 
>>   this->emptied.emit(...);
> 
> Binary compatibility issue: if it's a member of the class, it can't be 
> added
> or removed without changing the class's size and layout, so it would 
> tie our
> hands for future improvements.
> 
> You'd see instead:
> 
>     this->emptied().emit(...);
>     connect(foo, foo->emptied(), ...);


I like this, then we could finally (and without hacks) have protected 
and private signals like in Qt 4.

Would also solve the need for qOverload ?


Regards,
-- 
Sérgio Martins | sergio.martins at kdab.com | Senior Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel: Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - The Qt, C++ and OpenGL Experts


More information about the Development mailing list