title: Qt c++ and Qml signal and slot connection
body: <p>I have created a qt widget for my project. Button, signal and slot, thread everything working properly also I have taken output. </p>
  
  <p>Dialog.h</p>
  
  <pre><code>public slots:
  
      void startThread();
      void stopThread();
  };
  
  #endif // DIALOG_H
  </code></pre>
  
  <p>dialog.cpp</p>
  
  <pre><code>void  Dialog:: startThread(){
  
      if(!startThreadflag){
  
      this-&gt;ui-&gt;Start_2-&gt;setEnabled(false);
      this-&gt;ui-&gt; Stop_2-&gt;setEnabled(true);
  
      startThreadflag = true;
      stopThreadflag = false;
  
      }
  }
  
  void Dialog:: stopThread(){
  
      if(!stopThreadflag){
              cout &lt;&lt; "Closing threads"&lt;&lt; endl;
  
          this-&gt;ui-&gt;Start_2-&gt;setEnabled(true);
          this-&gt;ui-&gt;Stop_2-&gt;setEnabled(false);
  
          stopThreadflag= true;
          startThreadflag = false;
      }
  }
  
  void Dialog::on_Close_clicked()
  {
      cout&lt;&lt;"close_clicked"&lt;&lt;endl;
  
      this-&gt;close();
  }
  </code></pre>
  
  <p>For creating dashboard purpose I have developed same ui in qml, signal and slot everything connected when I press the button signal and slot connected. But I don't know how to connect the label button, set enabled. </p>
  
  <p>that is qt widget code. below that dialog.cpp and qml</p>
  
  <p>dialog.cpp</p>
  
  <pre><code>void Dialog::startThread()
  {
      cout&lt;&lt;"Start Clicked"&lt;&lt;endl;
  
      emit startbuttonclicked();
  }
  
  void Dialog::stopThread()
  {
      cout&lt;&lt;"Stop Clicked"&lt;&lt;endl;
  
      emit stopbuttonclicked();
  }
  </code></pre>
  
  <p>dashboard.qml : (Like all buttons same)</p>
  
  <pre><code>               Item {
                Dialog { 
                   id: dialog1;
                    }
                   Button {
                       x:220
                       y:295
                       text: "Start"
                       onClicked: { dialog1.startThread() }
                       }
                   }
  </code></pre>