summaryrefslogtreecommitdiffstats
path: root/tests/QtGui/bug_1126.py
blob: 749fac0cc5c5d7308e59dbe451a51fdc7250ff9c (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
''' unit test for BUG #1126 '''
''' see http://bugs.pyside.org/show_bug.cgi?id=1126 '''

from helper import UsesQApplication
import unittest
from PySide import QtCore, QtGui

class SignalInstanceDisconnTestCase(UsesQApplication):
    def testIt(self):
        w = QtGui.QWidget()
        w.deleteLater()

        def cb(*args):
            self.app.quit()

        w.destroyed.connect(cb)
        self.app.exec_()
        try:
            w.destroyed.disconnect(cb)
        except RuntimeError:
            pass

if __name__ == "__main__":
    unittest.main()