本页内容

QDBus Namespace

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

头文件: #include <qdbusconnection.h>
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 事件循环等待响应。这意味着用户界面将保持响应状态(处理输入事件),但也意味着可能会发生其他事件,例如信号传递和其他 Qt D-Bus 方法调用。
QDBus::AutoDetect3自动检测被调用函数是否具有回复。

使用 BlockWithGui 时,应用程序必须确保任何函数都支持重入。

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