Add long press action on PC view for touchscreens

This commit is contained in:
Cameron Gutman 2019-01-26 23:11:09 -08:00
parent 1a45b8f07a
commit b4bbd58c77

View file

@ -186,20 +186,24 @@ GridView {
}
}
onPressAndHold: {
if (!model.addPc) {
// popup() ensures the menu appears under the mouse cursor
if (pcContextMenu.popup) {
pcContextMenu.popup()
}
else {
// Qt 5.9 doesn't have popup()
pcContextMenu.open()
}
}
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton;
onClicked: {
if (!model.addPc) {
// popup() ensures the menu appears under the mouse cursor
if (pcContextMenu.popup) {
pcContextMenu.popup()
}
else {
// Qt 5.9 doesn't have popup()
pcContextMenu.open()
}
}
parent.onPressAndHold()
}
}