qtlamdba表达式书写 [数据库教程]
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 表达式书写
以上是 qtlamdba表达式书写 [数据库教程] 的全部内容, 来源链接: utcz.com/z/535054.html