QUnhandledException Class
QUnhandledException 클래스는 Qt Concurrent 의 작업자 스레드에서 처리되지 않은 예외를 나타냅니다. 더 보기...
| 헤더: | #include <QUnhandledException> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| 상속: | QException |
공개 함수
(since 6.0) | QUnhandledException(std::__exception_ptr::exception_ptr exception = nullptr) |
| QUnhandledException(const QUnhandledException &other) | |
| QUnhandledException(QUnhandledException &&other) | |
(since 6.0) std::__exception_ptr::exception_ptr | exception() const |
(since 6.0) void | swap(QUnhandledException &other) |
| QUnhandledException & | operator=(const QUnhandledException &other) |
상세 설명
작업자 스레드에서 ` QException`의 하위 클래스가 아닌 예외를 발생시키면, Qt Concurrent 해당 함수들은 수신자 스레드 측에서 QUnhandledException을 발생시킵니다. 발생된 실제 예외에 대한 정보는 QUnhandledException 클래스에 저장되며, exception() 메서드를 사용하여 가져올 수 있습니다. 예를 들어, QUnhandledException이 보유한 예외는 다음과 같은 방식으로 처리할 수 있습니다:
try {
auto f = QtConcurrent::run([] { throw MyException {}; });
// ...
} catch (const QUnhandledException &e) {
try {
if (e.exception())
std::rethrow_exception(e.exception());
} catch (const MyException &ex) {
// Process 'ex'
}
}이 클래스를 상속하는 것은 지원되지 않습니다.
멤버 함수 문서
[noexcept, since 6.0] QUnhandledException::QUnhandledException(std::__exception_ptr::exception_ptr exception = nullptr)
새로운 QUnhandledException 객체를 생성합니다. exception 가 전달된 경우, 실제 예외 객체에 대한 포인터를 저장합니다.
이 함수는 Qt 6.0에서 도입되었습니다.
exception()도 참조하십시오 .
[noexcept] QUnhandledException::QUnhandledException(const QUnhandledException &other)
other 의 복사본으로 QUnhandledException 객체를 생성합니다.
[noexcept] QUnhandledException::QUnhandledException(QUnhandledException &&other)
QUnhandledException 객체를 이동 생성하여, 이 객체가 other 가 가리키던 것과 동일한 객체를 가리키게 만듭니다.
[since 6.0] std::__exception_ptr::exception_ptr QUnhandledException::exception() const
이 ` QUnhandledException`에 저장된 실제 예외에 대한 포인터를 반환합니다. 예외 객체를 가리키지 않는 경우 ` null ` 포인터를 반환합니다.
이 함수는 Qt 6.0에서 도입되었습니다.
[noexcept, since 6.0] void QUnhandledException::swap(QUnhandledException &other)
이 처리되지 않은 예외 객체를 ` other`로 교체합니다. 이 작업은 매우 빠르며 절대 실패하지 않습니다.
이 함수는 Qt 6.0에서 도입되었습니다.
[noexcept] QUnhandledException &QUnhandledException::operator=(const QUnhandledException &other)
other 를 이 QUnhandledException 객체에 할당하고, 이 QUnhandledException 객체에 대한 참조를 반환합니다.
© 2026 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.