Qt 如何使用 lambda 表达式连接信号和槽?
connect(camera, static_cast<void(QCamera::*)(QCamera::LockStatus, QCamera::LockChangeReason)>(&QCamera::lockStatusChanged),
[=](QCamera::LockStatus status, QCamera::LockChangeReason reason){ /* ... */ });
static_cast<void(QCamera::*)(QCamera::LockStatus, QCamera::LockChangeReason)>(&QCamera::lockStatusChanged)
上面这句是一个静态转换 static_cast<>()
QCamera::* 是类指针
QCamera::LockStatus 函数参数
QCamera::LockChangeReason 函数参数
&QCamera::lockStatusChanged 函数地址
转载请注明出处并保持作品的完整性,谢谢