时间:2021-07-01 10:21:17 帮助过:7人阅读
connect(ui->pushButton, &QPushButton::clicked, [=](){ //注意:若在lambda中访问类成员变量,[]号里面必须有=或&,否则编译不过,报错this指针错误。
if (m_td != NULL)
{
m_td->terminate();
m_td->quit();
m_td->wait();
delete m_td;
m_td = NULL;
}
m_td = new mythread;
m_td->str1 = ui->pushButton->text();
m_td->start();
});
qt lamdba 表达式书写
标签:必须 term button read 编译 bsp this amp nec