Fix bug 643 - "QTabWidget.insertTab not taking ownership"
This commit is contained in:
parent
93bd129cfb
commit
34529760f4
2 changed files with 10 additions and 2 deletions
|
|
@ -3841,7 +3841,7 @@
|
||||||
<parent index="this" action="add"/>
|
<parent index="this" action="add"/>
|
||||||
</modify-argument>
|
</modify-argument>
|
||||||
</modify-function>
|
</modify-function>
|
||||||
<modify-function signature="insertTab(int, QWidget*, const QIcon&, const QString&)">
|
<modify-function signature="insertTab(int, QWidget*, const QString&)">
|
||||||
<modify-argument index="2">
|
<modify-argument index="2">
|
||||||
<parent index="this" action="add"/>
|
<parent index="this" action="add"/>
|
||||||
</modify-argument>
|
</modify-argument>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,13 @@
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from PySide.QtGui import QTabWidget
|
from PySide.QtGui import *
|
||||||
from helper import TimedQApplication
|
from helper import TimedQApplication
|
||||||
|
|
||||||
|
def makeBug643(tab):
|
||||||
|
button = QPushButton('Foo')
|
||||||
|
tab.insertTab(0, button, 'Foo')
|
||||||
|
|
||||||
class RemoveTabMethod(TimedQApplication):
|
class RemoveTabMethod(TimedQApplication):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
TimedQApplication.setUp(self)
|
TimedQApplication.setUp(self)
|
||||||
|
|
@ -17,5 +21,9 @@ class RemoveTabMethod(TimedQApplication):
|
||||||
def testRemoveTabPresence(self):
|
def testRemoveTabPresence(self):
|
||||||
self.assert_(getattr(self.tab, 'removeTab'))
|
self.assert_(getattr(self.tab, 'removeTab'))
|
||||||
|
|
||||||
|
def testInsertTab(self):
|
||||||
|
makeBug643(self.tab)
|
||||||
|
self.assertEqual(self.tab.count(), 1)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue