diff options
author | David Faure <faure@kde.org> | 2013-05-04 15:13:47 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-10 09:03:29 +0200 |
commit | 2116f9904afca7b3942433269b66a9756d5876bc (patch) | |
tree | b3b5a45ef56874da365d91b6df12f70e793a68ef /tests/auto/dbus/qdbusabstractinterface/interface.h | |
parent | 1b2d3be446df492c009bd575637a0f103241ce4d (diff) |
QDBus: Add test for a{sv} and an annotation pointing to QVariantHash.
QVariantMap would work too; I presume this is why the annotation is needed,
rather than QtDBus automatically figuring out which type to use.
This even checks that QHash<QString,QVariant> works in the annotation,
although QVariantHash would be simpler to write, obviously.
Change-Id: I7a339ca90f10e5ec97dcea1bb4dbba3c515e6b23
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
Diffstat (limited to 'tests/auto/dbus/qdbusabstractinterface/interface.h')
-rw-r--r-- | tests/auto/dbus/qdbusabstractinterface/interface.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/auto/dbus/qdbusabstractinterface/interface.h b/tests/auto/dbus/qdbusabstractinterface/interface.h index 5db59b19eb..ecf732ce2d 100644 --- a/tests/auto/dbus/qdbusabstractinterface/interface.h +++ b/tests/auto/dbus/qdbusabstractinterface/interface.h @@ -43,6 +43,7 @@ #define INTERFACE_H #include <QtCore/QObject> +#include <QtCore/QHash> #include <QtDBus/QDBusArgument> struct RegisteredType @@ -103,7 +104,7 @@ public slots: Q_SCRIPTABLE void voidMethod() {} Q_SCRIPTABLE int sleepMethod(int); Q_SCRIPTABLE QString stringMethod() { return "Hello, world"; } - Q_SCRIPTABLE RegisteredType complexMethod() { return RegisteredType("Hello, world"); } + Q_SCRIPTABLE RegisteredType complexMethod(const QVariantHash &vars) { return RegisteredType(vars.value("arg1").toString()); } Q_SCRIPTABLE QString multiOutMethod(int &value) { value = 42; return "Hello, world"; } signals: |