QEventLoopLocker Class▲
-
Header: QEventLoopLocker
-
Since: Qt 5.0
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
-
qmake: QT += core
Detailed Description▲
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.
See Also▲
See also QEventLoop, QCoreApplication
Member Function Documentation▲
QEventLoopLocker::QEventLoopLocker()▲
Creates an event locker operating on the QCoreApplication.
The application will quit when there are no more QEventLoopLockers operating on it.
See Also▲
See also QCoreApplication::quit(), QCoreApplication::isQuitLockEnabled()
[explicit] QEventLoopLocker::QEventLoopLocker(QEventLoop *loop)▲
Creates an event locker operating on the loop.
This particular QEventLoop will quit when there are no more QEventLoopLockers operating on it.
See Also▲
See also QEventLoop::quit()
[explicit] QEventLoopLocker::QEventLoopLocker(QThread *thread)▲
Creates an event locker operating on the thread.
This particular QThread will quit when there are no more QEventLoopLockers operating on it.
See Also▲
See also QThread::quit()
QEventLoopLocker::~QEventLoopLocker()▲
Destroys this event loop locker object