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

« back to all changes in this revision

Viewing changes to tests/QtDeclarative/bug_926.py

  • Committer: Package Import Robot
  • Author(s): Barry Warsaw
  • Date: 2011-09-02 13:38:16 UTC
  • mfrom: (13.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20110902133816-m9hr28n1u90bs3of
Tags: 1.0.6.1-2ubuntu1
* debian/patches/force-phonon.patch:
  Force the addition of the phonon directory to the CMake files.
  (LP: #832864)
* debian/control: Ubuntu 11.10 only has debhelper 8.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import sys
 
2
import unittest
 
3
from helper import adjust_filename
 
4
from PySide.QtCore import *
 
5
from PySide.QtGui import *
 
6
from PySide.QtDeclarative import *
 
7
 
 
8
class MyClass (QObject):
 
9
 
 
10
    def __init__(self):
 
11
        super(MyClass,self).__init__()
 
12
        self.__url = QUrl()
 
13
 
 
14
    def getUrl(self):
 
15
        return self.__url
 
16
 
 
17
    def setUrl(self,value):
 
18
        newUrl = QUrl(value)
 
19
        if (newUrl != self.__url):
 
20
            self.__url = newUrl
 
21
            self.urlChanged.emit()
 
22
 
 
23
    urlChanged = Signal()
 
24
    urla = Property(QUrl, getUrl, setUrl, notify = urlChanged)
 
25
 
 
26
class TestBug926 (unittest.TestCase):
 
27
    def testIt(self):
 
28
        app = QApplication([])
 
29
        qmlRegisterType(MyClass,'Example',1,0,'MyClass')
 
30
        view = QDeclarativeView()
 
31
        view.setSource(QUrl.fromLocalFile(adjust_filename('bug_926.qml', __file__)))
 
32
        self.assertEqual(len(view.errors()), 0)
 
33
        view.show()
 
34
        QTimer.singleShot(0, app.quit)
 
35
        app.exec_()
 
36
 
 
37
if __name__ == '__main__':
 
38
    unittest.main()