summaryrefslogtreecommitdiffstats
path: root/tests/QtUiTools/bug_909.py
blob: 18df7b349a571ad46aa0f76772b6238696137db2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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()