summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-12-23 16:59:33 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-12-23 17:22:29 -0200
commit6cf55675dc896121e8a6fa806b642bb550ffa7d3 (patch)
treef80dfa7691489b09d5093e28d1ca3e557a8d1be2
parentfc471bed0f78d3de616e16719f69f463649b22ef (diff)
downloadpyside-6cf55675dc896121e8a6fa806b642bb550ffa7d3.tar.gz
pyside-6cf55675dc896121e8a6fa806b642bb550ffa7d3.tar.xz
pyside-6cf55675dc896121e8a6fa806b642bb550ffa7d3.zip
Fix bug#549 - "QGraphicsWidget::getContentsMargins() and QGraphicsWidget::getWindowFrameMargins() not available"
Reviewer: Renato Ara├║jo <renato.filho@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml46
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_549.py16
3 files changed, 59 insertions, 4 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 940f730..0994331 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -4834,10 +4834,48 @@
</object-type>
<!-- a QObject so main-thread delete redundant -->
<object-type name="QGraphicsWidget">
- <!-- FIXME: What to do with this function? -->
- <modify-function signature="getContentsMargins(qreal*,qreal*,qreal*,qreal*)const" remove="all" />
- <!-- FIXME: What to do with this function? -->
- <modify-function signature="getWindowFrameMargins(qreal*,qreal*,qreal*,qreal*)const" remove="all" />
+ <modify-function signature="getContentsMargins(qreal*,qreal*,qreal*,qreal*)const">
+ <modify-argument index="return">
+ <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_qreal*,qreal*,qreal*,qreal*"/>
+ </inject-code>
+ </modify-function>
+ <modify-function signature="getWindowFrameMargins(qreal*,qreal*,qreal*,qreal*)const">
+ <modify-argument index="return">
+ <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_qreal*,qreal*,qreal*,qreal*"/>
+ </inject-code>
+ </modify-function>
<!-- a QObject so main-thread delete redundant -->
<!-- Duplicate function to QObject::children() to override accidental shadowing which is not present in Jambi -->
<modify-function signature="children()const" remove="all"/>
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 7cde60f..fe62e8e 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -21,6 +21,7 @@ PYSIDE_TEST(bug_480.py)
PYSIDE_TEST(bug_500.py)
PYSIDE_TEST(bug_512.py)
PYSIDE_TEST(bug_525.py)
+PYSIDE_TEST(bug_549.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(deepcopy_test.py)
PYSIDE_TEST(float_to_int_implicit_conversion_test.py)
diff --git a/tests/QtGui/bug_549.py b/tests/QtGui/bug_549.py
new file mode 100644
index 0000000..6d07899
--- /dev/null
+++ b/tests/QtGui/bug_549.py
@@ -0,0 +1,16 @@
+import unittest
+
+from PySide.QtGui import *
+
+class TestBug549(unittest.TestCase):
+ def testBug(self):
+ app = QApplication([])
+ w = QGraphicsWidget()
+ w.setContentsMargins(1, 2, 3, 4)
+ self.assertEquals(w.getContentsMargins(), (1, 2, 3, 4))
+ w.setWindowFrameMargins(5, 6, 7, 8)
+ self.assertEquals(w.getWindowFrameMargins(), (5, 6, 7, 8))
+
+if __name__ == '__main__':
+ unittest.main()
+