이 페이지에서

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++ 예외 발생 메커니즘을 사용하지 않으므로, 반환 응답에서 QDBusError를 받게 됩니다( QDBusReply::error() 참조).

QDBusError 객체는 버스 및 원격 애플리케이션으로부터 수신된 오류 이름과 메시지를 확인하는 데 사용됩니다. D-Bus에서 호출될 때 오류 상태를 알리기 위해 이러한 객체를 직접 생성해서는 안 됩니다. 대신 QDBusMessage::createError() 및 QDBusConnection::send()를 사용해야 합니다.

QDBusConnection::send(), QDBusMessage 및 QDBusReply도 참조하십시오 .

멤버 유형 문서

enum QDBusError::ErrorType

D-Bus 구현체와 버스 데몬 자체에서 발생하는 가장 일반적인 D-Bus 오류를 쉽게 확인할 수 있도록, QDBusError 를 미리 정의된 값 집합과 비교할 수 있습니다:

상수값설명
QDBusError::NoError0QDBusError 무효함 (즉, 호출이 성공함)
QDBusError::Other1QDBusError 잘 알려진 오류 중 하나가 아닌 오류가 포함되어 있음
QDBusError::Failed2호출이 실패했습니다 (org.freedesktop.DBus.Error.Failed)
QDBusError::NoMemory3메모리 부족 (org.freedesktop.DBus.Error.NoMemory)
QDBusError::ServiceUnknown4호출된 서비스를 알 수 없음 (org.freedesktop.DBus.Error.ServiceUnknown)
QDBusError::NoReply5호출된 메서드가 지정된 타임아웃 내에 응답하지 않았습니다 (org.freedesktop.DBus.Error.NoReply)
QDBusError::BadAddress6지정된 주소가 유효하지 않습니다 (org.freedesktop.DBus.Error.BadAddress)
QDBusError::NotSupported7호출/작업이 지원되지 않습니다 (org.freedesktop.DBus.Error.NotSupported)
QDBusError::LimitsExceeded8이 프로세스/호출/연결에 할당된 제한값이 미리 정의된 값을 초과했습니다 (org.freedesktop.DBus.Error.LimitsExceeded)
QDBusError::AccessDenied9호출/작업이 허용되지 않은 리소스에 액세스하려고 했습니다 (org.freedesktop.DBus.Error.AccessDenied)
QDBusError::NoServer10문서에 이 기능의 용도가 명시되어 있지 않습니다 (org.freedesktop.DBus.Error.NoServer)
QDBusError::Timeout11문서에 이 기능이 무엇에 쓰이는지 또는 어떻게 사용하는지에 대한 설명이 없습니다 (org.freedesktop.DBus.Error.Timeout)
QDBusError::NoNetwork12문서에 이 기능의 용도가 명시되어 있지 않습니다 (org.freedesktop.DBus.Error.NoNetwork)
QDBusError::AddressInUse13QDBusServer 이미 사용 중인 주소에 바인딩을 시도했습니다 (org.freedesktop.DBus.Error.AddressInUse)
QDBusError::Disconnected14QDBusConnection 가 연결을 끊은 후에 호출/프로세스/메시지가 전송되었습니다 (org.freedesktop.DBus.Error.Disconnected)
QDBusError::InvalidArgs15이 호출/작업에 전달된 인수가 유효하지 않습니다 (org.freedesktop.DBus.Error.InvalidArgs)
QDBusError::UnknownMethod16지정된 매개변수를 사용하여 이 객체/인터페이스에서 호출된 메서드를 찾을 수 없습니다 (org.freedesktop.DBus.Error.UnknownMethod)
QDBusError::TimedOut17문서에 해당 내용이 없습니다... (org.freedesktop.DBus.Error.TimedOut)
QDBusError::InvalidSignature18타입 시그니처가 유효하지 않거나 호환되지 않습니다 (org.freedesktop.DBus.Error.InvalidSignature)
QDBusError::UnknownInterface19이 객체에서 해당 인터페이스를 알 수 없습니다 (org.freedesktop.DBus.Error.UnknownInterface)
QDBusError::UnknownObject20객체 경로가 존재하지 않는 객체를 가리킵니다 (org.freedesktop.DBus.Error.UnknownObject)
QDBusError::UnknownProperty21이 인터페이스에 해당 속성이 없습니다 (org.freedesktop.DBus.Error.UnknownProperty)
QDBusError::PropertyReadOnly22속성이 읽기 전용이므로 속성 설정에 실패했습니다 (org.freedesktop.DBus.Error.PropertyReadOnly)
QDBusError::InternalError23내부 오류가 발생했습니다
QDBusError::InvalidObjectPath25지정된 객체 경로가 유효하지 않습니다.
QDBusError::InvalidService24요청된 서비스가 유효하지 않습니다.
QDBusError::InvalidMember27멤버가 유효하지 않습니다.
QDBusError::InvalidInterface26인터페이스가 유효하지 않습니다.

멤버 함수 설명서

[static] QString QDBusError::errorString(QDBusError::ErrorType error)

error 오류 조건과 관련된 오류 이름을 반환합니다.

bool QDBusError::isValid() const

이것이 유효한 오류 조건인 경우(즉, 오류가 발생한 경우) ` true `를 반환하고, 그렇지 않으면 `false`를 반환합니다.

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도 참조하십시오 .

© 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.