diff options
author | Renato Filho <renato.filho@openbossa.org> | 2010-06-08 17:42:43 -0300 |
---|---|---|
committer | Renato Filho <renato.filho@openbossa.org> | 2010-06-08 18:00:02 -0300 |
commit | bf8a60db4cdbfc3e7c9c98778b219e9c83746d44 (patch) | |
tree | 6d7b4c00e220b17fc676d2617158af3e6e1dc021 /libpyside | |
parent | cf6e5f16687a0b28677a5c4ff035eebc5424272d (diff) |
Created support to hash objects with type QDate, QTime, QDateTime, QUrl.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>,
Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'libpyside')
-rw-r--r-- | libpyside/pyside.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libpyside/pyside.h b/libpyside/pyside.h index 2048265f4..52aeec17e 100644 --- a/libpyside/pyside.h +++ b/libpyside/pyside.h @@ -45,6 +45,15 @@ namespace PySide PYSIDE_API void init(PyObject *module); /** + * Hash function used to enable hash on objects not supported on native Qt library which has toString function. + */ +template<class T> +inline uint hash(const T& value) +{ + return qHash(value.toString()); +} + +/** * If the type \p T was registered on Qt meta type system with Q_DECLARE_METATYPE macro, this class will initialize * the meta type. * |