Fix bug 712 - "QtGui.QFormLayout doesn't have setItem() function"
Reviewer: Lauro Moura <lauro.neto@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
4239b56710
commit
9ffb2ef542
2 changed files with 19 additions and 3 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue