2 # -*- coding: utf-8 -*-
5 from PySide.QtCore import *
6 from PySide.QtGui import *
7 from PySide.QtDeclarative import QDeclarativeView
9 from qml.albumModel import AlbumModel
10 from qml.logic import MussorgskyLogic
11 from qml.controller import MussorgskyController
13 # Create Qt application and the QDeclarative view
14 app = QApplication(sys.argv)
15 view = QDeclarativeView()
19 # AlbumItem ("Are you experienced?", "Jimy Hendrix", None),
20 # AlbumItem ("Bring them all back home", "Bob dylan", None),
21 # AlbumItem ("OK computer", "Radiohead", None),
22 # AlbumItem ("Absolution", "Muse", None),
23 # AlbumItem ("Come with us", "Chemical brothers", None)
26 logic = MussorgskyLogic ()
28 albumModel = AlbumModel (logic.get_all_albums())
29 print "Model with", albumModel.rowCount(), "rows"
31 controller = MussorgskyController ()
33 rc = view.rootContext ()
34 rc.setContextProperty ('albumModel', albumModel)
35 rc.setContextProperty ('missionControl', controller)
37 # Create an URL to the QML file
38 #url = QUrl('view.qml')
39 url = QUrl ("../ui/main.qml")
40 # Set the QML file and show