Add QDBusArgument template overloads for QPair
Change-Id: Ic7c199b20f9b3f34ae8a16b6062b3a3d8722f063 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
This commit is contained in:
parent
9b0fab6b62
commit
f4b4b4414e
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user