aboutsummaryrefslogtreecommitdiffstats
path: root/generator
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>2012-03-08 16:12:51 -0300
commit87ae5790fa75114dbf335380ca7ab644b013a50b (patch)
treec4b502dcf425cb832d8ba1c577d790a1ba28ce1a /generator
parent4a25e3a3801cebfb90cf89fd1eb1faf05c4725a1 (diff)
Add support to fix the bug#493 - "__eq__ and friends not implemented for QKeyEvent == QKeySequence"
Diffstat (limited to 'generator')
-rw-r--r--generator/cppgenerator.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index 68a00e0a4..a2da128b0 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -2013,6 +2013,9 @@ void CppGenerator::writeMethodCall(QTextStream& s, const AbstractMetaFunction* f
}
} else if (func->isOperatorOverload()) {
QString firstArg("(*" CPP_SELF_VAR ")");
+ if (func->isPointerOperator())
+ firstArg.remove(1, 1); // remove the de-reference operator
+
QString secondArg(CPP_ARG0);
if (!func->isUnaryOperator() && shouldDereferenceArgumentPointer(func->arguments().first())) {
secondArg.prepend('(');
@@ -2855,7 +2858,10 @@ void CppGenerator::writeRichCompareFunction(QTextStream& s, const AbstractMetaCl
s << INDENT << "Py_INCREF(Py_None);" << endl;
s << INDENT << CPP_SELF_VAR " " << op << " cppOther; // this op return void" << endl;
} else {
- writeToPythonConversion(s, func->type(), metaClass, CPP_SELF_VAR " " + op + " cppOther");
+ QByteArray self(CPP_SELF_VAR);
+ if (func->isPointerOperator())
+ self.prepend('&');
+ writeToPythonConversion(s, func->type(), metaClass, self + ' ' + op + " cppOther");
s << ';' << endl;
}
}