Add QDBusArgument template overloads for QPair

Change-Id: Ic7c199b20f9b3f34ae8a16b6062b3a3d8722f063
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
This commit is contained in:
Thiago Macieira 2012-11-18 10:36:56 -08:00 committed by The Qt Project
parent 9b0fab6b62
commit f4b4b4414e

View File

@ -397,6 +397,23 @@ inline QDBusArgument &operator<<(QDBusArgument &arg, const QVariantHash &map)
return arg;
}
template <typename T1, typename T2>
inline QDBusArgument &operator<<(QDBusArgument &arg, const QPair<T1, T2> &pair)
{
arg.beginStructure();
arg << pair.first << pair.second;
arg.endStructure();
return arg;
}
template <typename T1, typename T2>
inline const QDBusArgument &operator>>(const QDBusArgument &arg, QPair<T1, T2> &pair)
{
arg.beginStructure();
arg >> pair.first >> pair.second;
arg.endStructure();
return arg;
}
QT_END_NAMESPACE