I have a problem with assigning a parent to the thread in the constructor of the dialog constructor:
Qt Code:
  1. Dialog::Dialog(QWidget *parent) :
  2. QDialog(parent),
  3. ui(new Ui::Dialog)
  4. {
  5. ui->setupUi(this);
  6. thread_ptr=new Mythread(this); // <------------ here is the problem
  7. connect(thread_ptr,SIGNAL(valueChanged(int)),this,SLOT(On_value_changed(int)));
  8.  
  9. }
To copy to clipboard, switch view to plain text mode 
The error as follows:

Qt Code:
  1. error: no matching function for call to 'Mythread::Mythread(Dialog*)'
  2. thread_ptr=new Mythread(this);
  3. ^
To copy to clipboard, switch view to plain text mode