QEventLoopLocker Class

이벤트 루프가 더 이상 필요하지 않을 때 이벤트 루프를 종료하는 수단을 제공하는 QEventLoopLocker 클래스입니다. 더 보기...

Header: #include <QEventLoopLocker>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core

공용 함수

QEventLoopLocker()
QEventLoopLocker(QEventLoop *loop)
QEventLoopLocker(QThread *thread)
(since 6.7) QEventLoopLocker(QEventLoopLocker &&other)
~QEventLoopLocker()
(since 6.7) void swap(QEventLoopLocker &other)
(since 6.7) QEventLoopLocker &operator=(QEventLoopLocker &&other)
(since 6.7) void swap(QEventLoopLocker &lhs, QEventLoopLocker &rhs)

상세 설명

QEventLoopLocker는 특정 객체( QCoreApplication 인스턴스, QEventLoop 인스턴스 또는 QThread 인스턴스)에서 작동합니다.

이를 통해 예를 들어 이벤트 루프가 있는 작업 배치를 실행하고 마지막 작업이 완료된 후 해당 이벤트 루프를 종료할 수 있습니다. 이는 각 작업 인스턴스와 함께 QEventLoopLocker를 유지함으로써 이루어집니다.

QCoreApplication 에서 작동하는 변형은 마지막 GUI 창이 닫힌 후 비동기적으로 실행 중인 작업을 완료할 수 있습니다. 이는 예를 들어 네트워크에 데이터를 업로드하는 작업을 실행하는 데 유용할 수 있습니다.

QEventLoopQCoreApplication참조하세요 .

멤버 함수 문서

[noexcept] QEventLoopLocker::QEventLoopLocker()

QCoreApplication 에서 작동하는 이벤트 로커를 생성합니다.

애플리케이션은 QCoreApplication::isQuitLockEnabled()가 true 인 경우 더 이상 작동 중인 QEventLoopLocker가 없을 때 종료를 시도합니다.

예를 들어 열려 있는 창이 있거나 QEvent::Quit 이벤트가 무시되는 경우 종료를 시도해도 애플리케이션이 반드시 종료되지 않을 수 있습니다.

QCoreApplication::quit() 및 QCoreApplication::isQuitLockEnabled()도 참조하세요 .

[explicit noexcept] QEventLoopLocker::QEventLoopLocker(QEventLoop *loop)

loop 에서 작동하는 이벤트 로커를 생성합니다.

이 특정 QEventLoop 은 더 이상 작동하는 QEventLoopLocker가 없을 때 종료됩니다.

QEventLoop::quit()도 참조하세요 .

[explicit noexcept] QEventLoopLocker::QEventLoopLocker(QThread *thread)

thread 에서 작동하는 이벤트 로커를 생성합니다.

이 특정 QThread 은 더 이상 작동하는 QEventLoopLocker가 없을 때 종료됩니다.

QThread::quit()도 참조하세요 .

[noexcept, since 6.7] QEventLoopLocker::QEventLoopLocker(QEventLoopLocker &&other)

Move는 other 에서 이벤트 루프 락커를 생성합니다. other 은 노옵 소멸자를 가지며, QEventLoop/QThread/QCoreApplication 이 종료되는 것을 방지하는 책임은 새 객체로 이전됩니다.

이 함수는 Qt 6.7에 도입되었습니다.

[noexcept] QEventLoopLocker::~QEventLoopLocker()

이 이벤트 루프 락커 객체를 삭제합니다.

[noexcept, since 6.7] void QEventLoopLocker::swap(QEventLoopLocker &other)

QEventLoopLocker 의 개체와 상태를 other 로 바꿉니다. 이 작업은 매우 빠르며 실패하지 않습니다.

이 함수는 Qt 6.7에 도입되었습니다.

[noexcept, since 6.7] QEventLoopLocker &QEventLoopLocker::operator=(QEventLoopLocker &&other)

이동 - other 에서 이 이벤트 루프 락커를 할당합니다. other 은 노옵 소멸자를 가지며, QEventLoop/QThread/QCoreApplication 이 종료되는 것을 방지하는 책임은 이 객체로 이전됩니다.

이 함수는 Qt 6.7에 도입되었습니다.

관련 비회원

[noexcept, since 6.7] void swap(QEventLoopLocker &lhs, QEventLoopLocker &rhs)

lhs 의 개체와 상태를 rhs 로 바꿉니다. 이 작업은 매우 빠르며 실패하지 않습니다.

이 함수는 Qt 6.7에 도입되었습니다.

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.