diff options
Diffstat (limited to 'libpyside/pyside.h')
-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. * |