From 0c1d23db7bada763f1e5d82cebda0e7738549b48 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 2 Oct 2019 12:05:32 +0200 Subject: Doc: Add info about QDBusConnection::ExportChildObjects Child objects need QObject::objectName. Fixes: QTBUG-17740 Change-Id: Iebf8bcd7252f8a441d7c265aae3d4dd81b3cfa54 Reviewed-by: Paul Wicking Reviewed-by: Frederik Gladhorn --- src/dbus/qdbusconnection.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/dbus') diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp index 2c2dfc1ff6..296d5b369f 100644 --- a/src/dbus/qdbusconnection.cpp +++ b/src/dbus/qdbusconnection.cpp @@ -870,8 +870,12 @@ bool QDBusConnection::disconnect(const QString &service, const QString &path, co This function does not replace existing objects: if there is already an object registered at path \a path, this function will return false. Use unregisterObject() to unregister it first. + The ExportChildObjects flag exports child objects on D-Bus based on the + path of the registered objects and the QObject::objectName of the child. + Therefore, it is important for the child object to have an object name. + You cannot register an object as a child object of an object that - was registered with QDBusConnection::ExportChildObjects. + was registered with ExportChildObjects. */ bool QDBusConnection::registerObject(const QString &path, QObject *object, RegisterOptions options) { @@ -890,8 +894,12 @@ bool QDBusConnection::registerObject(const QString &path, QObject *object, Regis This function does not replace existing objects: if there is already an object registered at path \a path, this function will return false. Use unregisterObject() to unregister it first. + The ExportChildObjects flag exports child objects on D-Bus based on the + path of the registered objects and the QObject::objectName of the child. + Therefore, it is important for the child object to have an object name. + You cannot register an object as a child object of an object that - was registered with QDBusConnection::ExportChildObjects. + was registered with ExportChildObjects. */ bool QDBusConnection::registerObject(const QString &path, const QString &interface, QObject *object, RegisterOptions options) { -- cgit v1.2.3