[Development] Should QObject::event() be protected or public?

Marc Mutz marc.mutz at qt.io
Fri Mar 15 11:30:14 CET 2024


On 15.03.24 09:11, apoenitz wrote:
> On Fri, Mar 15, 2024 at 07:16:59AM +0000, Marc Mutz via Development wrote:
[...]
>> Please note that this means that any override (and all new QObject
>> classes should contain one, since, in case we ever need it, it might not
>> be possible to add it after the fact) should also be public.
> 
> Neither is a necessary consequence, and I don't think this new rule
> would be helpful.

I have explained this here and over in TTLOFIR. If people choose to not 
read, or, if read, choose not to understand, or, if understood, choose 
to not accept, there's nothing more that I can do.

> What kind of setups do you expect where an event() override in the
> middle of the inheritance chain needs to be called from outside to
> warrant this rule requiring class-implementor to regularly write code
> that's unlikely (and I claim: Never) needed?

It's not my job to argue why we should keep breaking a very general C++ 
rule, one most C++ developers probably don't know _can_ be broken, but 
I'll throw you a bone: qcompleter.cpp

Thanks,
Marc

-- 
Marc Mutz <marc.mutz at qt.io>
Principal Software Engineer

The Qt Company
Erich-Thilo-Str. 10 12489
Berlin, Germany
www.qt.io

Geschäftsführer: Mika Pälsi, Juha Varelius, Jouni Lintunen
Sitz der Gesellschaft: Berlin,
Registergericht: Amtsgericht Charlottenburg,
HRB 144331 B



More information about the Development mailing list