QDBusConnection Class

QDBusConnection 클래스는 D-Bus 버스 데몬에 대한 연결을 나타냅니다. 더 보기...

헤더: #include <QDBusConnection>
CMake: find_package(Qt6 REQUIRED COMPONENTS DBus)
target_link_libraries(mytarget PRIVATE Qt6::DBus)
qmake: QT += dbus

공용 타입

enum BusType { SessionBus, SystemBus, ActivationBus }
flags ConnectionCapabilities
enum ConnectionCapability { UnixFileDescriptorPassing }
enum RegisterOption { ExportAdaptors, ExportScriptableSlots, ExportScriptableSignals, ExportScriptableProperties, ExportScriptableInvokables, …, ExportChildObjects }
flags RegisterOptions
enum UnregisterMode { UnregisterNode, UnregisterTree }
flags VirtualObjectRegisterOptions

공용 함수

QDBusConnection(const QString &name)
QDBusConnection(const QDBusConnection &other)
~QDBusConnection()
QDBusPendingCall asyncCall(const QDBusMessage &message, int timeout = -1) const
QString baseService() const
QDBusMessage call(const QDBusMessage &message, QDBus::CallMode mode = QDBus::Block, int timeout = -1) const
bool callWithCallback(const QDBusMessage &message, QObject *receiver, const char *returnMethod, const char *errorMethod, int timeout = -1) const
bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot)
bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, const QString &signature, QObject *receiver, const char *slot)
bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, const QStringList &argumentMatch, const QString &signature, QObject *receiver, const char *slot)
QDBusConnection::ConnectionCapabilities connectionCapabilities() const
bool disconnect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot)
bool disconnect(const QString &service, const QString &path, const QString &interface, const QString &name, const QString &signature, QObject *receiver, const char *slot)
bool disconnect(const QString &service, const QString &path, const QString &interface, const QString &name, const QStringList &argumentMatch, const QString &signature, QObject *receiver, const char *slot)
QDBusConnectionInterface *interface() const
bool isConnected() const
QDBusError lastError() const
QString name() const
QObject *objectRegisteredAt(const QString &path) const
bool registerObject(const QString &path, QObject *object, QDBusConnection::RegisterOptions options = ExportAdaptors)
bool registerObject(const QString &path, const QString &interface, QObject *object, QDBusConnection::RegisterOptions options = ExportAdaptors)
bool registerService(const QString &serviceName)
bool send(const QDBusMessage &message) const
void swap(QDBusConnection &other)
void unregisterObject(const QString &path, QDBusConnection::UnregisterMode mode = UnregisterNode)
bool unregisterService(const QString &serviceName)
QDBusConnection &operator=(const QDBusConnection &other)

정적 공용 멤버

QDBusConnection connectToBus(QDBusConnection::BusType type, const QString &name)
QDBusConnection connectToBus(const QString &address, const QString &name)
QDBusConnection connectToPeer(const QString &address, const QString &name)
void disconnectFromBus(const QString &name)
void disconnectFromPeer(const QString &name)
QByteArray localMachineId()
QDBusConnection sessionBus()
QDBusConnection systemBus()

상세 설명

이 클래스는 D-Bus 세션의 초기 지점입니다. 이를 사용하여 원격 객체, 인터페이스에 액세스하고, 원격 신호를 객체의 슬롯에 연결하고, 객체를 등록하는 등의 작업을 수행할 수 있습니다.

D-Bus 연결은 connectToBus() 함수를 사용하여 생성되며, 이 함수는 서버 데몬에 대한 연결을 열고 초기 핸드셰이킹을 수행하여 해당 연결을 이름과 연결합니다. 이후 동일한 이름을 사용하여 연결을 시도하면 동일한 연결이 반환됩니다.

그런 다음 disconnectFromBus() 함수를 사용하여 연결이 끊어집니다.

연결이 끊어진 후에는 connectToBus()를 호출해도 연결이 다시 설정되지 않으므로 새 QDBusConnection 인스턴스를 만들어야 합니다.

가장 일반적인 두 가지 연결 유형의 편의를 위해 sessionBus() 및 systemBus() 함수는 각각 세션 서버 데몬과 시스템 서버 데몬에 대한 열린 연결을 반환합니다. 이러한 연결은 처음 사용할 때 열리고 QCoreApplication 소멸자가 실행되면 닫힙니다.

D-Bus는 버스 서버 데몬 없이도 피어 투 피어 연결도 지원합니다. 이 기능을 사용하면 두 애플리케이션이 서로 대화하고 메시지를 교환할 수 있습니다. 이는 QDBusServer 을 사용하여 다른 D-Bus 애플리케이션이 연 connectToBus() 함수에 주소를 전달하면 가능합니다.

멤버 유형 문서

enum QDBusConnection::BusType

버스 연결 유형을 지정합니다. 유효한 버스 유형은 다음과 같습니다:

상수설명
QDBusConnection::SessionBus0세션 버스 - 실행 중인 데스크톱 세션과 연결된 세션 버스
QDBusConnection::SystemBus1시스템 버스, 시스템 전체 프로세스와 통신하는 데 사용됩니다.
QDBusConnection::ActivationBus2활성화 버스, 서비스를 시작한 버스의 "별칭"

세션 버스에서는 동일한 데스크톱 세션을 공유하는 동일한 사용자의 다른 애플리케이션(따라서 이름)을 찾을 수 있습니다. 그러나 시스템 버스에서는 일반적으로 전체 시스템에 대해 공유되는 프로세스를 찾을 수 있습니다.

열거형 QDBusConnection::ConnectionCapability
플래그 QDBusConnection::ConnectionCapabilities

이 열거형은 D-Bus 연결에 사용할 수 있는 기능을 설명합니다.

Constant설명
QDBusConnection::UnixFileDescriptorPassing0x0001유닉스 파일 기술자를 다른 프로세스에 전달할 수 있습니다( QDBusUnixFileDescriptor 참조 ).

ConnectionCapabilities 유형은 QFlags<ConnectionCapability>에 대한 typedef입니다. 이 유형은 ConnectionCapability 값의 OR 조합을 저장합니다.

connectionCapabilities()도 참조하십시오 .

열거형 QDBusConnection::RegisterOption
플래그 QDBusConnection::RegisterOptions

연결에 개체를 등록하기 위한 옵션을 지정합니다. 가능한 값은 다음과 같습니다:

Constant설명
QDBusConnection::ExportAdaptors0x01이 객체에서 찾은 어댑터의 내용을 내보냅니다.
QDBusConnection::ExportScriptableSlots0x10이 오브젝트의 스크립터블 슬롯 내보내기
QDBusConnection::ExportScriptableSignals0x20이 오브젝트의 스크립터블 시그널을 내보냅니다.
QDBusConnection::ExportScriptableProperties0x40이 개체의 스크립트 가능 프로퍼티 내보내기
QDBusConnection::ExportScriptableInvokables0x80이 오브젝트의 스크립터블 인보커블 내보내기
QDBusConnection::ExportScriptableContents0xf0ExportScriptableSlots | ExportScriptableSignals | ExportScriptableProperties 의 속기 형식입니다.
QDBusConnection::ExportNonScriptableSlots0x100이 개체의 스크립트할 수 없는 슬롯 내보내기
QDBusConnection::ExportNonScriptableSignals0x200이 오브젝트의 스크립트 불가능한 신호 내보내기
QDBusConnection::ExportNonScriptableProperties0x400이 오브젝트의 스크립트할 수 없는 프로퍼티 내보내기
QDBusConnection::ExportNonScriptableInvokables0x800이 오브젝트의 스크립트 불가능한 인보커블 내보내기
QDBusConnection::ExportNonScriptableContents0xf00ExportNonScriptableSlots | ExportNonScriptableSignals | ExportNonScriptableProperties 의 축약형입니다.
QDBusConnection::ExportAllSlotsExportScriptableSlots|ExportNonScriptableSlots이 오브젝트의 모든 슬롯 내보내기
QDBusConnection::ExportAllSignalsExportScriptableSignals|ExportNonScriptableSignals이 오브젝트의 모든 시그널을 익스포트합니다.
QDBusConnection::ExportAllPropertiesExportScriptableProperties|ExportNonScriptableProperties이 오브젝트의 모든 프로퍼티 내보내기
QDBusConnection::ExportAllInvokablesExportScriptableInvokables|ExportNonScriptableInvokables이 개체의 모든 인보커블 내보내기
QDBusConnection::ExportAllContentsExportScriptableContents|ExportNonScriptableContents이 개체의 모든 내용 내보내기
QDBusConnection::ExportChildObjects0x1000이 개체의 자식 개체 내보내기

RegisterOptions 유형은 QFlags<RegisterOption>에 대한 typedef입니다. RegisterOption 값의 OR 조합을 저장합니다.

registerObject(), QDBusAbstractAdaptor, 및 어댑터 사용도참조하십시오 .

enum QDBusConnection::UnregisterMode

개체 경로 등록을 취소하는 모드입니다:

상수설명
QDBusConnection::UnregisterNode0이 노드만 등록 취소: 자식 오브젝트를 등록 취소하지 않습니다.
QDBusConnection::UnregisterTree1이 노드와 모든 하위 트리를 등록 취소합니다.

단, 이 오브젝트가 ExportChildObjects 옵션으로 등록된 경우 UnregisterNode는 자식 오브젝트도 등록 취소합니다.

멤버 함수 문서

[explicit] QDBusConnection::QDBusConnection(const QString &name)

name 라는 이름으로 연결에 첨부된 QDBusConnection 객체를 만듭니다.

이렇게 하면 연결이 열리지 않습니다. 연결을 열려면 connectToBus()를 호출해야 합니다.

QDBusConnection::QDBusConnection(const QDBusConnection &other)

other 연결의 복사본을 만듭니다.

[noexcept] QDBusConnection::~QDBusConnection()

이 객체를 폐기합니다. 이렇게 해도 연결이 닫히지 않으므로 disconnectFromBus()를 호출해야 합니다.

QDBusPendingCall QDBusConnection::asyncCall(const QDBusMessage &message, int timeout = -1) const

이 연결을 통해 message 을 전송하고 즉시 반환합니다. 이 함수는 메서드 호출에만 적합합니다. 이 함수는 응답 상태를 추적하는 데 사용할 수 있는 QDBusPendingCall 유형의 객체를 반환합니다.

timeout 밀리초 이내에 응답이 수신되지 않으면 호출이 만료되었음을 나타내는 자동 오류가 전달됩니다. 기본값 timeout 은 -1이며, 프로세스 간 통신에 적합한 구현 정의 값(일반적으로 25초)으로 대체됩니다. 이 시간 제한은 QDBusPendingCall::waitForFinished()에서 대기할 수 있는 상한이기도 합니다.

보다 친숙한 호출 방법은 QDBusInterface::asyncCall() 함수를 참조하세요.

참고: 애플리케이션 자체에서 등록한 객체에 대한 메서드 호출은 구현 제한으로 인해 비동기적이지 않습니다.

QString QDBusConnection::baseService() const

QDBusConnection 개체가 연결된 경우 이 연결의 고유 연결 이름을 반환하고, 그렇지 않으면 빈 QString 을 반환합니다.

고유 연결 이름은 연결 시 D-Bus 서버 데몬이 할당하는 ":x.xxx" 형식의 문자열입니다(여기서 x는 10진수). 이는 버스에서 이 클라이언트를 고유하게 식별합니다.

이 함수는 피어 투 피어 연결의 경우 빈 QString 을 반환합니다.

QDBusMessage QDBusConnection::call(const QDBusMessage &message, QDBus::CallMode mode = QDBus::Block, int timeout = -1) const

이 연결을 통해 message 를 전송하고 최대 timeout 밀리초 동안 응답을 기다리며 차단합니다. 이 함수는 메서드 호출에만 적합합니다. 이 함수는 QDBusMessage::ReplyMessage 또는 QDBusMessage::ErrorMessage 유형 중 하나를 반환 값으로 회신 메시지를 반환합니다.

timeout 밀리초 이내에 응답이 수신되지 않으면 호출이 만료되었음을 나타내는 자동 오류가 전달됩니다. 기본값 timeout 은 -1이며, 프로세스 간 통신에 적합한 구현 정의 값(일반적으로 25초)으로 대체됩니다.

보다 친숙한 호출 방법은 QDBusInterface::call() 함수를 참조하세요.

경고: modeQDBus::BlockWithGui 인 경우 이 함수는 응답을 기다리기 위해 Qt 이벤트 루프에 다시 들어갑니다. 대기하는 동안 애플리케이션에 신호 및 기타 메서드 호출을 전달할 수 있습니다. 따라서 call()으로 호출할 때마다 재진입을 처리할 수 있도록 준비해야 합니다.

bool QDBusConnection::callWithCallback(const QDBusMessage &message, QObject *receiver, const char *returnMethod, const char *errorMethod, int timeout = -1) const

이 연결을 통해 message 을 전송하고 즉시 반환합니다. 응답이 수신되면 receiver 객체에서 returnMethod 메서드가 호출됩니다. 오류가 발생하면 errorMethod 메서드가 대신 호출됩니다.

timeout 밀리초 이내에 응답이 수신되지 않으면 호출이 만료되었음을 나타내는 자동 오류가 전달됩니다. 기본값 timeout 은 -1이며, 프로세스 간 통신에 적합한 구현 정의 값(일반적으로 25초)으로 대체됩니다.

이 함수는 메서드 호출에만 적합합니다. 매개변수 유형이 일치하고 오류가 발생하지 않는 한 응답과 함께 슬롯이 정확히 한 번만 호출되도록 보장됩니다.

메시지가 전송된 경우 true, 메시지를 전송할 수 없는 경우 false를 반환합니다.

bool QDBusConnection::connect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot)

service, path, interface, name 파라미터로 지정된 신호를 객체 receiver 의 슬롯 slot 에 연결합니다. 인자 servicepath 은 비워둘 수 있으며, 원격 애플리케이션에서 (interface, name) 쌍의 모든 신호에 연결됨을 나타냅니다.

연결에 성공하면 true 을 반환합니다.

경고: 매개변수가 일치하는 경우에만 신호가 슬롯으로 전달됩니다. 이 확인은 연결 시점이 아니라 신호가 수신될 때만 수행할 수 있습니다.

bool QDBusConnection::connect(const QString &service, const QString &path, const QString &interface, const QString &name, const QString &signature, QObject *receiver, const char *slot)

이것은 과부하된 함수입니다.

객체 receiver 의 슬롯 slot 에 신호를 연결합니다. 이전 connect() 오버로드와 달리 이 함수는 signature 변수를 사용하여 연결할 매개변수 서명을 지정할 수 있습니다. 그런 다음 이 함수는 이 서명이 slot 으로 지정된 슬롯에 전달될 수 있는지 확인하고 그렇지 않으면 false를 반환합니다.

연결에 성공하면 true 을 반환합니다.

참고: 이 함수는 신호 서명이 슬롯의 파라미터와 일치하는지 확인하지만 실제 신호가 원격 서비스에 지정된 서명과 함께 존재하는지는 확인하지 않습니다.

bool QDBusConnection::connect(const QString &service, const QString &path, const QString &interface, const QString &name, const QStringList &argumentMatch, const QString &signature, QObject *receiver, const char *slot)

이것은 과부하된 함수입니다.

객체 receiver 의 슬롯 slot 에 신호를 연결합니다. 이전 connect() 오버로드와 달리 이 함수는 signature 변수를 사용하여 연결할 매개변수 서명을 지정할 수 있습니다. 그런 다음 이 함수는 이 서명이 slot 에 지정된 슬롯으로 전달될 수 있는지 확인하고 그렇지 않으면 false를 반환합니다.

argumentMatch 매개변수는 일치시킬 문자열 매개변수를 순차 순서대로 나열합니다. 빈 문자열을 일치시키려면 비어 있지만 널이 아닌 QString (즉, QString("")를 전달해야 합니다.) null QString 은 해당 위치에서 일치를 건너뜁니다.

연결에 성공하면 true 을 반환합니다.

참고: 이 함수는 신호 서명이 슬롯의 매개변수와 일치하는지 확인하지만 실제 신호가 원격 서비스에 지정된 서명과 함께 존재하는지는 확인하지 않습니다.

[static] QDBusConnection QDBusConnection::connectToBus(QDBusConnection::BusType type, const QString &name)

알려진 버스 중 하나에 대한 type 유형의 연결을 열고 연결 이름 name 을 연결합니다. 해당 연결과 연결된 QDBusConnection 객체를 반환합니다.

[static] QDBusConnection QDBusConnection::connectToBus(const QString &address, const QString &name)

주소 address 에서 비공개 버스에 대한 연결을 열고 연결 이름 name 을 연결합니다. 해당 연결과 연결된 QDBusConnection 객체를 반환합니다.

[static] QDBusConnection QDBusConnection::connectToPeer(const QString &address, const QString &name)

주소 address 에서 피어 투 피어 연결을 열고 연결 이름 name 을 연결합니다. 해당 연결과 연결된 QDBusConnection 객체를 반환합니다.

QDBusConnection::ConnectionCapabilities QDBusConnection::connectionCapabilities() const

버스 서버 또는 피어와 협상한 대로 이 연결의 기능을 반환합니다. QDBusConnection 이 연결되지 않은 경우 이 함수는 아무 기능도 반환하지 않습니다.

bool QDBusConnection::disconnect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot)

service, path, interface, name 파라미터로 지정된 신호를 객체 receiver 의 슬롯 slot 에서 연결 해제합니다. 인수는 connect() 함수에 전달된 것과 동일해야 합니다.

연결 해제가 성공하면 true 을 반환합니다.

bool QDBusConnection::disconnect(const QString &service, const QString &path, const QString &interface, const QString &name, const QString &signature, QObject *receiver, const char *slot)

이 함수는 오버로드된 함수입니다.

객체 receiver 의 슬롯 slot 에서 service, path, interface, name, signature 파라미터로 지정된 신호를 연결 해제합니다. 인수는 connect() 함수에 전달된 것과 동일해야 합니다.

연결 해제가 성공하면 true 을 반환합니다.

bool QDBusConnection::disconnect(const QString &service, const QString &path, const QString &interface, const QString &name, const QStringList &argumentMatch, const QString &signature, QObject *receiver, const char *slot)

이 함수는 오버로드된 함수입니다.

객체 receiver 의 슬롯 slot 에서 service, path, interface, name, argumentMatch, signature 파라미터로 지정된 신호를 연결 해제합니다. 인수는 connect() 함수에 전달된 것과 동일해야 합니다.

연결 해제에 성공하면 true 을 반환합니다.

[static] void QDBusConnection::disconnectFromBus(const QString &name)

name 이라는 이름의 버스 연결을 닫습니다.

동일한 연결에 연결된 QDBusConnection 객체가 여전히 있는 경우 모든 참조가 삭제될 때까지 연결이 닫히지 않는다는 점에 유의하세요. 그러나 QDBusConnection 생성자를 사용하여 더 이상 참조를 생성할 수 없습니다.

[static] void QDBusConnection::disconnectFromPeer(const QString &name)

name 이라는 이름의 피어 연결을 닫습니다.

동일한 연결에 연결된 QDBusConnection 객체가 여전히 있는 경우 모든 참조가 삭제될 때까지 연결이 닫히지 않는다는 점에 유의하세요. 그러나 QDBusConnection 생성자를 사용하여 더 이상 참조를 만들 수 없습니다.

QDBusConnectionInterface *QDBusConnection::interface() const

이 연결의 D-Bus 서버 인터페이스를 나타내는 QDBusConnectionInterface 객체를 반환합니다.

bool QDBusConnection::isConnected() const

QDBusConnection 객체가 연결되면 true 을 반환합니다.

QDBusError QDBusConnection::lastError() const

이 연결에서 마지막으로 발생한 오류를 반환합니다.

이 함수는 저수준 코드에 제공됩니다. QDBusInterface::call ()를 사용하는 경우 오류 코드는 반환 값으로 보고됩니다.

QDBusInterfaceQDBusMessage참조하세요 .

[static] QByteArray QDBusConnection::localMachineId()

D-Bus 시스템에 알려진 로컬 머신 ID를 반환합니다. D-Bus를 실행하는 각 노드 또는 호스트에는 파일 시스템과 같은 리소스를 공유하는 경우 다른 호스트와 구별하는 데 사용할 수 있는 고유 식별자가 있습니다.

로컬 머신 ID는 시스템 부팅 시에도 영구적으로 유지된다는 보장이 없으므로 이 식별자를 파일 시스템과 같은 영구 저장소에 저장해서는 안 된다는 점에 유의하세요. 이 식별자는 이 부팅 세션의 수명 기간 동안에만 일정하게 유지됩니다.

QString QDBusConnection::name() const

connectToBus()에 이름 매개변수로 지정된 대로 이 연결의 연결 이름을 반환합니다.

연결 이름은 버스에 대한 실제 기본 연결을 고유하게 식별하는 데 사용할 수 있습니다. 단일 연결에서 만들어진 복사본은 항상 암시적으로 기본 연결을 공유하므로 동일한 연결 이름을 갖습니다.

반대로 연결 이름이 다른 두 연결은 항상 다른 버스에 연결되거나 해당 버스에서 다른 고유 이름( baseService()에서 반환된 대로)을 갖습니다.

connectToBus() 및 disconnectFromBus()도 참조하세요 .

QObject *QDBusConnection::objectRegisteredAt(const QString &path) const

path 에 지정된 객체 경로에서 registerObject()에 등록된 객체를 반환합니다.

bool QDBusConnection::registerObject(const QString &path, QObject *object, QDBusConnection::RegisterOptions options = ExportAdaptors)

object 개체를 path 경로에 등록하고 등록에 성공하면 true 를 반환합니다. options 매개변수는 D-Bus를 통해 노출될 object 객체의 양을 지정합니다.

이 함수는 기존 개체를 대체하지 않습니다. path 경로에 이미 등록된 개체가 있는 경우 이 함수는 false를 반환합니다. unregisterObject ()를 사용하여 먼저 등록을 취소하세요.

ExportChildObjects 플래그는 등록된 객체의 경로와 자식의 QObject::objectName 을 기반으로 D-Bus에서 자식 객체를 내보냅니다. 따라서 자식 객체에 객체 이름을 지정하는 것이 중요합니다.

ExportChildObjects 으로 등록된 오브젝트의 자식 오브젝트로는 오브젝트를 등록할 수 없습니다.

bool QDBusConnection::registerObject(const QString &path, const QString &interface, QObject *object, QDBusConnection::RegisterOptions options = ExportAdaptors)

이 함수는 오버로드된 함수입니다.

object 개체를 path 경로에 인터페이스 이름 interface 으로 등록하고 등록에 성공하면 true 을 반환합니다. options 매개변수는 D-Bus를 통해 노출될 object 객체의 양을 지정합니다.

이 함수는 기존 개체를 대체하지 않습니다. path 경로에 이미 등록된 개체가 있는 경우 이 함수는 false를 반환합니다. unregisterObject ()를 사용하여 먼저 등록을 취소하세요.

ExportChildObjects 플래그는 등록된 객체의 경로와 자식의 QObject::objectName 을 기반으로 D-Bus에서 자식 객체를 내보냅니다. 따라서 자식 객체에 객체 이름을 지정하는 것이 중요합니다.

ExportChildObjects 으로 등록된 오브젝트의 자식 오브젝트로는 오브젝트를 등록할 수 없습니다.

bool QDBusConnection::registerService(const QString &serviceName)

D-Bus 서버에 serviceName 등록을 시도하고 등록에 성공하면 true 을 반환합니다. 다른 애플리케이션에 이미 등록된 이름인 경우 등록이 실패합니다.

unregisterService() 및 QDBusConnectionInterface::registerService()도 참조하세요 .

bool QDBusConnection::send(const QDBusMessage &message) const

응답을 기다리지 않고 이 연결을 통해 message 을 전송합니다. 반환값이 필요하지 않은 호출뿐만 아니라 오류, 신호 및 반환값에 적합합니다.

메시지가 성공적으로 큐에 대기 중이면 true, 그렇지 않으면 false를 반환합니다.

[static] QDBusConnection QDBusConnection::sessionBus()

세션 버스로 열린 QDBusConnection 객체를 반환합니다. 이 함수가 반환하는 객체 참조는 애플리케이션이 종료될 때까지 유효하며, 이 시점에서는 연결이 닫히고 객체가 삭제됩니다.

[noexcept] void QDBusConnection::swap(QDBusConnection &other)

이 연결을 other 로 바꿉니다. 이 작업은 매우 빠르며 실패하지 않습니다.

[static] QDBusConnection QDBusConnection::systemBus()

시스템 버스로 열린 QDBusConnection 객체를 반환합니다. 이 함수가 반환하는 객체 참조는 QCoreApplication 의 소멸자가 실행될 때까지 유효하며, 이 때 연결이 닫히고 객체가 삭제됩니다.

void QDBusConnection::unregisterObject(const QString &path, QDBusConnection::UnregisterMode mode = UnregisterNode)

registerObject()에 등록된 객체를 path 에 지정된 객체 경로에서 등록 취소하고 modeQDBusConnection::UnregisterTree 인 경우 해당 하위 객체도 모두 등록 취소합니다.

registerObject()에 등록되지 않은 객체는 등록 취소할 수 없습니다.

bool QDBusConnection::unregisterService(const QString &serviceName)

이전에 registerService()에 등록한 서비스 serviceName 등록을 취소하고 성공하면 true 반환합니다.

registerService() 및 QDBusConnectionInterface::unregisterService()도 참조하세요 .

QDBusConnection &QDBusConnection::operator=(const QDBusConnection &other)

이 객체에 other 연결의 복사본을 만듭니다. 복사하기 전에 이 객체가 참조한 연결은 자발적으로 연결이 끊어지지 않습니다.

disconnectFromBus()도 참조하세요 .

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