Adding test cases to cover QtDeclarative + fix inside typesystem.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Renato Araújo <renato.filho@openbossa.org>
This commit is contained in:
parent
12e6ba386a
commit
2cb23734c8
5 changed files with 175 additions and 1 deletions
31
tests/qtdeclarative/qdeclarativeview_test.py
Normal file
31
tests/qtdeclarative/qdeclarativeview_test.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
'''Test cases for QDeclarativeView'''
|
||||
|
||||
import unittest
|
||||
|
||||
from PySide.QtCore import QUrl, QStringList, QVariant
|
||||
from PySide.QtGui import QPushButton
|
||||
from PySide.QtDeclarative import QDeclarativeView
|
||||
|
||||
from helper import adjust_filename, TimedQApplication
|
||||
|
||||
|
||||
class TestQDeclarativeView(TimedQApplication):
|
||||
|
||||
def testQDeclarativeViewList(self):
|
||||
view = QDeclarativeView()
|
||||
|
||||
dataList = QStringList(["Item 1", "Item 2", "Item 3", "Item 4"])
|
||||
|
||||
ctxt = view.rootContext()
|
||||
ctxt.setContextProperty("myModel", dataList)
|
||||
|
||||
url = QUrl.fromLocalFile(adjust_filename('view.qml', __file__))
|
||||
view.setSource(url)
|
||||
view.show()
|
||||
|
||||
self.assertEqual(view.status(), QDeclarativeView.Ready)
|
||||
|
||||
self.app.exec_()
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue