2 # -*- coding: utf-8 -*-
5 from PySide.QtCore import *
6 from PySide.QtGui import *
7 from PySide.QtDeclarative import QDeclarativeView
9 from albumModel import AlbumModel
10 from controller import MussorgskyController
12 # Create Qt application and the QDeclarative view
13 app = QApplication(sys.argv)
14 view = QDeclarativeView()
16 controller = MussorgskyController (view.rootContext ())
18 #from albumItem import AlbumItem
19 #MOCK_DATA = [AlbumItem (u"x", u"y") for i in xrange (0, 100)]
20 #albumModel = AlbumModel (MOCK_DATA)
22 albumModel = AlbumModel (controller.get_all_albums())
23 print "Model with", albumModel.rowCount(), "rows"
25 #from coverModel import CoversModel
26 #coverModel = CoversModel ()
28 rc = view.rootContext ()
29 rc.setContextProperty ('albumModel', albumModel)
30 rc.setContextProperty ('missionControl', controller)
31 #rc.setContextProperty ('coversModel', coverModel)
33 # Create an URL to the QML file
34 #url = QUrl('view.qml')
35 url = QUrl ("../../ui/main.qml")
36 # Set the QML file and show
38 view.engine().quit.connect (app.quit)