QT_ADD_DBUS_인터페이스

D-Bus 인터페이스 설명 파일에 대한 인터페이스를 구현하는 C++ 소스를 생성합니다.

이 명령은 Qt6 패키지의 DBus 컴포넌트에 정의되어 있습니다. 패키지를 로드합니다:

find_package(Qt6 REQUIRED COMPONENTS DBus)

이 명령은 Qt 6.0에 도입되었습니다.

개요

qt_add_dbus_interface(<VAR> dbus_spec basename)

버전 없는 명령을 사용할 수 없는 경우 qt6_add_dbus_interface() 을 대신 사용합니다. 이 명령은 이 명령과 동일한 인수 집합을 지원합니다.

설명

dbus_spec 에 정의된 D-Bus 인터페이스 설명 파일에 대한 인터페이스를 구현하는 C++ 소스를 생성합니다. 생성된 파일의 이름은 basename: basename.h, basename.cpp, basename.moc 입니다. 파일 경로는 <VAR> 에 추가됩니다.

이 함수는 인터페이스(프록시) 모드에서 Qt D-Bus XML 컴파일러(qdbusxml2cpp )에 대한 호출을 설정합니다. 기본적으로 qdbusxml2cpp 은 인터페이스 이름의 이름을 딴 C++ 클래스를 네임스페이스 별칭과 함께 생성합니다:

D-Bus 인터페이스 이름클래스 이름네임스페이스 이름
org.example.chatOrgExampleChatInterfaceorg.example.chat

옵션

옵션은 dbus_spec 에서 set_source_files_properties 을 사용하여 설정할 수 있습니다:

옵션설명
CLASSNAMEclass_name기본 인터페이스 클래스 이름을 class_name 로 재정의합니다.
NO_NAMESPACEbooleanON 로 설정된 경우 네임스페이스 이름을 생성하지 않습니다.
INCLUDEpath생성된 코드에 #include "path" 을 추가합니다.

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