aboutsummaryrefslogtreecommitdiffstats
path: root/tests
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
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')
-rw-r--r--tests/QtGui/CMakeLists.txt1
-rw-r--r--tests/QtGui/bug_919.py27
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt
index 68aff6476..f1b9adef2 100644
--- a/tests/QtGui/CMakeLists.txt
+++ b/tests/QtGui/CMakeLists.txt
@@ -66,6 +66,7 @@ PYSIDE_TEST(bug_862.py)
PYSIDE_TEST(bug_871.py)
PYSIDE_TEST(bug_879.py)
PYSIDE_TEST(bug_882.py)
+PYSIDE_TEST(bug_919.py)
PYSIDE_TEST(customproxywidget_test.py)
PYSIDE_TEST(deepcopy_test.py)
PYSIDE_TEST(event_filter_test.py)
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()