QDBusError Class
QDBusError 클래스는 D-Bus 버스 또는 버스에서 발견된 원격 애플리케이션에서 수신한 오류를 나타냅니다. 더 보기...
헤더: | #include <QDBusError> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS DBus) target_link_libraries(mytarget PRIVATE Qt6::DBus) |
qmake: | QT += dbus |
공용 타입
enum | ErrorType { NoError, Other, Failed, NoMemory, ServiceUnknown, …, InvalidInterface } |
공용 함수
bool | isValid() const |
QString | message() const |
QString | name() const |
void | swap(QDBusError &other) |
QDBusError::ErrorType | type() const |
정적 공용 멤버
QString | errorString(QDBusError::ErrorType error) |
상세 설명
D-Bus 버스 서비스 또는 D-Bus를 통한 원격 애플리케이션을 처리할 때 여러 가지 오류 조건이 발생할 수 있습니다. 이러한 에러 조건은 때때로 반환된 에러 값이나 QDBusError에 의해 신호를 받습니다.
C++ 및 Java 예외는 D-Bus 오류에 대한 유효한 비유입니다. 반환 값과 함께 정상적으로 반환하는 대신 원격 애플리케이션과 버스가 오류 조건을 던지기로 결정할 수 있습니다. 그러나 Qt D-Bus 구현은 C++ 예외 발생 메커니즘을 사용하지 않으므로 반환 응답에 QDBusErrors가 수신됩니다( QDBusReply::error() 참조).
QDBusError 객체는 버스 및 원격 애플리케이션에서 수신한 오류 이름과 메시지를 검사하는 데 사용됩니다. D-Bus에서 호출할 때 오류 조건을 알리기 위해 이러한 객체를 직접 만들지 말고 QDBusMessage::createError() 및 QDBusConnection::send()를 사용하세요.
QDBusConnection::send(), QDBusMessage, QDBusReply도 참조하세요 .
멤버 유형 문서
enum QDBusError::ErrorType
D-Bus 구현 및 버스 데몬 자체에서 생성되는 가장 일반적인 D-Bus 오류를 쉽게 검증하기 위해 QDBusError 를 사전 정의된 값 집합과 비교할 수 있습니다:
Constant | 값 | Description |
---|---|---|
QDBusError::NoError | 0 | QDBusError 가 유효하지 않습니다(즉, 호출이 성공했습니다). |
QDBusError::Other | 1 | QDBusError 잘 알려진 에러 중 하나가 아닌 에러가 포함되어 있습니다. |
QDBusError::Failed | 2 | 호출에 실패했습니다 (org.freedesktop.DBus.Error.Failed ) |
QDBusError::NoMemory | 3 | 메모리 부족 (org.freedesktop.DBus.Error.NoMemory ) |
QDBusError::ServiceUnknown | 4 | 호출된 서비스를 알 수 없음 (org.freedesktop.DBus.Error.ServiceUnknown ) |
QDBusError::NoReply | 5 | 호출된 메서드가 지정된 시간 제한 내에 응답하지 않았습니다 (org.freedesktop.DBus.Error.NoReply ). |
QDBusError::BadAddress | 6 | 제공된 주소가 유효하지 않습니다 (org.freedesktop.DBus.Error.BadAddress ) |
QDBusError::NotSupported | 7 | 호출/작업이 지원되지 않음 (org.freedesktop.DBus.Error.NotSupported ) |
QDBusError::LimitsExceeded | 8 | 이 프로세스/호출/연결에 할당된 제한이 사전 정의된 값을 초과했습니다 (org.freedesktop.DBus.Error.LimitsExceeded ). |
QDBusError::AccessDenied | 9 | 호출/작업이 허용되지 않는 리소스에 액세스하려고 시도했습니다 (org.freedesktop.DBus.Error.AccessDenied ). |
QDBusError::NoServer | 10 | 문서에 용도가 명시되어 있지 않음 (org.freedesktop.DBus.Error.NoServer ) |
QDBusError::Timeout | 11 | 문서에 용도와 사용 방법이 명시되어 있지 않음 (org.freedesktop.DBus.Error.Timeout ) |
QDBusError::NoNetwork | 12 | 문서에 용도에 대한 설명이 없습니다 (org.freedesktop.DBus.Error.NoNetwork ) |
QDBusError::AddressInUse | 13 | QDBusServer 이미 사용 중인 주소에 바인딩을 시도했습니다 (org.freedesktop.DBus.Error.AddressInUse ). |
QDBusError::Disconnected | 14 | QDBusConnection 연결이 끊어진 후에 호출/프로세스/메시지가 전송되었습니다 (org.freedesktop.DBus.Error.Disconnected ). |
QDBusError::InvalidArgs | 15 | 이 호출/작업에 전달된 인수가 유효하지 않습니다 (org.freedesktop.DBus.Error.InvalidArgs ) |
QDBusError::UnknownMethod | 16 | 호출된 메서드가 주어진 매개변수를 가진 이 객체/인터페이스에서 찾을 수 없습니다 (org.freedesktop.DBus.Error.UnknownMethod ). |
QDBusError::TimedOut | 17 | 문서에서... (org.freedesktop.DBus.Error.TimedOut ) |
QDBusError::InvalidSignature | 18 | 타입 서명이 유효하지 않거나 호환되지 않습니다 (org.freedesktop.DBus.Error.InvalidSignature ) |
QDBusError::UnknownInterface | 19 | 이 객체에서 인터페이스를 알 수 없습니다 (org.freedesktop.DBus.Error.UnknownInterface ) |
QDBusError::UnknownObject | 20 | 개체 경로가 존재하지 않는 개체를 가리킵니다 (org.freedesktop.DBus.Error.UnknownObject ) |
QDBusError::UnknownProperty | 21 | 속성이 이 인터페이스에 존재하지 않습니다 (org.freedesktop.DBus.Error.UnknownProperty ) |
QDBusError::PropertyReadOnly | 22 | 속성이 읽기 전용이므로 속성 세트에 실패했습니다 (org.freedesktop.DBus.Error.PropertyReadOnly ) |
QDBusError::InternalError | 23 | 내부 오류가 발생했습니다. |
QDBusError::InvalidObjectPath | 25 | 제공된 개체 경로가 유효하지 않습니다. |
QDBusError::InvalidService | 24 | 요청한 서비스가 유효하지 않습니다. |
QDBusError::InvalidMember | 27 | 멤버가 유효하지 않습니다. |
QDBusError::InvalidInterface | 26 | 인터페이스가 유효하지 않습니다. |
멤버 함수 문서
[static]
QString QDBusError::errorString(QDBusError::ErrorType error)
오류 조건과 관련된 오류 이름을 반환합니다 error.
bool QDBusError::isValid() const
유효한 오류 조건인 경우(즉, 오류가 발생한 경우) true
을 반환하고, 그렇지 않으면 거짓을 반환합니다.
QString QDBusError::message() const
호출자가 이 오류와 관련된 메시지를 반환합니다. 오류 메시지는 구현에 따라 정의되며 일반적으로 사람이 읽을 수 있는 오류 코드를 포함하지만 최종 사용자에게 적합하다는 의미는 아닙니다.
QString QDBusError::name() const
이 오류의 이름을 반환합니다. 오류 이름은 org.freedesktop.DBus.InvalidArgs
과 같은 D-Bus 인터페이스 이름과 유사합니다.
type()도 참조하세요 .
[noexcept]
void QDBusError::swap(QDBusError &other)
이 오류를 other 로 바꿉니다. 이 작업은 매우 빠르며 실패하지 않습니다.
QDBusError::ErrorType QDBusError::type() const
이 오류의 ErrorType 를 반환합니다.
ErrorType도 참조하세요 .
© 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.