Hi, I'm going crazy trying to set up a menu using a GridView. Basically the problem I have is that I am unable to capture the clicks on the elements of my GridView. So I can not take any action on the application. Can anyone tell me what I have wrong with my code?
Thanks!Code:import QtQuick 1.0 Rectangle { width: 360 height: 640 GridView { id: menuGridView width: 300 height: 550 anchors.margins: 5 anchors.left: parent.left anchors.right: parent.right anchors.top: appLabel.bottom anchors.bottom: parent.bottom cellHeight: 100; cellWidth: 120 model: menuModel delegate: menuDelegate highlight: highlightBar focus: true } Component { id: highlightBar Rectangle { width: menuGridView.cellWidth height: menuGridView.cellHeight color: "lightsteelblue" radius: 5 x: menuGridView.currentItem.x y: menuGridView.currentItem.y } } Component { id: menuDelegate Item { width: menuGridView.cellWidth; height: menuGridView.cellHeight Column { anchors.fill: parent Image { source: imgSrc; anchors.horizontalCenter: parent.horizontalCenter } Text { text: name; anchors.horizontalCenter: parent.horizontalCenter } } MouseArea { anchors.fill: parent onClicked: action } } } ListModel { id: menuModel ListElement { imgSrc: "../img/newlist.png" name: "New List" } ListElement { imgSrc: "../img/config.png" name: "Config" } ListElement { imgSrc: "../img/help.png" name: "Help" } ListElement { imgSrc: "../img/exit.png" name: "Exit" action: "Qt.quit()" } } Text { id: appLabel width: parent.width text: "Blah blah blah..." anchors.left: parent.left anchors.leftMargin: 5 anchors.topMargin: 5 font.pixelSize: 40 } }




