[Interest] QObject::connect

Thiago Macieira thiago.macieira at intel.com
Thu Jun 26 20:04:35 CEST 2014


Em qui 26 jun 2014, às 20:04:11, igor.mironchik at gmail.com escreveu:
> Thanks guys for your answers. I found what I was seeking.
> 
> And what about parentheses and QMetaMethod that I wanted to concretize what 
> I mean under new syntax of connection.
> 
> As new connect method is:
> 
> QMetaObject::Connection QObject::connect(const QObject * sender, const 
> QMetaMethod & signal, const QObject * receiver, const QMetaMethod & method, 
> Qt::ConnectionType type = Qt::AutoConnection)
> 
> so I have written in parantheses: (using QMetaMethod).

That is not the new connect method. That was added to Qt 4.8. Ok, it's newer 
than the one from Qt 1.0, but it's generally not what we mean when we say "new 
connection syntax".

The new connect method is this one:
    template <typename Func1, typename Func2>
    static inline QMetaObject::Connection connect(const typename 
QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
                                     const typename 
QtPrivate::FunctionPointer<Func2>::Object *receiver, Func2 slot,
                                     Qt::ConnectionType type = 
Qt::AutoConnection)

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list