QDBusVirtualObject Class
QDBusVirtualObject 클래스는 하나의 클래스로 여러 DBus 경로를 처리하는 데 사용됩니다. 더 보기...
| 헤더: | #include <QDBusVirtualObject> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS DBus) target_link_libraries(mytarget PRIVATE Qt6::DBus) |
| qmake: | QT += dbus |
| 상속: | QObject |
공개 함수
| QDBusVirtualObject(QObject *parent = nullptr) | |
| virtual | ~QDBusVirtualObject() |
| virtual bool | handleMessage(const QDBusMessage &message, const QDBusConnection &connection) = 0 |
| virtual QString | introspect(const QString &path) const = 0 |
멤버 함수 설명서
[explicit] QDBusVirtualObject::QDBusVirtualObject(QObject *parent = nullptr)
parent 를 사용하여 QDBusVirtualObject를 생성합니다.
[virtual noexcept] QDBusVirtualObject::~QDBusVirtualObject()
객체를 삭제하고, 해당 객체의 모든 자식 객체도 함께 삭제합니다.
[pure virtual] bool QDBusVirtualObject::handleMessage(const QDBusMessage &message, const QDBusConnection &connection)
이 함수는 SubPath 옵션이 지정되었을 때, 가상 객체의 경로로 들어오는 모든 메시지를 처리해야 합니다. 서비스, 경로, 인터페이스 및 메서드는 모두 message 에 포함되어 있습니다. 매개변수 ` connection `는 연결 핸들입니다. 메시지를 처리한 후에는 ` true `를 반환해야 하며, 그렇지 않을 경우 ` false `를 반환해야 합니다(이 경우 DBus 오류 메시지가 생성됩니다).
[pure virtual] QString QDBusVirtualObject::introspect(const QString &path) const
이 함수는 ` path`에 대한 가상 객체의 내부 구조를 처리해야 합니다. 다음 형식의 XML을 반환해야 합니다:
<interface name="org.qtproject.QtDBus.MyObject" >
<property access="readwrite" type="i" name="prop1" />
</interface>SubPath 옵션을 전달하는 경우, 이 내부 조사는 모든 자식 노드를 포함해야 합니다. 그렇지 않은 경우 QDBus 에서 자식 노드의 내부 조사를 처리합니다.
© 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.