first attempt to connect qml gui to pyside
authorFlorian Schweikert <kelvan@logic.at>
Wed, 12 Oct 2011 17:47:38 +0000 (19:47 +0200)
committerFlorian Schweikert <kelvan@logic.at>
Wed, 12 Oct 2011 17:47:38 +0000 (19:47 +0200)
gotovienna/gotovienna_qml/qml/gotovienna_qml/MainPage.qml
gotovienna/gotovienna_qml/qml/gotovienna_qml/ResultRealtime.qml
itip_qml [new file with mode: 0644]

index 5bd38e1..b3dfc30 100644 (file)
@@ -55,6 +55,8 @@ Page {
             resu.gline = gline.text
             resu.gstation = gstation.text
             pageStack.push(resu)
+            itip.search("Test")
+            resu.busy = false
         }
     }
 }
index 04c4ca1..e15fa93 100644 (file)
@@ -9,6 +9,7 @@ Page {
 
     property string gline : ""
     property string gstation : ""
+    property bool busy : true
 
     Component {
          id: departureDelegate
@@ -211,11 +212,11 @@ Page {
          platformStyle: ScrollDecoratorStyle {}
      }
 
-     /*BusyIndicator {
+     BusyIndicator {
          id: busyIndicator
-         visible: true
+         visible: busy
          running: true
          platformStyle: BusyIndicatorStyle { size: 'large' }
          anchors.centerIn: parent
-     }*/
+     }
 }
diff --git a/itip_qml b/itip_qml
new file mode 100644 (file)
index 0000000..8a5a6e3
--- /dev/null
+++ b/itip_qml
@@ -0,0 +1,28 @@
+#!/usr/env/python
+
+from PySide import QtCore, QtGui, QtDeclarative
+
+class iTip(QtCore.QObject):
+    @QtCore.Slot(str, str)
+    def search(self, line, station):
+        print line
+        print station
+
+if __name__ == '__main__':
+    import sys
+
+    app = QtGui.QApplication(sys.argv)
+
+    view = QtDeclarative.QDeclarativeView()
+
+    # instantiate the Python object
+    itip = iTip()
+
+    # expose the object to QML
+    context = view.rootContext()
+    context.setContextProperty("itip", itip)
+
+    view.setSource(QtCore.QUrl('gotovienna/qml/main.qml'))
+    view.show()
+
+    sys.exit(app.exec_())