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

Konstantin Shegunov kshegunov at gmail.com
Sat Mar 16 01:47:53 CET 2024


On Fri, Mar 15, 2024 at 10:48 PM Marc Mutz via Development <
development at qt-project.org> wrote:

> The member variable thing sounds very wrong. I'd be surprised if it
> compiled.


Then you'd be surprised.


> If it does, it's probably something new in C++23 or 26 whereby
> you can use `using` for more general renaming [...]


If I'm not mistaken it's a C++17 feature. You can also use this to 'pull'
specific methods out of specific bases (e.g. if there's a name
clash/ambiguity), not only for changing access scope.
E.g.

struct A
{
   int foo(int);
};
struct B
{
   double foo(double);
};
struct C : A, B
{
    using A::foo;
    using B::foo;
};

Which allows C to have `foo()` properly overloaded.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20240316/c4d2647a/attachment.htm>


More information about the Development mailing list