Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

QT5 complaining that a signal is protected in this context

Attempting to connect a 'readyRead' signal to a slot which processes the data coming off the socket. I'm baffled. As I understand it, in QT5, signals are public. For some reason, my complier is complaining about the readyRead signal being protected. Another puzzle is that the message about the non-matching function seems to be looking for a reference to a pointer when It normally accepts pointers, and I've passed it a pointer.

myProcClass::myProcClass( QObject* parent ) :
QObject( parent )
{
_mySocket = new QUdpSocket;
_mySocket->bind( k_mypacket_port, QUdpSocket::ShareAddress |UdpSocket::ReuseAddressHint );
connect( _mySocket, &QUdpSocket::readyRead, this, &myProcClass::processFsiDatagram );
}

Produces compiler errors like this:

error: ‘void QAbstractSocket::readyRead()’ is protected within this context;

and

error: no matching function for call to ‘myProcClass::connect(QUdpSocket*&, void (QAbstractSocket::*)(), myProcClass*, void (myProcClass::*)())’

Comments