Ubuntu Pastebin

Paste from dubstar_04 at Fri, 17 Jul 2015 08:18:02 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
            FolderListModel {
                id: fileListModel
                folder: "~/.local/share/cadmium.marthamengineering/"; //XDG_DATA_HOME/cadmium.marthamengineering/files/";
                nameFilters: [ "*" ]
            }


                GridView {
                    anchors.fill: parent
                    cellWidth: parent.width/3; cellHeight: (parent.width/3)*1.1
                    focus: true
                    model: fileListModel

                    highlight: Rectangle { width: parent.width/3; height: (parent.width/3)*1.1; color: "lightsteelblue" }

                    delegate: Item {
                        width:parent.width/3 ; height: (parent.width/3)*1.1

                        Image {
                            id: myIcon
                            width: parent.width/1.1;
                            //y: 20;
                            fillMode: Image.PreserveAspectFit
                            anchors.horizontalCenter: parent.horizontalCenter
                            source: "cadmium.png"
                        }
                        Text {
                            anchors { top: myIcon.bottom; horizontalCenter: parent.horizontalCenter }
                            text: model.fileName
                        }
                        MouseArea {
                            anchors.fill: parent
                            onClicked: parent.GridView.view.currentIndex = index; //console.log(model.filePath)
                        }
                    }
}
Download as text