summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-12-14 15:11:03 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-12-14 15:28:55 -0200
commite3796fa3e79b7c28ba1fb2142c09f98dc5abb085 (patch)
tree367e4ce3b78f76caffc6bdaa84f30e68dbfb463c
parent6b720050efa431975ee275bd9a613f680b4eddc8 (diff)
downloadpyside-e3796fa3e79b7c28ba1fb2142c09f98dc5abb085.tar.gz
pyside-e3796fa3e79b7c28ba1fb2142c09f98dc5abb085.tar.xz
pyside-e3796fa3e79b7c28ba1fb2142c09f98dc5abb085.zip
Fix bug#512 - "QGridLayout::getItemPosition() is not available"
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Renato Ara├║jo <renato.filho@openbossa.org>
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml24
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_512.py22
3 files changed, 46 insertions, 1 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index 485d542..cf8f273 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -2670,7 +2670,29 @@
addLayoutOwnership(%CPPSELF, %1);
</inject-code>
</modify-function>
- <modify-function signature="getItemPosition(int,int*,int*,int*,int*)" remove="all" />
+ <modify-function signature="getItemPosition(int,int*,int*,int*,int*)">
+ <modify-argument index="return">
+ <replace-type modified-type="PyObject*" />
+ </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>
+ <modify-argument index="5">
+ <remove-argument/>
+ <remove-default-expression/>
+ </modify-argument>
+ <inject-code class="target" position="beginning">
+ int a, b, c, d;
+ %CPPSELF.%FUNCTION_NAME(%1, &amp;a, &amp;b, &amp;c, &amp;d);
+ %PYARG_0 = Shiboken::makeTuple(a, b, c, d);
+ </inject-code>
+ </modify-function>
</object-type>
<object-type name="QGraphicsView">
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index df81b3d..4bfb0d5 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -19,6 +19,7 @@ PYSIDE_TEST(bug_433.py)
PYSIDE_TEST(bug_467.py)
PYSIDE_TEST(bug_480.py)
PYSIDE_TEST(bug_500.py)
+PYSIDE_TEST(bug_512.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_512.py b/tests/QtGui/bug_512.py
new file mode 100644
index 0000000..386a7f9
--- /dev/null
+++ b/tests/QtGui/bug_512.py
@@ -0,0 +1,22 @@
+''' Test bug 512: http://bugs.openbossa.org/show_bug.cgi?id=512'''
+
+import unittest
+from helper import UsesQApplication
+from PySide.QtCore import *
+from PySide.QtGui import *
+
+class BugTest(UsesQApplication):
+ def testCase(self):
+ w = QWidget(None)
+ lbl = QLabel("Hello", w);
+ g = QGridLayout()
+ g.addWidget(lbl, 0, 0)
+ w.setLayout(g)
+ w.show()
+
+ t = g.getItemPosition(0)
+ self.assertEqual(type(t), tuple)
+ self.assertEqual(t, (0,0,1,1))
+
+if __name__ == '__main__':
+ unittest.main()