title: Qt: Why doesn't my button get the signal?
body: <p>Why didn't the <strong>button</strong> object get the sigKK() signal when the button was clicked?</p>
  
  <p>When a signal is emitted, can <strong>all qt objects</strong> receive this signal?</p>
  
  <p>The code is as follows: </p>
  
  <pre><code>class PushButton :  public QPushButton
  {
      Q_OBJECT
  signals:
      void sigKK();
  };
  </code></pre>
  
  <p>The PushButton class inherits from QPushButton, but doesn't connect signals and slots here. Is this right?</p>
  
  <pre><code>class MainWindow : public QMainWindow
  {
      Q_OBJECT    
  public:
      explicit MainWindow(){
          resize(400,200);    
          connect(this,SIGNAL(sigKK()),this,SLOT(showRecv1()));   
  
          button = new PushButton();
          button-&gt;setText("Hello,All");
          button-&gt;resize(40,15);
          connect(button, SIGNAL(clicked()),this,SLOT(buttonCK()));
          connect(button, SIGNAL(sigKK()),this,SLOT(showRecv2()));
              //**I can connect sigKK signal with showRecv2 slot here ?**** 
          button-&gt;show();
      }
      ~MainWindow(){      
      }
  signals:
      void sigKK();
  public slots:
      void showRecv1(){
          cout&lt;&lt;"recved 1"&lt;&lt;endl;
          resize(100,100);
      }
      void showRecv2(){
          cout&lt;&lt;"recved 2"&lt;&lt;endl;
          button-&gt;setText(".....");
      }
      void buttonCK(){
          emit sigKK();
          cout&lt;&lt;"emited"&lt;&lt;endl;
      }
  private:
      PushButton *button ; 
  };
  #endif
  </code></pre>