Created unit test for bug #919.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Hugo Parente Lima <hugo.pl@gmail.com>
This commit is contained in:
parent
d4760309b7
commit
116a691516
2 changed files with 28 additions and 0 deletions
|
|
@ -66,6 +66,7 @@ PYSIDE_TEST(bug_862.py)
|
||||||
PYSIDE_TEST(bug_871.py)
|
PYSIDE_TEST(bug_871.py)
|
||||||
PYSIDE_TEST(bug_879.py)
|
PYSIDE_TEST(bug_879.py)
|
||||||
PYSIDE_TEST(bug_882.py)
|
PYSIDE_TEST(bug_882.py)
|
||||||
|
PYSIDE_TEST(bug_919.py)
|
||||||
PYSIDE_TEST(customproxywidget_test.py)
|
PYSIDE_TEST(customproxywidget_test.py)
|
||||||
PYSIDE_TEST(deepcopy_test.py)
|
PYSIDE_TEST(deepcopy_test.py)
|
||||||
PYSIDE_TEST(event_filter_test.py)
|
PYSIDE_TEST(event_filter_test.py)
|
||||||
|
|
|
||||||
27
tests/QtGui/bug_919.py
Normal file
27
tests/QtGui/bug_919.py
Normal file
|
|
@ -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()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue