![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtCore More...
#include <qeventloop.h>
Public Member Functions | |
Q_NODISCARD_CTOR Q_CORE_EXPORT | QEventLoopLocker () noexcept |
Creates an event locker operating on the QCoreApplication. | |
Q_NODISCARD_CTOR Q_CORE_EXPORT | QEventLoopLocker (QEventLoop *loop) noexcept |
Creates an event locker operating on the loop. | |
Q_NODISCARD_CTOR Q_CORE_EXPORT | QEventLoopLocker (QThread *thread) noexcept |
Creates an event locker operating on the thread. | |
Q_CORE_EXPORT | ~QEventLoopLocker () |
Destroys this event loop locker object. | |
Q_NODISCARD_CTOR | QEventLoopLocker (QEventLoopLocker &&other) noexcept |
QEventLoopLocker & | operator= (QEventLoopLocker &&other) noexcept |
void | swap (QEventLoopLocker &other) noexcept |
Friends | |
class | QEventLoopLockerPrivate |
void | swap (QEventLoopLocker &lhs, QEventLoopLocker &rhs) noexcept |
Related Symbols | |
(Note that these are not member symbols.) | |
swap (QEventLoopLocker &lhs, QEventLoopLocker &rhs) | |
\inmodule QtCore
The QEventLoopLocker class provides a means to quit an event loop when it is no longer needed.
The QEventLoopLocker operates on particular objects - either a QCoreApplication instance, a QEventLoop instance or a QThread instance.
This makes it possible to, for example, run a batch of jobs with an event loop and exit that event loop after the last job is finished. That is accomplished by keeping a QEventLoopLocker with each job instance.
The variant which operates on QCoreApplication makes it possible to finish asynchronously running jobs after the last gui window has been closed. This can be useful for example for running a job which uploads data to a network.
Definition at line 58 of file qeventloop.h.
|
noexcept |
Creates an event locker operating on the QCoreApplication.
The application will quit when there are no more QEventLoopLockers operating on it.
Definition at line 344 of file qeventloop.cpp.
References QCoreApplication::instance().
|
explicitnoexcept |
Creates an event locker operating on the loop.
This particular QEventLoop will quit when there are no more QEventLoopLockers operating on it.
Definition at line 357 of file qeventloop.cpp.
|
explicitnoexcept |
Creates an event locker operating on the thread.
This particular QThread will quit when there are no more QEventLoopLockers operating on it.
Definition at line 370 of file qeventloop.cpp.
QEventLoopLocker::~QEventLoopLocker | ( | ) |
Destroys this event loop locker object.
Definition at line 416 of file qeventloop.cpp.
|
inlinenoexcept |
Move-constructs an event-loop locker from other. other will have a no-op destructor, while responsibility for preventing the QEventLoop/QThread/QCoreApplication from quitting is transferred to the new object.
Definition at line 66 of file qeventloop.h.
References other().
|
inlinenoexcept |
Move-assigns this event-loop locker from other. other will have a no-op destructor, while responsibility for preventing the QEventLoop/QThread/QCoreApplication from quitting is transferred to this object.
Definition at line 68 of file qeventloop.h.
|
inlinenoexcept |
Swaps the object and the state of this QEventLoopLocker with other. This operation is very fast and never fails.
Definition at line 71 of file qeventloop.h.
References other().
|
friend |
Definition at line 76 of file qeventloop.h.
|
related |
Swaps the object and the state of lhs with rhs. This operation is very fast and never fails.
|
friend |
Swaps the object and the state of lhs with rhs. This operation is very fast and never fails.
Definition at line 72 of file qeventloop.h.
Referenced by operator=().