QDBusServer Class

The QDBusServer class provides peer-to-peer communication between processes on the same computer. More...

Header: #include <QDBusServer>
CMake: find_package(Qt6 REQUIRED COMPONENTS DBus)
target_link_libraries(mytarget PRIVATE Qt6::DBus)
qmake: QT += dbus
Inherits: QObject

Public Functions

QDBusServer(const QString &address, QObject *parent = nullptr)
QDBusServer(QObject *parent = nullptr)
virtual ~QDBusServer()
QString address() const
bool isAnonymousAuthenticationAllowed() const
bool isConnected() const
QDBusError lastError() const
void setAnonymousAuthenticationAllowed(bool value)

Signals

void newConnection(const QDBusConnection &connection)

Detailed Description

Member Function Documentation

[explicit] QDBusServer::QDBusServer(const QString &address, QObject *parent = nullptr)

Constructs a QDBusServer with the given address, and the given parent.

[explicit] QDBusServer::QDBusServer(QObject *parent = nullptr)

Constructs a QDBusServer with the given parent. The server will listen for connections in /tmp (on Unix systems) or on a TCP port bound to localhost (elsewhere).

[virtual noexcept] QDBusServer::~QDBusServer()

Destructs a QDBusServer

QString QDBusServer::address() const

Returns the address this server is associated with.

bool QDBusServer::isAnonymousAuthenticationAllowed() const

Returns true if anonymous authentication is allowed.

See also setAnonymousAuthenticationAllowed().

bool QDBusServer::isConnected() const

Returns true if this QDBusServer object is connected.

If it isn't connected, you need to call the constructor again.

QDBusError QDBusServer::lastError() const

Returns the last error that happened in this server.

This function is provided for low-level code.

[signal] void QDBusServer::newConnection(const QDBusConnection &connection)

This signal is emitted when a new client connection connection is established to the server.

void QDBusServer::setAnonymousAuthenticationAllowed(bool value)

If value is set to true, an incoming connection can proceed even if the connecting client is not authenticated as a user.

By default, this value is false.

See also isAnonymousAuthenticationAllowed().

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