diff options
Diffstat (limited to 'src/corelib/thread/qthread.cpp')
-rw-r--r-- | src/corelib/thread/qthread.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index 0828400733..c42e120978 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -880,6 +880,51 @@ bool QThread::isInterruptionRequested() const return d->interruptionRequested; } +/* + \fn template <typename Function, typename Args...> static QThread *QThread::create(Function &&f, Args &&... args) + \since 5.10 + + Creates a new QThread object that will execute the function \a f with the + arguments \a args. + + The new thread is not started -- it must be started by an explicit call + to start(). This allows you to connect to its signals, move QObjects + to the thread, choose the new thread's priority and so on. The function + \a f will be called in the new thread. + + Returns the newly created QThread instance. + + \note the caller acquires ownership of the returned QThread instance. + + \note this function is only available when using C++17. + + \warning do not call start() on the returned QThread instance more than once; + doing so will result in undefined behavior. + + \sa start() +*/ + +/* + \fn template <typename Function> static QThread *QThread::create(Function &&f) + \since 5.10 + + Creates a new QThread object that will execute the function \a f. + + The new thread is not started -- it must be started by an explicit call + to start(). This allows you to connect to its signals, move QObjects + to the thread, choose the new thread's priority and so on. The function + \a f will be called in the new thread. + + Returns the newly created QThread instance. + + \note the caller acquires ownership of the returned QThread instance. + + \warning do not call start() on the returned QThread instance more than once; + doing so will result in undefined behavior. + + \sa start() +*/ + /*! \class QDaemonThread \since 5.5 |