方法1:完整参数
cpp
if(ptr)
{
//qt 4.8.6写法
disconnect(ptr, SIGNAL(signalPtr()), this, SLOT(onSignalPtr()));
}
方法2:只指定发送者和信号
cpp
if(ptr)
{
disconnect(ptr, SIGNAL(signalPtr()), 0, 0);
}
方法3:断开所有连接
cpp
if(ptr)
{
disconnect(ptr, 0, 0, 0); // 断开ptr的所有连接
}
方法4:只指定发送者和接收者
cpp
if(ptr)
{
disconnect(ptr, 0, this, 0); // 断开modelPlace和this之间的所有连接
}