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.
6
MyClass
myObject
;
7
QFutureWatcher<int>
watcher
;
8
connect
(&
watcher
, &
QFutureWatcher<int>::finished
, &
myObject
, &MyClass::handleFinished);
9
10
// Start the computation.
11
QFuture<int>
future
=
QtConcurrent::run
(...);
12
watcher
.setFuture(
future
);
MyClass
[4]
Definition
doc_src_properties.cpp:58
QFutureWatcher
\reentrant
Definition
qfuturewatcher.h:100
QtConcurrent::run
QTCONCURRENT_RUN_NODISCARD auto run(QThreadPool *pool, Function &&f, Args &&...args)
Definition
qtconcurrentrun.h:43
connect
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
myObject
MyClass myObject
[0]
Definition
src_corelib_thread_qfuturewatcher.cpp:6
watcher
QFutureWatcher< int > watcher
Definition
src_corelib_thread_qfuturewatcher.cpp:7
future
QFuture< int > future
Definition
src_corelib_thread_qfuturewatcher.cpp:11
qtbase
src
corelib
doc
snippets
code
src_corelib_thread_qfuturewatcher.cpp
Generated by
1.10.0