summaryrefslogtreecommitdiff
path: root/src/dbus
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-02-04 06:12:58 +1000
committerQt Continuous Integration System <qt-info@nokia.com>2011-02-04 06:12:58 +1000
commitf67f6bc8bcb2092da77905aa67942f59cd49470b (patch)
treea2add1b11025e2fd43aabe30da9d75948780ce51 /src/dbus
parentc0b1153b2fef7aa203ec5894fde616802f3c4725 (diff)
parente97d3f3f571e3cc5f5851ea2e131ac92212802dd (diff)
downloadqt4-tools-f67f6bc8bcb2092da77905aa67942f59cd49470b.tar.gz
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QtDBus: add support for QVariantHash out of the box
Diffstat (limited to 'src/dbus')
-rw-r--r--src/dbus/qdbusargument.h15
-rw-r--r--src/dbus/qdbusmetatype.cpp1
2 files changed, 16 insertions, 0 deletions
diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h
index 2c8693b4b3..e331d8ff4c 100644
--- a/src/dbus/qdbusargument.h
+++ b/src/dbus/qdbusargument.h
@@ -376,6 +376,21 @@ inline const QDBusArgument &operator>>(const QDBusArgument &arg, QHash<Key, T> &
return arg;
}
+inline QDBusArgument &operator<<(QDBusArgument &arg, const QVariantHash &map)
+{
+ arg.beginMap(QVariant::String, qMetaTypeId<QDBusVariant>());
+ QVariantHash::ConstIterator it = map.constBegin();
+ QVariantHash::ConstIterator end = map.constEnd();
+ for ( ; it != end; ++it) {
+ arg.beginMapEntry();
+ arg << it.key() << QDBusVariant(it.value());
+ arg.endMapEntry();
+ }
+ arg.endMap();
+ return arg;
+}
+
+
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QDBusArgument)
diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp
index 6de5d9377c..9f2920594b 100644
--- a/src/dbus/qdbusmetatype.cpp
+++ b/src/dbus/qdbusmetatype.cpp
@@ -127,6 +127,7 @@ void QDBusMetaTypeId::init()
registerHelper<QLineF>();
registerHelper<QVariantList>();
registerHelper<QVariantMap>();
+ registerHelper<QVariantHash>();
qDBusRegisterMetaType<QList<bool> >();
qDBusRegisterMetaType<QList<short> >();