aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtCore/bug_1019.py
blob: b7f1f68f7eec00c5a4f844493c47129c84aa04dd (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
25
26
27
28
29
30
31
32
import unittest
from PySide.QtCore import *

class MyTimer (QTimer):
    def __init__(self):
        QTimer.__init__(self)
        self.startCalled = False

    @Slot()
    def slotUsedToIncreaseMethodOffset(self):
        pass

class MyTimer2 (MyTimer):

    @Slot()
    def slotUsedToIncreaseMethodOffset2(self):
        pass

    def start(self):
        self.startCalled = True
        QCoreApplication.instance().quit()

class TestBug1019 (unittest.TestCase):
    def testIt(self):
        app = QCoreApplication([])
        t = MyTimer2()
        QTimer.singleShot(0, t.start)
        app.exec_()
        self.assertTrue(t.startCalled)

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