1.声明
static unsigned __stdcall DoTextActionsThread(void* p);
2.实现函数体
unsigned __stdcall XXXDlg::DoTextActionsThread(void* p)
{
XXXDlg* dlg = (XXXDlg*)p;
dlg->onOneActions();
return 0;
}
void XXXDlg::onOneActions()
{
qDebug<<"Test\n";
}
3.在cpp文件中调用
void XXXDlg::on_Test_clicked()
{
_beginthreadex(NULL, 0, DoTextActionsThread, this, 0, 0);
}