The only difference is whether the method is listed as a slot or as a non-slot in the class metadata. In both Qt 4 and Qt 5, the connection to the slot or invokable succeeds:
#include <QObject> struct Test : public QObject { Q_SLOT void slot() {} Q_INVOKABLE void invokable() {} Q_OBJECT }; int main() { Test test; auto c1 = QObject::connect(&test, SIGNAL(destroyed(QObject*)), &test, SLOT(slot())); auto c2 = QObject::connect(&test, SIGNAL(destroyed(QObject*)), &test, SLOT(invokable())); Q_ASSERT(c1); Q_ASSERT(c2); }
The user must decide how to interpret the difference between the slot and invokable. For instance. if you expand the list of slots to the user in any way, you will not expand the invokable method list unless you do so.
source share