title: How to run thread from push button?
body: <p>main.cpp:</p>
  
  <pre><code>#include "mainwindow.h"
  #include "myobject.h"
  #include &lt;QApplication&gt;
  
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      MainWindow w;
      w.show();
  
      QThread cThread;
      MyObject cObject;
      cObject.doSetup(cThread);
      cObject.moveToThread(&amp;cThread);
      // cThread.start();
  
      return a.exec();
  }
  </code></pre>
  
  <p>mainwindow.cpp:</p>
  
  <pre><code>#include "mainwindow.h"
  #include "ui_mainwindow.h"
  
  MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
  {
      ui-&gt;setupUi(this);
  }
  
  MainWindow::~MainWindow()
  {
      delete ui;
  }
  
  void MainWindow::on_pushButton_clicked()
  {
      // cThread.start();
  }
  </code></pre>
  
  <p>I'm trying to start the thread on on_pushButton_clicked(). In order to do this, I would have to pass cThread to mainwindow through an argument, right? I just want someone to confirm to make sure I'm doing it right.</p>