Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0"?>
- <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
- <node>
- <interface name="some.interface.Foo">
- <method name="GetValues">
- <arg name="values" type="a(oa{sv})" direction="out"/>
- <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList<SomeStruct>" />
- </method>
- </interface>
- </node>
- qdbusxml2cpp-qt5 -c InterfaceFoo -p interface_foo foo.xml
- class InterfaceFoo: public QDBusAbstractInterface
- {
- Q_OBJECT
- public:
- static inline const char *staticInterfaceName()
- { return "some.interface.Foo"; }
- public:
- InterfaceFoo(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
- ~InterfaceFoo();
- public Q_SLOTS: // METHODS
- inline QDBusPendingReply<QList<SomeStruct> > GetValues()
- {
- QList<QVariant> argumentList;
- // NOTICE THIS LINE.
- return asyncCallWithArgumentList(QStringLiteral("GetValues"), argumentList);
- }
- Q_SIGNALS: // SIGNALS
- };
- namespace some {
- namespace interface {
- typedef ::InterfaceFoo Foo;
- }
- }
- #endif
- some::interface::Foo *interface = new some::interface::Foo("some::interface", "/Foo", QDBusConnection::systemBus(), this);
- // THIS SHOULD block until a reply is received or it times out.
- QList<SomeStruct> data = interface->GetValues();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement