Home:ALL Converter>QObject* context in QObject::connect function

QObject* context in QObject::connect function

Ask Time:2015-01-15T05:36:55         Author:Nicolas Holthaus

Json Formatter

I'v read the documentation for QObject::connect (for Qt 5.4), but I have a question about the overload

QMetaObject::Connection QObject::connect(const QObject * sender, PointerToMemberFunction signal, const QObject * context, Functor functor, Qt::ConnectionType type = Qt::AutoConnection)

What exactly is the context parameter? What is its purpose? Can it be used to build connections in local event loops in threads?

Can someone provide examples of how/when to use this overload (when the context is not this)?

Author:Nicolas Holthaus,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/27952902/qobject-context-in-qobjectconnect-function
yy