Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. no member named 'errorOccurred' in 'QAbstractSocket'

no member named 'errorOccurred' in 'QAbstractSocket'

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 3.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by
    #1

    I'm following the information on this site:
    https://doc.qt.io/qt-5/qtnetwork-fortuneclient-example.html

    My 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?

    Kind Regards,
    Sy

    SPlattenS 1 Reply Last reply
    0
    • SPlattenS SPlatten

      I'm following the information on this site:
      https://doc.qt.io/qt-5/qtnetwork-fortuneclient-example.html

      My 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?

      SPlattenS Offline
      SPlattenS Offline
      SPlatten
      wrote on last edited by
      #2

      @SPlatten , oh, I see, it was introduced in Qt 5.15, I'm still on Qt 5.14...will switch.

      Kind Regards,
      Sy

      1 Reply Last reply
      0
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Then please mark this topic as solved. Thx.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved