[Interest] Are slots even needed these days?

Nye kshegunov at gmail.com
Sat May 7 11:19:50 CEST 2016


On Sat, May 7, 2016 at 10:34 AM, d3fault <d3faultdotxbe at gmail.com> wrote:

> Nobody's mentioned that Qt4-style connect syntax is required to solve the
> diamond inheritance problem that frequently appears when using a
> signals/slots interface.
> [snippet]
>

I don't see any multiple inheritance that forms a diamond. And although I
like the older syntax better, I don't see what's the problem with the new
syntax here. This:

QObject * a = new A;
QObject * b = new B;
QObject::connect(a, A::someSignal, b, B::someSlot);

should be working just fine. Plus I don't see a reason for the asQObject()
method, qobject_cast or dynamic_cast would be much simpler and cleaner.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160507/db601781/attachment.html>


More information about the Interest mailing list