diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-12-29 16:34:39 -0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-12-29 16:41:59 -0200 |
commit | 1faf14ceb8a3eff5ecf3b92ce846970171f9e2b8 (patch) | |
tree | ecb3ad136326ac3fe10c00b68ad8a78b94595140 /tests/libsample/objecttypeoperators.cpp | |
parent | e5da714a34ea4571573741a79f0733c561f1c13d (diff) | |
download | shiboken-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.cpp | 22 |
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(); +} |