QFutureWatcher ドキュメントから次のコードを正しく理解している場合、最後の行と行の間に競合状態があります。
// Instantiate the objects and connect to the finished signal.
MyClass myObject;
QFutureWatcher<int> watcher;
connect(&watcher, SIGNAL(finished()), &myObject, SLOT(handleFinished()));
// Start the computation.
QFuture<int> future = QtConcurrent::run(...);
watcher.setFuture(future);
次の行が呼び出される前にの関数...
が終了した場合、シグナルはトリガーされません。私の仮定は正しいですか?このバグを回避するにはどうすればよいですか?QtConcurrent::run(...)
watcher.finished()