summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-02-04 15:32:55 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:53:54 -0300
commit34529760f4766a84a7dbb8f32c776abfe9c4fdda (patch)
tree5deea14a833ffb571250335a2b80a4fc383df549
parent93bd129cfb95aefb1fbbfbaeb4da614c95dce1d6 (diff)
Fix bug 643 - "QTabWidget.insertTab not taking ownership"
-rw-r--r--PySide/QtGui/typesystem_gui_common.xml2
-rw-r--r--tests/QtGui/qtabwidget_test.py10
2 files changed, 10 insertions, 2 deletions
diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml
index fd83b8fb..7dea272e 100644
--- a/PySide/QtGui/typesystem_gui_common.xml
+++ b/PySide/QtGui/typesystem_gui_common.xml
@@ -3841,7 +3841,7 @@
<parent index="this" action="add"/>
</modify-argument>
</modify-function>
- <modify-function signature="insertTab(int, QWidget*, const QIcon&amp;, const QString&amp;)">
+ <modify-function signature="insertTab(int, QWidget*, const QString&amp;)">
<modify-argument index="2">
<parent index="this" action="add"/>
</modify-argument>
diff --git a/tests/QtGui/qtabwidget_test.py b/tests/QtGui/qtabwidget_test.py
index 143f99ca..421d02f9 100644
--- a/tests/QtGui/qtabwidget_test.py
+++ b/tests/QtGui/qtabwidget_test.py
@@ -1,9 +1,13 @@
import unittest
-from PySide.QtGui import QTabWidget
+from PySide.QtGui import *
from helper import TimedQApplication
+def makeBug643(tab):
+ button = QPushButton('Foo')
+ tab.insertTab(0, button, 'Foo')
+
class RemoveTabMethod(TimedQApplication):
def setUp(self):
TimedQApplication.setUp(self)
@@ -17,5 +21,9 @@ class RemoveTabMethod(TimedQApplication):
def testRemoveTabPresence(self):
self.assert_(getattr(self.tab, 'removeTab'))
+ def testInsertTab(self):
+ makeBug643(self.tab)
+ self.assertEqual(self.tab.count(), 1)
+
if __name__ == '__main__':
unittest.main()