← Development/Tutorials/D-Bus/Intermediate D-Bus You do not have permission to edit this page, for the following reason: The action you have requested is limited to users in one of the groups: Users, Administrators, trusted, KDEDevelopers. You can view and copy the source of this page. == Abstract == The basic techniques explained in [[../Accessing_Interfaces|Accessing Interfaces]] are suitable for using D-Bus methods with relatively simple signatures, but the more complex interfaces often found in the wild require additional techniques to address, explained in this article. == Complex Return Types == QtDBus requires additional setup to deal with methods that return more complex return types than single primitives. The return type needs to be declared to the Qt type system so that it can be demarshalled. === Lists === Lists of values returned by D-Bus methods are mapped to QList in QtDBus. The appropriate specialisation of QList should be declared as a type to the Qt type system, for example: <tt>Q_DECLARE_METATYPE(QList<QDBusObjectPath>)</tt> It is essential that the Q_DECLARE_METATYPE macro is used outside any code blocks or methods in source code. The best place to use it is at the top of the file. The type should also be declared to QtDbus using: <tt>qDBusRegisterMetaType<QList<QDBusObjectPath> >();</tt> === Dicts === The DBus Dict type should map to QMap, example to follow.. Templates used on this page: Template:Qt (view source) Template:TutorialBrowser (view source) Return to Development/Tutorials/D-Bus/Intermediate D-Bus. Retrieved from "https://techbase.kde.org/Development/Tutorials/D-Bus/Intermediate_D-Bus"