QDBus Namespace

QDBus 命名空间包含Qt D-Bus 模块中使用的各种标识符。更多

头文件: #include <QDBus>
CMake: find_package(Qt6 REQUIRED COMPONENTS DBus)
target_link_libraries(mytarget PRIVATE Qt6::DBus)
qmake: QT += dbus

类型

enum CallMode { NoBlock, Block, BlockWithGui, AutoDetect }

详细说明

类型文档

enum QDBus::CallMode

该枚举描述了放置函数调用的各种方式。有效模式包括

常量说明
QDBus::NoBlock0发出调用,但不等待回复(回复内容将被丢弃)。
QDBus::Block1不使用事件循环等待回复,而是在等待期间阻塞网络操作。这意味着在函数返回之前,用户界面可能不会更新。
QDBus::BlockWithGui2使用 Qt 事件循环等待回复。这意味着用户界面将保持响应(处理输入事件),但也意味着可能会发生其他事件,如信号传输和其他 D-Bus 方法调用。
QDBus::AutoDetect3自动检测被调用函数是否有回复。

使用 BlockWithGui 时,应用程序必须为任何函数的重入做好准备。

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