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
12 # Create Qt application and the QDeclarative view
13 app = QApplication(sys.argv)
14 view = QDeclarativeView()
18 # AlbumItem ("Are you experienced?", "Jimy Hendrix", None),
19 # AlbumItem ("Bring them all back home", "Bob dylan", None),
20 # AlbumItem ("OK computer", "Radiohead", None),
21 # AlbumItem ("Absolution", "Muse", None),
22 # AlbumItem ("Come with us", "Chemical brothers", None)
25 logic = MussorgskyLogic ()
27 albumModel = AlbumModel (logic.get_all_albums())
28 print "Model with", albumModel.rowCount(), "rows"
30 rc = view.rootContext ()
31 rc.setContextProperty ('albumModel', albumModel)
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