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. QMetaObject::connectSlotsByName: No matching signal

QMetaObject::connectSlotsByName: No matching signal

Scheduled Pinned Locked Moved Unsolved General and Desktop
16 Posts 3 Posters 6.1k Views
  • 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.
  • S Offline
    S Offline
    shivaVMC
    wrote on last edited by
    #5

    Hi,
    I couldn't find anything that helps me to fix my bug,can you please suggest me on this

    jsulmJ 1 Reply Last reply
    0
    • aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #6

      @shivaVMC

      Quoting the documentation provided by @jsulm:

      QAbstractSocket::SocketState is not a registered metatype, so for queued connections, you will have to register it with Q_DECLARE_METATYPE() and qRegisterMetaType().

      Qt has to stay free or it will die.

      S 1 Reply Last reply
      0
      • S shivaVMC

        Hi,
        I couldn't find anything that helps me to fix my bug,can you please suggest me on this

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #7

        @shivaVMC stateChanged signal has a different parameter than the one your using:

        connect(&m_sockUdp, SIGNAL(stateChanged(QAbstractSocket::SocketError)),this,SLOT(mSltOnTCPStateChanged(QAbstractSocket::SocketState)));
        

        Look once more.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • aha_1980A aha_1980

          @shivaVMC

          Quoting the documentation provided by @jsulm:

          QAbstractSocket::SocketState is not a registered metatype, so for queued connections, you will have to register it with Q_DECLARE_METATYPE() and qRegisterMetaType().

          S Offline
          S Offline
          shivaVMC
          wrote on last edited by
          #8

          @aha_1980
          Itis registered as below

          qRegisterMetaType< QAbstractSocket::SocketState >();

          jsulmJ 1 Reply Last reply
          0
          • S shivaVMC

            @aha_1980
            Itis registered as below

            qRegisterMetaType< QAbstractSocket::SocketState >();

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #9

            @shivaVMC You don't need to register anything as you're not using queued connection. Simply use the correct parameter type for the signal...

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            aha_1980A 1 Reply Last reply
            1
            • jsulmJ jsulm

              @shivaVMC You don't need to register anything as you're not using queued connection. Simply use the correct parameter type for the signal...

              aha_1980A Offline
              aha_1980A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on last edited by
              #10

              @jsulm said in QMetaObject::connectSlotsByName: No matching signal:

              @shivaVMC You don't need to register anything as you're not using queued connection. Simply use the correct parameter type for the signal...

              Oh, missed that...

              Qt has to stay free or it will die.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                shivaVMC
                wrote on last edited by
                #11

                I m not able to fix it....I need your support

                connect(&m_sockUdp,SIGNAL(readyRead()),this,SLOT(mSltOnTCPDataReceivedFromClient()));
                connect(ui->btnConnect,SIGNAL(clicked()),this,SLOT(mSltOnBtnConnectClick()));

                connect(&m_sockUdp, SIGNAL(stateChanged(QAbstractSocket::SocketError)),this,SLOT(mSltOnTCPStateChanged(QAbstractSocket::SocketState)));
                

                Above 3 statement of code are contiguous in my function,at 3rd connect statement I m faccing issue ...
                In SIGNAL stateChanged what will be the correct parameter?

                jsulmJ 1 Reply Last reply
                0
                • S shivaVMC

                  I m not able to fix it....I need your support

                  connect(&m_sockUdp,SIGNAL(readyRead()),this,SLOT(mSltOnTCPDataReceivedFromClient()));
                  connect(ui->btnConnect,SIGNAL(clicked()),this,SLOT(mSltOnBtnConnectClick()));

                  connect(&m_sockUdp, SIGNAL(stateChanged(QAbstractSocket::SocketError)),this,SLOT(mSltOnTCPStateChanged(QAbstractSocket::SocketState)));
                  

                  Above 3 statement of code are contiguous in my function,at 3rd connect statement I m faccing issue ...
                  In SIGNAL stateChanged what will be the correct parameter?

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by jsulm
                  #12

                  @shivaVMC
                  "In SIGNAL stateChanged what will be the correct parameter?" - why don't you read the documentation? I even posted a link to it here.

                  connect(&m_sockUdp, SIGNAL(stateChanged(QAbstractSocket::SocketState)),this,SLOT(mSltOnTCPStateChanged(QAbstractSocket::SocketState)));
                  

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  S 1 Reply Last reply
                  2
                  • jsulmJ jsulm

                    @shivaVMC
                    "In SIGNAL stateChanged what will be the correct parameter?" - why don't you read the documentation? I even posted a link to it here.

                    connect(&m_sockUdp, SIGNAL(stateChanged(QAbstractSocket::SocketState)),this,SLOT(mSltOnTCPStateChanged(QAbstractSocket::SocketState)));
                    
                    S Offline
                    S Offline
                    shivaVMC
                    wrote on last edited by
                    #13

                    @jsulm
                    Sorry,later I have realized and replace SocketError with SocketState.

                    Currenlty I have someother issue now..I m having a look on it.

                    Thanks For the support.Get back you soon on the same

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      shivaVMC
                      wrote on last edited by VRonin
                      #14

                      Hi,
                      I m not able to enter into "if" condition(first if condition),can you please suggest on the below code where I m going wrong.

                      bjProtocol.mPktRegRead(a_nAddress,byArrSendPkt); //Its entering into this   mPktRegRead funtion and return value is fine
                      qDebug()<<"Send Pkt count ===="<<byArrSendPkt.count(); //this  debug is also okay
                      

                      can you please help on this below lines where I m doing wrong

                          m_SockUdp_ReagWrt.writeDatagram(byArrSendPkt,hostIp,60014);                                                                            
                          if(m_sockUdpRegRd.waitForReadyRead(SOCKET_CMND_TIMEOUT_IN_MSEC)){  
                              if( m_sockUdpRegRd.hasPendingDatagrams() ) {
                      //statements
                                  }
                      //statemnets
                      }
                      
                      jsulmJ aha_1980A 2 Replies Last reply
                      0
                      • S shivaVMC

                        Hi,
                        I m not able to enter into "if" condition(first if condition),can you please suggest on the below code where I m going wrong.

                        bjProtocol.mPktRegRead(a_nAddress,byArrSendPkt); //Its entering into this   mPktRegRead funtion and return value is fine
                        qDebug()<<"Send Pkt count ===="<<byArrSendPkt.count(); //this  debug is also okay
                        

                        can you please help on this below lines where I m doing wrong

                            m_SockUdp_ReagWrt.writeDatagram(byArrSendPkt,hostIp,60014);                                                                            
                            if(m_sockUdpRegRd.waitForReadyRead(SOCKET_CMND_TIMEOUT_IN_MSEC)){  
                                if( m_sockUdpRegRd.hasPendingDatagrams() ) {
                        //statements
                                    }
                        //statemnets
                        }
                        
                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #15

                        @shivaVMC said in QMetaObject::connectSlotsByName: No matching signal:

                        if( m_sockUdpRegRd.hasPendingDatagrams()

                        Why do you need this if? After waitForReadyRead() you know that there is something to read.

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        1
                        • S shivaVMC

                          Hi,
                          I m not able to enter into "if" condition(first if condition),can you please suggest on the below code where I m going wrong.

                          bjProtocol.mPktRegRead(a_nAddress,byArrSendPkt); //Its entering into this   mPktRegRead funtion and return value is fine
                          qDebug()<<"Send Pkt count ===="<<byArrSendPkt.count(); //this  debug is also okay
                          

                          can you please help on this below lines where I m doing wrong

                              m_SockUdp_ReagWrt.writeDatagram(byArrSendPkt,hostIp,60014);                                                                            
                              if(m_sockUdpRegRd.waitForReadyRead(SOCKET_CMND_TIMEOUT_IN_MSEC)){  
                                  if( m_sockUdpRegRd.hasPendingDatagrams() ) {
                          //statements
                                      }
                          //statemnets
                          }
                          
                          aha_1980A Offline
                          aha_1980A Offline
                          aha_1980
                          Lifetime Qt Champion
                          wrote on last edited by aha_1980
                          #16

                          @shivaVMC

                          please don't use waitForReadyRead, use the readyRead signal instead!

                          You are blocking the event loop here and it's likely that your app is not working as expected.

                          Qt has to stay free or it will die.

                          1 Reply Last reply
                          2

                          • Login

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