aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtGui/bug_919.py
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-07-14 15:24:32 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:36 -0300
commit116a691516c329eb7a0dec31a134e9b58de6b9d8 (patch)
tree8b5b431dd14982178b32c5c928f6649a872c4cbd /tests/QtGui/bug_919.py
parentd4760309b7cd4c30596db3935a4904ba87299282 (diff)
Created unit test for bug #919.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'tests/QtGui/bug_919.py')
-rw-r--r--tests/QtGui/bug_919.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/QtGui/bug_919.py b/tests/QtGui/bug_919.py
new file mode 100644
index 000000000..dd883ce43
--- /dev/null
+++ b/tests/QtGui/bug_919.py
@@ -0,0 +1,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()