blob: dd883ce43f056e511ceba0a3735b39eef96bae23 (
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
|
import unittest
from helper import TimedQApplication
from PySide.QtGui import QPainter, QPushButton, QStyleOptionButton, QApplication, QStyle
class MyWidget(QPushButton):
def __init__(self, parent = None):
QPushButton.__init__(self, parent)
self._painted = False
def paintEvent(self, e):
p = QPainter(self)
style = QApplication.style()
option = QStyleOptionButton()
style.drawControl(QStyle.CE_PushButton, option, p)
self._painted = True
class TestBug919(TimedQApplication):
def testFontInfo(self):
w = MyWidget()
w.show()
self.app.exec_()
self.assert_(w._painted)
if __name__ == '__main__':
unittest.main()
|