summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Popov <6yearold@gmail.com>2015-10-17 12:10:16 (GMT)
committerGleb Popov <6yearold@gmail.com>2015-10-17 12:10:16 (GMT)
commitb8d22401f26eba647e86706a1c88f912e42b5b5a (patch)
treeddacea1f50896c39328507ff4456c90b2fda237b
parent9d0f5e63121bb3d3176f13ec3db07c2078e9be7f (diff)
Implement qHash() for Okular::NormalizedRect.
-rw-r--r--core/area.cpp5
-rw-r--r--core/area.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/core/area.cpp b/core/area.cpp
index 86bec72..bc31cc6 100644
--- a/core/area.cpp
+++ b/core/area.cpp
@@ -267,6 +267,11 @@ void NormalizedRect::transform( const QTransform &matrix )
bottom = rect.bottom();
}
+uint qHash( const NormalizedRect& r, uint seed )
+{
+ return qHash(r.bottom, qHash(r.right, qHash(r.top, qHash(r.left, seed))));
+}
+
QDebug operator<<( QDebug str, const Okular::NormalizedRect& r )
{
str.nospace() << "NormRect(" << r.left << "," << r.top << " x " << ( r.right - r.left ) << "+" << ( r.bottom - r.top ) << ")";
diff --git a/core/area.h b/core/area.h
index 5e0f522..a595f42 100644
--- a/core/area.h
+++ b/core/area.h
@@ -898,6 +898,8 @@ class HighlightAreaRect : public RegularAreaRect
}
+uint qHash(const Okular::NormalizedRect& r, uint seed = 0);
+
#ifndef QT_NO_DEBUG_STREAM
/**
* Debug operator for normalized @p point.