Created unitest for bug #972.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Lauro Neto <lauro.neto@openbossa.org>
This commit is contained in:
parent
88acbd47db
commit
74e10eef63
2 changed files with 40 additions and 0 deletions
|
|
@ -70,6 +70,7 @@ PYSIDE_TEST(bug_919.py)
|
||||||
PYSIDE_TEST(bug_921.py)
|
PYSIDE_TEST(bug_921.py)
|
||||||
PYSIDE_TEST(bug_941.py)
|
PYSIDE_TEST(bug_941.py)
|
||||||
PYSIDE_TEST(bug_964.py)
|
PYSIDE_TEST(bug_964.py)
|
||||||
|
PYSIDE_TEST(bug_972.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)
|
||||||
|
|
|
||||||
39
tests/QtGui/bug_972.py
Normal file
39
tests/QtGui/bug_972.py
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
import unittest
|
||||||
|
from PySide.QtCore import QSizeF
|
||||||
|
from PySide.QtGui import QGraphicsProxyWidget, QSizePolicy, QPushButton, QGraphicsScene, QGraphicsView
|
||||||
|
|
||||||
|
from helper import TimedQApplication
|
||||||
|
|
||||||
|
def createItem(minimum, preferred, maximum, name):
|
||||||
|
w = QGraphicsProxyWidget()
|
||||||
|
|
||||||
|
w.setWidget(QPushButton(name))
|
||||||
|
w.setMinimumSize(minimum)
|
||||||
|
w.setPreferredSize(preferred)
|
||||||
|
w.setMaximumSize(maximum)
|
||||||
|
w.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
|
||||||
|
|
||||||
|
return w
|
||||||
|
|
||||||
|
class TestBug972 (TimedQApplication):
|
||||||
|
|
||||||
|
# Test if the function QGraphicsProxyWidget.setWidget have the correct behavior
|
||||||
|
def testIt(self):
|
||||||
|
scene = QGraphicsScene()
|
||||||
|
|
||||||
|
minSize = QSizeF(30, 100)
|
||||||
|
prefSize = QSizeF(210, 100)
|
||||||
|
maxSize = QSizeF(300, 100)
|
||||||
|
|
||||||
|
a = createItem(minSize, prefSize, maxSize, "A")
|
||||||
|
b = createItem(minSize, prefSize, maxSize, "B")
|
||||||
|
c = createItem(minSize, prefSize, maxSize, "C")
|
||||||
|
d = createItem(minSize, prefSize, maxSize, "D")
|
||||||
|
|
||||||
|
view = QGraphicsView(scene)
|
||||||
|
view.show()
|
||||||
|
self.app.exec_()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue