Fixed QLineEdit.getTextMargins return value.
Fixes bug #632 Reviewer: Hugo Parente Lima <hugo.pl@gmail.com> Marcelo Lira <marcelo.lira@openbossa.org>
This commit is contained in:
parent
a4d7d8f80d
commit
9a4c439d7f
3 changed files with 41 additions and 0 deletions
|
|
@ -4333,6 +4333,26 @@
|
||||||
</modify-argument>
|
</modify-argument>
|
||||||
</modify-function>
|
</modify-function>
|
||||||
<modify-function signature="del()" rename="del_" />
|
<modify-function signature="del()" rename="del_" />
|
||||||
|
<modify-function signature="getTextMargins(int *, int *, int *, int *) const">
|
||||||
|
<modify-argument index="0">
|
||||||
|
<replace-type modified-type="PyObject *" />
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="1">
|
||||||
|
<remove-argument/>
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="2">
|
||||||
|
<remove-argument/>
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="3">
|
||||||
|
<remove-argument/>
|
||||||
|
</modify-argument>
|
||||||
|
<modify-argument index="4">
|
||||||
|
<remove-argument/>
|
||||||
|
</modify-argument>
|
||||||
|
<inject-code class="target" position="beginning">
|
||||||
|
<insert-template name="fix_int*,int*,int*,int*"/>
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
</object-type>
|
</object-type>
|
||||||
<object-type name="QLCDNumber">
|
<object-type name="QLCDNumber">
|
||||||
<enum-type name="Mode"/>
|
<enum-type name="Mode"/>
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,7 @@
|
||||||
%CPPSELF.%FUNCTION_NAME(&a, &b, &c, &d);
|
%CPPSELF.%FUNCTION_NAME(&a, &b, &c, &d);
|
||||||
%PYARG_0 = Shiboken::makeTuple(a, b, c, d);
|
%PYARG_0 = Shiboken::makeTuple(a, b, c, d);
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template name="fix_qreal*,qreal*,qreal*,qreal*">
|
<template name="fix_qreal*,qreal*,qreal*,qreal*">
|
||||||
qreal a, b, c, d;
|
qreal a, b, c, d;
|
||||||
%CPPSELF.%FUNCTION_NAME(&a, &b, &c, &d);
|
%CPPSELF.%FUNCTION_NAME(&a, &b, &c, &d);
|
||||||
|
|
|
||||||
20
tests/QtGui/bug_632.py
Normal file
20
tests/QtGui/bug_632.py
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
import sys
|
||||||
|
from PySide.QtGui import QLineEdit, QApplication
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
|
||||||
|
class Bug589(unittest.TestCase):
|
||||||
|
def testWrongSignature(self):
|
||||||
|
text = QLineEdit("PySide bug 632")
|
||||||
|
a = b = c = d = 0
|
||||||
|
self.assertRaises(TypeError, text.getTextMargins, (a, b, c, d))
|
||||||
|
|
||||||
|
def testTupleReturn(self):
|
||||||
|
text = QLineEdit("PySide bug 632")
|
||||||
|
text.setTextMargins(10, 20, 30, 40)
|
||||||
|
(a, b, c, d) = text.getTextMargins()
|
||||||
|
self.assert_((a, b, c, d), (10, 20, 30, 40))
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
app = QApplication(sys.argv)
|
||||||
|
unittest.main()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue