no member named 'errorOccurred' in 'QAbstractSocket'
Solved
General and Desktop
-
I'm following the information on this site:
https://doc.qt.io/qt-5/qtnetwork-fortuneclient-example.htmlMy class is derived from QTcpSocket:
class clsModHelper : public QTcpSocket { Q_OBJECT protected: ... void cleanup(); void start(); public slots: void dataIn(); void errorOccurred(QAbstractSocket::SocketError socketError); ....
The same file with the class prototype also includes the headers:
#include <QCoreApplication> #include <QAbstractSocket> #include <QDataStream> #include <QTcpSocket>
In the implementation:
connect(this, &QIODevice::readyRead, this, &clsModHelper::dataIn); connect(this, &QAbstractSocket::errorOccurred, this, &clsModHelper::errorOccurred);
The line containing the connect for the errorOccurred is highlighted red with the message:
no error named 'errorOccurred' in 'QAbstractSocket'
Yes according to:
https://doc.qt.io/qt-5/qabstractsocket.html
Yes there is...whats wrong?
-
Then please mark this topic as solved. Thx.