I reimplemented class QTcpSocket to "Socket". QTcpServer returns only QTcpSocket, so I static casted it to Socket. Program compiles, but slot not visible.
Socket* soc = static_cast<Socket*> (srv->nextPendingConnection());
Socket* soc = static_cast<Socket*> (srv->nextPendingConnection());
To copy to clipboard, switch view to plain text mode
In class Socket:
Header:
public slots:
void dataRead();
CPP:
connect(this, SIGNAL(readyRead()), this, SLOT(dataRead()));
Header:
public slots:
void dataRead();
CPP:
connect(this, SIGNAL(readyRead()), this, SLOT(dataRead()));
To copy to clipboard, switch view to plain text mode
Error message:
Object
::connect: No such
slot QTcpSocket::dataRead() in ..\Sample\socket.
cpp:16
Object::connect: No such slot QTcpSocket::dataRead() in ..\Sample\socket.cpp:16
To copy to clipboard, switch view to plain text mode
Bookmarks