Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_corelib_thread_qfuturewatcher.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
5// Instantiate the objects and connect to the finished signal.
7QFutureWatcher<int> watcher;
8connect(&watcher, &QFutureWatcher<int>::finished, &myObject, &MyClass::handleFinished);
9
10// Start the computation.
11QFuture<int> future = QtConcurrent::run(...);
12watcher.setFuture(future);
QTCONCURRENT_RUN_NODISCARD auto run(QThreadPool *pool, Function &&f, Args &&...args)
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
QFutureWatcher< int > watcher
QFuture< int > future