summaryrefslogtreecommitdiffstats
path: root/tests/libsample/objecttypeoperators.cpp
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-12-29 16:34:39 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-12-29 16:41:59 -0200
commit1faf14ceb8a3eff5ecf3b92ce846970171f9e2b8 (patch)
treeecb3ad136326ac3fe10c00b68ad8a78b94595140 /tests/libsample/objecttypeoperators.cpp
parente5da714a34ea4571573741a79f0733c561f1c13d (diff)
downloadshiboken-1faf14ceb8a3eff5ecf3b92ce846970171f9e2b8.tar.gz
shiboken-1faf14ceb8a3eff5ecf3b92ce846970171f9e2b8.tar.xz
shiboken-1faf14ceb8a3eff5ecf3b92ce846970171f9e2b8.zip
Add support to fix the bug#493 - "__eq__ and friends not implemented for QKeyEvent == QKeySequence"
Diffstat (limited to 'tests/libsample/objecttypeoperators.cpp')
-rw-r--r--tests/libsample/objecttypeoperators.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/libsample/objecttypeoperators.cpp b/tests/libsample/objecttypeoperators.cpp
index 08c49b1a..43aedc5d 100644
--- a/tests/libsample/objecttypeoperators.cpp
+++ b/tests/libsample/objecttypeoperators.cpp
@@ -31,13 +31,27 @@ bool ObjectTypeOperators::operator==(const ObjectTypeOperators& other) const
return m_key == other.m_key;
}
-bool ObjectTypeOperators::operator==(const std::string& other) const
+const ObjectTypeOperators& ObjectTypeOperators::operator<(const ObjectTypeOperators& other) const
{
- return m_key == other;
+ return m_key < other.m_key ? *this : other;
}
-const ObjectTypeOperators& ObjectTypeOperators::operator<(const ObjectTypeOperators& other) const
+bool operator==(const ObjectTypeOperators* obj, const std::string& str)
{
- return m_key < other.m_key ? *this : other;
+ return obj->key() == str;
+}
+
+bool operator==(const std::string& str, const ObjectTypeOperators* obj)
+{
+ return str == obj->key();
+}
+
+std::string operator+(const ObjectTypeOperators* obj, const std::string& str)
+{
+ return obj->key() + str;
}
+std::string operator+(const std::string& str, const ObjectTypeOperators* obj)
+{
+ return str + obj->key();
+}