Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
src_corelib_concurrent_qthreadpool.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
6{
7 void run() override
8 {
9 qDebug() << "Hello world from thread" << QThread::currentThread();
10 }
11};
12
14// QThreadPool takes ownership and deletes 'hello' automatically
void run() override
Implement this pure virtual function in your subclass.
\inmodule QtCore
Definition qrunnable.h:18
void start(QRunnable *runnable, int priority=0)
Reserves a thread and uses it to run runnable, unless this thread will make the current thread count ...
static QThreadPool * globalInstance()
Returns the global QThreadPool instance.
static QThread * currentThread()
Definition qthread.cpp:966
#define qDebug
[1]
Definition qlogging.h:160
HelloWorldTask * hello