summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/QtUiTools/CMakeLists.txt1
-rw-r--r--tests/QtUiTools/bug_909.py24
-rw-r--r--tests/QtUiTools/bug_909.ui31
3 files changed, 56 insertions, 0 deletions
diff --git a/tests/QtUiTools/CMakeLists.txt b/tests/QtUiTools/CMakeLists.txt
index 4c055ec..02fb89d 100644
--- a/tests/QtUiTools/CMakeLists.txt
+++ b/tests/QtUiTools/CMakeLists.txt
@@ -4,5 +4,6 @@ PYSIDE_TEST(bug_392.py)
PYSIDE_TEST(bug_426.py)
PYSIDE_TEST(bug_552.py)
PYSIDE_TEST(bug_797.py)
+PYSIDE_TEST(bug_909.py)
PYSIDE_TEST(uiloader_test.py)
PYSIDE_TEST(ui_test.py)
diff --git a/tests/QtUiTools/bug_909.py b/tests/QtUiTools/bug_909.py
new file mode 100644
index 0000000..18df7b3
--- /dev/null
+++ b/tests/QtUiTools/bug_909.py
@@ -0,0 +1,24 @@
+import sys
+import unittest
+
+from PySide.QtCore import QFile
+from PySide.QtGui import QTabWidget
+from PySide.QtUiTools import QUiLoader
+
+from helper import UsesQApplication
+from helper import adjust_filename
+
+class TestDestruction(UsesQApplication):
+ def testBug909(self):
+ fileName = QFile(adjust_filename('bug_909.ui', __file__))
+ loader = QUiLoader()
+ main_win = loader.load(fileName)
+ self.assertEqual(sys.getrefcount(main_win), 2)
+ fileName.close()
+
+ tw = QTabWidget(main_win)
+ main_win.setCentralWidget(tw)
+ main_win.show()
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/tests/QtUiTools/bug_909.ui b/tests/QtUiTools/bug_909.ui
new file mode 100644
index 0000000..b07f62d
--- /dev/null
+++ b/tests/QtUiTools/bug_909.ui
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>800</width>
+ <height>600</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>MainWindow</string>
+ </property>
+ <widget class="QWidget" name="centralwidget"/>
+ <widget class="QMenuBar" name="menubar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>800</width>
+ <height>25</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QStatusBar" name="statusbar"/>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>