TreeView - Context menu
QML and Qt Quick
3
Posts
3
Posters
2.1k
Views
1
Watching
-
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.