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
|
|
@ -5079,9 +5079,12 @@
|
||||||
</modify-function>
|
</modify-function>
|
||||||
<!-- ### See bug 748 -->
|
<!-- ### See bug 748 -->
|
||||||
<modify-function signature="getItemPosition(int,int*,QFormLayout::ItemRole*)const" remove="all" />
|
<modify-function signature="getItemPosition(int,int*,QFormLayout::ItemRole*)const" remove="all" />
|
||||||
<!-- ### See bug 749 -->
|
|
||||||
<modify-function signature="setItem(int,QFormLayout::ItemRole,QLayoutItem*)" remove="all"/>
|
|
||||||
<!-- ### -->
|
<!-- ### -->
|
||||||
|
<modify-function signature="setItem(int,QFormLayout::ItemRole,QLayoutItem*)">
|
||||||
|
<modify-argument index="3">
|
||||||
|
<parent index="this" action="add"/>
|
||||||
|
</modify-argument>
|
||||||
|
</modify-function>
|
||||||
</object-type>
|
</object-type>
|
||||||
<object-type name="QGraphicsGridLayout" >
|
<object-type name="QGraphicsGridLayout" >
|
||||||
<modify-function signature="addItem(QGraphicsLayoutItem*,int,int,QFlags<Qt::AlignmentFlag>)">
|
<modify-function signature="addItem(QGraphicsLayoutItem*,int,int,QFlags<Qt::AlignmentFlag>)">
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@ import unittest
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from helper import UsesQApplication
|
from helper import UsesQApplication
|
||||||
from PySide.QtGui import QLayout, QWidget, QPushButton, QWidgetItem, QHBoxLayout
|
from PySide.QtCore import *
|
||||||
|
from PySide.QtGui import *
|
||||||
|
|
||||||
class MyLayout(QLayout):
|
class MyLayout(QLayout):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
|
|
@ -95,5 +96,17 @@ class QLayoutTest(UsesQApplication):
|
||||||
|
|
||||||
self.assertRaises(RuntimeError, w.setLayout, l)
|
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__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue