Move the qml/* files to the src folder. Now it is the main version
[mussorgsky] / src / mussorgsky-qml.py
diff --git a/src/mussorgsky-qml.py b/src/mussorgsky-qml.py
new file mode 100644 (file)
index 0000000..bc97a75
--- /dev/null
@@ -0,0 +1,44 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+import sys
+from PySide.QtCore import *
+from PySide.QtGui import *
+from PySide.QtDeclarative import QDeclarativeView
+
+from albumModel import AlbumModel
+from controller import MussorgskyController
+
+# Create Qt application and the QDeclarative view
+app = QApplication(sys.argv)
+view = QDeclarativeView()
+
+controller = MussorgskyController (view.rootContext ())
+
+#from albumItem import AlbumItem
+#MOCK_DATA = [AlbumItem (u"x", u"y") for i in xrange (0, 100)]
+#albumModel = AlbumModel (MOCK_DATA)
+
+albumModel = AlbumModel (controller.get_all_albums())
+print "Model with", albumModel.rowCount(), "rows"
+
+#from coverModel import CoversModel
+#coverModel = CoversModel ()
+
+rc = view.rootContext ()
+rc.setContextProperty ('albumModel', albumModel)
+rc.setContextProperty ('missionControl', controller)
+#rc.setContextProperty ('coversModel', coverModel)
+
+# Create an URL to the QML file
+#url = QUrl('view.qml')
+url = QUrl ("../../ui/main.qml")
+# Set the QML file and show
+view.setSource(url)
+view.engine().quit.connect (app.quit)
+
+view.show()
+
+
+# Enter Qt main loop
+sys.exit(app.exec_())