summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/src_corelib_concurrent_qfuturewatcher.cpp
blob: e1f06ccc2c3a9573affbfaaa82a8e374388dd4e8 (plain)
1
2
3
4
5
6
7
8
9
10
//! [0]
// 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);
//! [0]