Qt编译错误:Signal and slot arguments are not compatible.

QT编译错误:

Signal and slot arguments are not compatible.

原因如下:

信号和插槽参数不兼容。

当时把connect函数写成了这样子:



connect(receiver,&QUdpSocket::readyRead,this,SLOT(processPengingDatagram()));


解决方法



connect(receiver,&QUdpSocket::readyRead,this,&MainWindow::processPengingDatagram);


信号和槽的格式要对应

你可能感兴趣的:(Qt)