當QtConcurrent :: run函數copyFolder完成時,我的函數finishedCopy()未被調用。 copyFolder函數完成了沒有錯誤。QFutureWatcher信號不起作用
QFutureWatcher<void> watcher;
connect(&watcher, SIGNAL(finished()), this, SLOT(MainWindow::finishedCopy()));
QFuture <void> future = QtConcurrent::run(this,&MainWindow::copyFolder,filepath,dir);
watcher.setFuture(future);
void MainWindow::finishedCopy()
{
QMessageBox::information(this,"","Done");
}
對不起,您可以擴展你的答案嗎? – jocala