QDBusServer 类提供在同一计算机中的进程间点对点通信。 更多...
| 头: | #include <QDBusServer> |
| CMake: |
find_package(Qt6 COMPONENTS Dbus REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Dbus) |
| qmake: | QT += dbus |
| 继承: | QObject |
| QDBusServer (QObject * parent = nullptr) | |
| QDBusServer (const QString & address , QObject * parent = nullptr) | |
| virtual | ~QDBusServer () |
| QString | address () const |
| bool | isAnonymousAuthenticationAllowed () const |
| bool | isConnected () const |
| QDBusError | lastError () const |
| void | setAnonymousAuthenticationAllowed (bool value ) |
| void | newConnection (const QDBusConnection & connection ) |
构造 QDBusServer 采用给定
parent
。服务器将监听连接在
/tmp
(在 Unix 系统) 或在绑定到本地主机 (其它地方) 的 TCP 端口。
构造 QDBusServer 采用给定 address ,和给定 parent .
[signal]
void
QDBusServer::
newConnection
(const
QDBusConnection
&
connection
)
此信号被发射,当新客户端连接 connection 到服务器已建立。
[虚拟]
QDBusServer::
~QDBusServer
()
销毁 QDBusServer
返回此服务器关联的地址。
[since 5.3]
bool
QDBusServer::
isAnonymousAuthenticationAllowed
() const
返回 true 若允许匿名身份验证。
该函数在 Qt 5.3 引入。
另请参阅 setAnonymousAuthenticationAllowed ().
返回
true
若此
QDBusServer
对象被连接。
若未连接,需要再次调用构造函数。
返回此服务器最后发生的错误。
此函数是为低级代码提供的。
[since 5.3]
void
QDBusServer::
setAnonymousAuthenticationAllowed
(
bool
value
)
若 value 被设为 true,传入连接可以继续进行,即使作为用户连接客户端未通过身份验证。
默认情况下,此值为 false。
该函数在 Qt 5.3 引入。
另请参阅 isAnonymousAuthenticationAllowed ().