Added images/files browser.
[lichviet] / qml / LichViet / FileBrowser.qml
index f67bf63..4d78ec7 100644 (file)
@@ -25,6 +25,28 @@ Rectangle {
     visible: true
     opacity:0.9
     color:"white"
+
+    ListModel{
+        id:img
+
+        function list(){
+            while(img.count>0) img.remove(img.count-1);
+            var limg = Controller.getImages("/home/cuongle");
+            for (var i=0;i<limg.length;i++)
+                append({name:limg[i]})
+        }
+    }
+
+    GridView {
+        anchors.fill: parent;anchors.topMargin: 35;anchors.leftMargin: 5;anchors.rightMargin: 5;anchors.bottomMargin: 12
+        model: img
+        delegate: Column {
+            Image { source:  "file:"+name; anchors.horizontalCenter: parent.horizontalCenter; width:100;height:100; }
+            Text { text: "-"; anchors.horizontalCenter: parent.horizontalCenter }
+        }
+    }
+
+
 }
 
 ToolBar { id: toolBar; height: 50;
@@ -41,4 +63,8 @@ ToolBar { id: toolBar; height: 50;
     }
 }
 
+function refresh(){
+    img.list();
+}
+
 }