summaryrefslogtreecommitdiffstats
path: root/tests/QtGui/bug_693.py
blob: 4bfbe7c7f5386fd9b83ad761a9a40743fb5b1771 (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
from PySide.QtCore import *
from PySide.QtGui import *
import unittest

class MyModel (QAbstractListModel):

    stupidLine = QLine(0, 0, 10, 10)

    def rowCount(self, parent):
        return 1

    def data(self, index, role):
        return self.stupidLine

class TestBug693(unittest.TestCase):
    def testIt(self):
        app = QApplication([])
        model = MyModel()
        view = QListView()
        view.setModel(model)
        view.show()

        # This must NOT throw the exception:
        # RuntimeError: Internal C++ object (PySide.QtCore.QLine) already deleted.
        MyModel.stupidLine.isNull()



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