Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

TreeView - Context menu

$
0
0
Your title is a bit misleading as it refers to TableView. There are two ways to achieve this:     TableView {         id: table         anchors.fill: parent         model: 100         TableViewColumn { title: "First" }         MouseArea {             id: mouse             acceptedButtons: Qt.RightButton             anchors.fill: parent             onClicked: menu.popup()             Menu { id: menu ; MenuItem { text: "Popup at row " + table.rowAt(mouse.mouseX, mouse.mouseY) } }         }     } Alternatively you can set a custom itemDelegate and place the menu in there.

Viewing all articles
Browse latest Browse all 4972

Trending Articles