From bdaed6a95a3e4edb20d8e02d8b429be0f4d8da5e Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Tue, 14 Dec 2010 15:11:03 -0200 Subject: Fix bug#512 - "QGridLayout::getItemPosition() is not available" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer: Marcelo Lira Renato Araújo --- tests/QtGui/CMakeLists.txt | 1 + tests/QtGui/bug_512.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 tests/QtGui/bug_512.py (limited to 'tests') diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt index df81b3d59..4bfb0d588 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 000000000..386a7f960 --- /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() -- cgit v1.2.3