今天使用
#ifndef SQ_ADD_PEER_FRAME
#define SQ_ADD_PEER_FRAME 1
#endif
#if SQ_ADD_PEER_FRAME
Q_SLOT void func_pb_peer(bool b);
#endif
QObject::connect(m_peerAction, SIGNAL(toggled(bool)), this, SLOT(func_pb_peer(bool)));
发现最后一条语句实际没有起作用,在moc文件中也找不到func_pb_peer()函数。
最后 将#if SQ_ADD_PEER_FRAME #endif 隐掉,一切恢复正常。