From 4787f1eb0fd1363536dc64f168d382e6247f1097 Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Mon, 27 Sep 2010 19:03:30 -0300 Subject: Added hash functions for QLine, QPoint, QRect and QSize classes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests where also added. Reviewed by Luciano Wolf Reviewed by Renato Araújo --- PySide/QtCore/typesystem_core.xml | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) (limited to 'PySide') diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml index 0eafbb1d7..70e18e538 100644 --- a/PySide/QtCore/typesystem_core.xml +++ b/PySide/QtCore/typesystem_core.xml @@ -674,7 +674,15 @@ - + + + namespace PySide { + template<> inline uint hash(const QLine& v) { + return qHash(qMakePair(qMakePair(v.x1(), v.y1()), qMakePair(v.x2(), v.y2()))); + } + }; + + @@ -756,7 +764,14 @@ - + + + namespace PySide { + template<> inline uint hash(const QPoint& v) { + return qHash(qMakePair(v.x(), v.y())); + } + }; + @@ -764,7 +779,14 @@ - + + + namespace PySide { + template<> inline uint hash(const QRect& v) { + return qHash(qMakePair(qMakePair(v.x(), v.y()), qMakePair(v.width(), v.height()))); + } + }; + @@ -780,7 +802,15 @@ - + + + + namespace PySide { + template<> inline uint hash(const QSize& v) { + return qHash(qMakePair(v.width(), v.height())); + } + }; + -- cgit v1.2.3