Fixes bug #742 - Method "void QPrinter::getPageMargins(qreal*,qreal*,qreal*,qreal*,Unit) const" missing
Also added unit tests. http://bugs.pyside.org/show_bug.cgi?id=742
This commit is contained in:
parent
6efe441b76
commit
eed7193f32
3 changed files with 38 additions and 3 deletions
|
|
@ -6410,8 +6410,28 @@
|
||||||
<enum-type name="PrinterMode"/>
|
<enum-type name="PrinterMode"/>
|
||||||
<enum-type name="PrinterState"/>
|
<enum-type name="PrinterState"/>
|
||||||
<enum-type name="Unit"/>
|
<enum-type name="Unit"/>
|
||||||
<!-- ### See bug 742 -->
|
<modify-function signature="getPageMargins(qreal*,qreal*,qreal*,qreal*,QPrinter::Unit)const">
|
||||||
<modify-function signature="getPageMargins(qreal*,qreal*,qreal*,qreal*,QPrinter::Unit)const" remove="all" />
|
<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_number*,number*,number*,number*,args">
|
||||||
|
<replace from="$TYPE" to="qreal" />
|
||||||
|
</insert-template>
|
||||||
|
</inject-code>
|
||||||
|
</modify-function>
|
||||||
<modify-function signature="setEngines(QPrintEngine*,QPaintEngine*)">
|
<modify-function signature="setEngines(QPrintEngine*,QPaintEngine*)">
|
||||||
<modify-argument index="1">
|
<modify-argument index="1">
|
||||||
<parent index="this" action="add"/>
|
<parent index="this" action="add"/>
|
||||||
|
|
|
||||||
|
|
@ -150,6 +150,14 @@
|
||||||
%PYARG_0 = Shiboken::makeTuple(a, b, c, d);
|
%PYARG_0 = Shiboken::makeTuple(a, b, c, d);
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template name="fix_number*,number*,number*,number*,args">
|
||||||
|
$TYPE a, b, c, d;
|
||||||
|
%BEGIN_ALLOW_THREADS
|
||||||
|
%CPPSELF->::%TYPE::%FUNCTION_NAME(&a, &b, &c, &d, %ARGUMENT_NAMES);
|
||||||
|
%END_ALLOW_THREADS
|
||||||
|
%PYARG_0 = Shiboken::makeTuple(a, b, c, d);
|
||||||
|
</template>
|
||||||
|
|
||||||
<template name="fix_native_return_number*,number*,number*,number*">
|
<template name="fix_native_return_number*,number*,number*,number*">
|
||||||
PyObject* _obj = %PYARG_0.object();
|
PyObject* _obj = %PYARG_0.object();
|
||||||
if (!PySequence_Check(_obj)
|
if (!PySequence_Check(_obj)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import unittest
|
import unittest
|
||||||
from PySide.QtGui import QLayout, QWidget, QGraphicsLayout, QGraphicsLayoutItem, QTextCursor
|
from PySide.QtGui import QLayout, QWidget, QGraphicsLayout, QGraphicsLayoutItem, QTextCursor, QPrinter
|
||||||
|
|
||||||
from helper import UsesQApplication
|
from helper import UsesQApplication
|
||||||
|
|
||||||
|
|
@ -43,6 +43,13 @@ class ReturnsQuadruplesOfNumbers(UsesQApplication):
|
||||||
obj = QTextCursor()
|
obj = QTextCursor()
|
||||||
self.assertEquals(obj.selectedTableCells(), (-1, -1, -1, -1))
|
self.assertEquals(obj.selectedTableCells(), (-1, -1, -1, -1))
|
||||||
|
|
||||||
|
def testQPrinterGetPageMargins(self):
|
||||||
|
# Bug #742
|
||||||
|
obj = QPrinter()
|
||||||
|
values = (10.0, 20.0, 30.0, 40.0, QPrinter.Point)
|
||||||
|
obj.setPageMargins(*values)
|
||||||
|
self.assertEquals(obj.getPageMargins(QPrinter.Point), values[:-1])
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue