aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtGui/bug_750.py
blob: 902a6555d85e16aa5f34f0df00d2f33372cc8906 (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
import unittest

from helper import UsesQApplication

from PySide.QtCore import QTimer
from PySide.QtGui import QPainter, QFont, QFontInfo, QWidget, qApp

class MyWidget(QWidget):
    def paintEvent(self, e):
        p = QPainter(self)
        self._info = p.fontInfo()
        self._app.quit()


class TestQPainter(UsesQApplication):
    def testFontInfo(self):
        w = MyWidget()
        w._app = self.app
        w._info = None
        QTimer.singleShot(300, w.show)
        self.app.exec_()
        self.assert_(w._info)

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