QT connect函数个数
时间: 2024-05-22 18:12:21 浏览: 177
QT的connect函数有多个重载,具体的个数取决于QT的版本和模块。一般来说,QT的connect函数至少有以下几个重载:
1. connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type = Qt::AutoConnection)
2. connect(const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type = Qt::AutoConnection)
3. connect(const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type = Qt::AutoConnection)
4. connect(const QObject *sender, const QMetaMethod &signal, const char *method, Qt::ConnectionType type = Qt::AutoConnection)
5. connect(const QObject *sender, const char *signal, Functor functor)
6. connect(const QObject *sender, const QMetaMethod &signal, Functor functor)
其中,前四个是最常用的重载形式,用于连接信号和槽函数或者普通函数。后两个重载形式则是用于连接信号和lambda表达式或者function对象。
阅读全文