Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QQmlThread Class Reference

#include <qqmlthread_p.h>

+ Inheritance diagram for QQmlThread:
+ Collaboration diagram for QQmlThread:

Public Member Functions

 QQmlThread ()
 
virtual ~QQmlThread ()
 
void startup ()
 
void shutdown ()
 
bool isShutdown () const
 
QMutexmutex ()
 
void lock ()
 
void unlock ()
 
void wakeOne ()
 
void wait ()
 
QThreadthread () 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 ()
 

Friends

class QQmlThreadPrivate
 

Detailed Description

Definition at line 29 of file qqmlthread_p.h.

Constructor & Destructor Documentation

◆ QQmlThread()

QQmlThread::QQmlThread ( )

Definition at line 171 of file qqmlthread.cpp.

◆ ~QQmlThread()

QQmlThread::~QQmlThread ( )
virtual

Definition at line 176 of file qqmlthread.cpp.

Member Function Documentation

◆ callMethodInMain()

template<typename Method , typename ... Args>
void QQmlThread::callMethodInMain ( Method &&  method,
Args &&...  args 
)

Definition at line 113 of file qqmlthread_p.h.

References args, and method.

Referenced by QQmlTypeLoaderThread::initializeEngine(), and QQmlTypeLoaderThread::initializeEngine().

+ Here is the caller graph for this function:

◆ callMethodInThread()

template<typename Method , typename ... Args>
void QQmlThread::callMethodInThread ( Method &&  method,
Args &&...  args 
)

Definition at line 120 of file qqmlthread_p.h.

References args, and method.

Referenced by QQmlTypeLoaderThread::load(), QQmlTypeLoaderThread::loadWithCachedUnit(), and QQmlTypeLoaderThread::loadWithStaticData().

+ Here is the caller graph for this function:

◆ isShutdown()

bool QQmlThread::isShutdown ( ) const

Definition at line 218 of file qqmlthread.cpp.

References QQmlThreadPrivate::m_shutdown.

◆ isThisThread()

bool QQmlThread::isThisThread ( ) const

Definition at line 248 of file qqmlthread.cpp.

References QThread::currentThreadId(), and QObjectPrivate::get().

Referenced by QQmlTypeLoaderThread::callCompleted(), QQmlTypeLoaderThread::callDownloadProgressChanged(), doInitializeEngine(), QQmlDataBlob::errors(), QQmlTypeLoader::getType(), and waitForNextMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lock()

void QQmlThread::lock ( )

Definition at line 228 of file qqmlthread.cpp.

References QQmlThreadPrivate::lock().

Referenced by waitForNextMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutex()

QMutex & QQmlThread::mutex ( )

Definition at line 223 of file qqmlthread.cpp.

References QQmlThreadPrivate::mutex().

+ Here is the call graph for this function:

◆ postMethodToMain()

template<typename Method , typename ... Args>
void QQmlThread::postMethodToMain ( Method &&  method,
Args &&...  args 
)

Definition at line 134 of file qqmlthread_p.h.

References args, and method.

Referenced by QQmlTypeLoaderThread::callCompleted(), and QQmlTypeLoaderThread::callDownloadProgressChanged().

+ Here is the caller graph for this function:

◆ postMethodToThread()

template<typename Method , typename ... Args>
void QQmlThread::postMethodToThread ( Method &&  method,
Args &&...  args 
)

Definition at line 127 of file qqmlthread_p.h.

References args, and method.

Referenced by QQmlTypeLoaderThread::callCompleted(), QQmlTypeLoaderThread::callDownloadProgressChanged(), QQmlTypeLoaderThread::loadAsync(), QQmlTypeLoaderThread::loadWithCachedUnitAsync(), and QQmlTypeLoaderThread::loadWithStaticDataAsync().

+ Here is the caller graph for this function:

◆ shutdown()

◆ startup()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ thread()

QThread * QQmlThread::thread ( ) const

Definition at line 253 of file qqmlthread.cpp.

◆ unlock()

void QQmlThread::unlock ( )

Definition at line 233 of file qqmlthread.cpp.

References QQmlThreadPrivate::unlock().

Referenced by waitForNextMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wait()

void QQmlThread::wait ( )

Definition at line 243 of file qqmlthread.cpp.

References QQmlThreadPrivate::wait().

+ Here is the call graph for this function:

◆ waitForNextMessage()

void QQmlThread::waitForNextMessage ( )
Note
This method must be called in the main thread
Warning
This method requires that the lock is held!

A call to this method will either:

  • run a message requested to run synchronously on the main thread if there is one (and return afterrwards),
  • wait for the worker thread to notify it if the worker thread has pending work,
  • or simply return if neither of the conditions above hold

Definition at line 376 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ wakeOne()

void QQmlThread::wakeOne ( )

Definition at line 238 of file qqmlthread.cpp.

References QQmlThreadPrivate::wakeOne().

Referenced by waitForNextMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QQmlThreadPrivate

friend class QQmlThreadPrivate
friend

Definition at line 69 of file qqmlthread_p.h.


The documentation for this class was generated from the following files: