lundi 18 novembre 2019

std::thread can't open a QT Dialog

I want to open a simple QT dialog by std::thread,but it crash after the dialog open success.

std::thread([&](){
    DialogWarning* dlg=new DialogWarning();
    dlg->setModal(true);
    dlg->exec();
    delete dlg;
}).detach();

Aucun commentaire:

Enregistrer un commentaire