[Development] Should QObject::event() be protected or public?
Jaroslaw Kobus
Jaroslaw.Kobus at qt.io
Fri Mar 15 19:17:22 CET 2024
> From: Development <development-bounces at qt-project.org> on behalf of Thiago Macieira <thiago.macieira at intel.com>
> Sent: Friday, March 15, 2024 7:03 PM
> To: development at qt-project.org
> Subject: Re: [Development] Should QObject::event() be protected or public?
>
> On Friday, 15 March 2024 10:09:31 PDT Marc Mutz via Development wrote:
>> I like simple rules. "Overrides should have the same access level as the
>> initial virtual function." is a simple rule.
>
> Amend that to "... unless there's an explicit reason not to". With that, I'm
> ok. As you can still access by casting to a base, that had better be a good
> reason.
+1. Typically, the designer of a subclass knows what he is doing. But it also happens that users of this class know better how to use it :)
Jarek
More information about the Development
mailing list