From cfe00ac969eea7d937a6fa0a0a5752dc70b96963 Mon Sep 17 00:00:00 2001 From: Hugo Parente Lima Date: Wed, 30 Mar 2011 18:37:42 -0300 Subject: Fix bug 712 - "QtGui.QFormLayout doesn't have setItem() function" Reviewer: Lauro Moura Luciano Wolf --- PySide/QtGui/typesystem_gui_common.xml | 7 +++++-- tests/QtGui/qlayout_test.py | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml index dc6df54d7..a0b84fc70 100644 --- a/PySide/QtGui/typesystem_gui_common.xml +++ b/PySide/QtGui/typesystem_gui_common.xml @@ -5079,9 +5079,12 @@ - - + + + + + diff --git a/tests/QtGui/qlayout_test.py b/tests/QtGui/qlayout_test.py index 72c6d173b..999e4c9b6 100644 --- a/tests/QtGui/qlayout_test.py +++ b/tests/QtGui/qlayout_test.py @@ -2,7 +2,8 @@ import unittest import sys from helper import UsesQApplication -from PySide.QtGui import QLayout, QWidget, QPushButton, QWidgetItem, QHBoxLayout +from PySide.QtCore import * +from PySide.QtGui import * class MyLayout(QLayout): def __init__(self, parent=None): @@ -95,5 +96,17 @@ class QLayoutTest(UsesQApplication): self.assertRaises(RuntimeError, w.setLayout, l) + def testQFormLayout(self): + w = QWidget() + formLayout = QFormLayout() + spacer = QSpacerItem(100, 30) + formLayout.setItem(0, QFormLayout.SpanningRole, spacer) + w.setLayout(formLayout) + w.show() + QTimer.singleShot(10, w.close) + self.app.exec_() + del w + self.assertRaises(RuntimeError, spacer.isEmpty) + if __name__ == '__main__': unittest.main() -- cgit v1.2.3