~ubuntu-branches/ubuntu/oneiric/pyside/oneiric

« back to all changes in this revision

Viewing changes to tests/qtgui/virtual_pure_override.py

  • Committer: Bazaar Package Importer
  • Author(s): Didier Raboud
  • Date: 2010-09-27 21:01:06 UTC
  • mfrom: (1.2.1 upstream) (6.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20100927210106-m1nrq8vmd3exqb9o
Tags: 0.4.1-0ubuntu1
* New 0.4.1 upstream release. (LP: #648612)
  - Add some 0.4.1 symbols.

* Patches:
  - u_c130273_fix_py25_QtScript_property.patch
    Remove, was from upstream.
  - u_20e226b_fix_missing_qcoreapplication_arguments_method.patch
    Remove, was from upstream.
  - u_268bf77_fixed_signal_signature_parser.patch
    Remove, was from upstream.
  + libPythonVersionPostfix.patch: Refresh
  + usePySpecificShiboken.patch: Refresh
  + lessBuildVerbosity.patch: Refresh

* Bump the B-D chain versions.
* Make sure the private.py is installed in QtCore module.
* Build against Qt 4.7.
  - Add libqtwebkit-dev
  - Drop QtMultimedia module.
  - Add the QtDeclarative package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
2
 
 
3
 
import unittest
4
 
 
5
 
from PySide.QtGui import QGraphicsScene, QGraphicsRectItem, QGraphicsView, QApplication, QBrush, QColor
6
 
from PySide.QtCore import QTimer
7
 
from helper import UsesQApplication
8
 
 
9
 
qgraphics_item_painted = False
10
 
 
11
 
class RoundRectItem(QGraphicsRectItem):
12
 
 
13
 
    def __init__(self, x, y, w, h):
14
 
        QGraphicsRectItem.__init__(self, x, y, w, h)
15
 
 
16
 
    def paint(self, painter, qstyleoptiongraphicsitem, qwidget):
17
 
        global qgraphics_item_painted
18
 
        qgraphics_item_painted = True
19
 
 
20
 
 
21
 
class QGraphicsItemTest(UsesQApplication):
22
 
 
23
 
    def createRoundRect(self, scene):
24
 
        item = RoundRectItem(10, 10, 100, 100)
25
 
        item.setBrush(QBrush(QColor(255, 0, 0)))
26
 
        scene.addItem(item)
27
 
        return item
28
 
 
29
 
    def quit_app(self):
30
 
        self.app.quit()
31
 
 
32
 
    def test_setParentItem(self):
33
 
        global qgraphics_item_painted
34
 
 
35
 
        scene = QGraphicsScene()
36
 
        scene.addText("test")
37
 
        view = QGraphicsView(scene)
38
 
 
39
 
        rect = self.createRoundRect(scene)
40
 
        view.show()
41
 
        QTimer.singleShot(1000, self.quit_app)
42
 
        self.app.exec_()
43
 
        self.assert_(qgraphics_item_painted)
44
 
 
45
 
 
46
 
if __name__ == '__main__':
47
 
    unittest.main()
48