I have a problem with assigning a parent to the thread in the constructor of the dialog constructor:
ui(new Ui::Dialog)
{
ui->setupUi(this);
thread_ptr=new Mythread(this); // <------------ here is the problem
connect(thread_ptr,SIGNAL(valueChanged(int)),this,SLOT(On_value_changed(int)));
}
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
thread_ptr=new Mythread(this); // <------------ here is the problem
connect(thread_ptr,SIGNAL(valueChanged(int)),this,SLOT(On_value_changed(int)));
}
To copy to clipboard, switch view to plain text mode
The error as follows:
error: no matching function for call to 'Mythread::Mythread(Dialog*)'
thread_ptr=new Mythread(this);
^
error: no matching function for call to 'Mythread::Mythread(Dialog*)'
thread_ptr=new Mythread(this);
^
To copy to clipboard, switch view to plain text mode
Bookmarks