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>.
|
#include <qqmlthread_p.h>
Public Member Functions | |
QQmlThread () | |
virtual | ~QQmlThread () |
void | startup () |
void | shutdown () |
bool | isShutdown () const |
QMutex & | mutex () |
void | lock () |
void | unlock () |
void | wakeOne () |
void | wait () |
QThread * | thread () const |
bool | isThisThread () const |
template<typename Method , typename ... Args> | |
void | callMethodInThread (Method &&method, Args &&...args) |
template<typename Method , typename ... Args> | |
void | callMethodInMain (Method &&method, Args &&...args) |
template<typename Method , typename ... Args> | |
void | postMethodToThread (Method &&method, Args &&...args) |
template<typename Method , typename ... Args> | |
void | postMethodToMain (Method &&method, Args &&...args) |
void | waitForNextMessage () |
void | discardMessages () |
Friends | |
class | QQmlThreadPrivate |
Definition at line 29 of file qqmlthread_p.h.
QQmlThread::QQmlThread | ( | ) |
Definition at line 171 of file qqmlthread.cpp.
|
virtual |
Definition at line 176 of file qqmlthread.cpp.
void QQmlThread::callMethodInMain | ( | Method && | method, |
Args &&... | args ) |
Definition at line 114 of file qqmlthread_p.h.
Referenced by QQmlTypeLoaderThread::initializeEngine(), and QQmlTypeLoaderThread::initializeEngine().
void QQmlThread::callMethodInThread | ( | Method && | method, |
Args &&... | args ) |
Definition at line 121 of file qqmlthread_p.h.
Referenced by QQmlTypeLoaderThread::load(), QQmlTypeLoaderThread::loadWithCachedUnit(), and QQmlTypeLoaderThread::loadWithStaticData().
void QQmlThread::discardMessages | ( | ) |
Clear all pending events, for either thread.
Definition at line 402 of file qqmlthread.cpp.
References QFieldList< N, nextMember >::isEmpty(), isThisThread(), QQmlThreadPrivate::mainList, QQmlThreadPrivate::mainSync, Q_ASSERT, QFieldList< N, nextMember >::takeFirst(), and QQmlThreadPrivate::threadList.
Referenced by QQmlTypeLoader::clearCache(), and shutdown().
bool QQmlThread::isShutdown | ( | ) | const |
Definition at line 211 of file qqmlthread.cpp.
References QQmlThreadPrivate::m_shutdown.
bool QQmlThread::isThisThread | ( | ) | const |
Definition at line 241 of file qqmlthread.cpp.
References QThread::currentThreadId(), and QObjectPrivate::get().
Referenced by discardMessages(), doInitializeEngine(), QQmlDataBlob::errors(), QQmlTypeLoader::getType(), and waitForNextMessage().
void QQmlThread::lock | ( | ) |
Definition at line 221 of file qqmlthread.cpp.
References QQmlThreadPrivate::lock().
Referenced by waitForNextMessage().
QMutex & QQmlThread::mutex | ( | ) |
Definition at line 216 of file qqmlthread.cpp.
References QQmlThreadPrivate::mutex().
void QQmlThread::postMethodToMain | ( | Method && | method, |
Args &&... | args ) |
Definition at line 135 of file qqmlthread_p.h.
Referenced by QQmlTypeLoaderThread::callCompleted(), and QQmlTypeLoaderThread::callDownloadProgressChanged().
void QQmlThread::postMethodToThread | ( | Method && | method, |
Args &&... | args ) |
Definition at line 128 of file qqmlthread_p.h.
Referenced by QQmlTypeLoaderThread::loadAsync(), QQmlTypeLoaderThread::loadWithCachedUnitAsync(), and QQmlTypeLoaderThread::loadWithStaticDataAsync().
void QQmlThread::shutdown | ( | ) |
Definition at line 191 of file qqmlthread.cpp.
References QCoreApplication::closingDown(), discardMessages(), QQmlThreadPrivate::lock(), QQmlThreadPrivate::m_shutdown, Q_ASSERT, QThread::quit(), QQmlThreadPrivate::triggerThreadEvent(), and QQmlThreadPrivate::unlock().
void QQmlThread::startup | ( | ) |
Starts the actual worker thread.
Definition at line 185 of file qqmlthread.cpp.
References QObject::moveToThread(), and QThread::start().
Referenced by QQmlTypeLoaderThread::QQmlTypeLoaderThread().
QThread * QQmlThread::thread | ( | ) | const |
Definition at line 246 of file qqmlthread.cpp.
void QQmlThread::unlock | ( | ) |
Definition at line 226 of file qqmlthread.cpp.
References QQmlThreadPrivate::unlock().
Referenced by waitForNextMessage().
void QQmlThread::wait | ( | ) |
Definition at line 236 of file qqmlthread.cpp.
References QQmlThreadPrivate::wait().
void QQmlThread::waitForNextMessage | ( | ) |
A call to this method will either:
Definition at line 369 of file qqmlthread.cpp.
References QFieldList< N, nextMember >::isEmpty(), isThisThread(), lock(), QQmlThreadPrivate::m_mainThreadWaiting, QQmlThreadPrivate::mainSync, Q_ASSERT, QQmlThreadPrivate::threadList, unlock(), QQmlThreadPrivate::wait(), and wakeOne().
Referenced by QQmlTypeLoader::getType().
void QQmlThread::wakeOne | ( | ) |
Definition at line 231 of file qqmlthread.cpp.
References QQmlThreadPrivate::wakeOne().
Referenced by waitForNextMessage().
|
friend |
Definition at line 70 of file qqmlthread_p.h.