title: Call a function when button clicked in QT
body: <p>I have seen some similar questions to mine on here, but I am still having issues.</p>
  
  <p>I have a button in QT, I have a function defined in my main.cpp file. When I push the QT button I want to call the function in main.cpp and let that function do its thing. </p>
  
  <p>mainwindow.cpp:</p>
  
  <pre><code>void MainWindow::on_StartMotor_clicked()
  {
      SendCmd(100);
  }
  </code></pre>
  
  <p>main.cpp:</p>
  
  <pre><code>void SendCmd(INT Value)
  {
  }
  </code></pre>
  
  <p>But I get an error:</p>
  
  <pre><code>error: 'SendCmd' was not declared in this scope
       SendCmd(100);
                                               ^
  </code></pre>
  
  <p>Im new to QT so I dont think I fully understand the slots and signals thing.</p>
  
  <p>Thanks!</p>