[Development] Should QObject::event() be protected or public?
Jaroslaw Kobus
Jaroslaw.Kobus at qt.io
Wed Mar 13 09:24:27 CET 2024
Most probably making it protected (temporarily) and trying to build everything else (including QtCreator) may reveal the original reason for being public.
Jarek
________________________________________
From: Development <development-bounces at qt-project.org> on behalf of Marc Mutz via Development <development at qt-project.org>
Sent: Wednesday, March 13, 2024 8:58 AM
To: development at qt-project.org
Subject: [Development] Should QObject::event() be protected or public?
Hi,
In API review, we detected some overrides that changed the access
specifier vis-a-vis the original virtual function
(https://wiki.qt.io/Things_To_Look_Out_For_In_Reviews#Polymorphic_Classes
Item 5.3).
One of them was a protected reimplementation of QObject::event() (which
itself is public).
The reason why QObject::event() is public seems lost to history, but the
feeling in the review comments¹ was that it should have been protected
from the get-go (and QObject befriended by whoever delivers events).
If you see any reason for QObject::event() to stay public in Qt 7 and
not become protected, please speak up before we fork Qt 7.0 :)
Thanks,
Marc
¹
https://codereview.qt-project.org/c/qt/qtdeclarative/+/528290/comment/f51938ca_fd065a18/
--
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
--
Development mailing list
Development at qt-project.org
https://lists.qt-project.org/listinfo/development
More information about the Development
mailing list