import QtQuick 2.11
import QtQuick.Controls 2.4
Rectangle
{
width:640
height:480
color:"#cfcfc0"
anchors.margins: 6
MouseArea {
id: mouseRegion
anchors.fill: parent;
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: {
if(mouse.button == Qt.RightButton)
contentMenu.popup()
}
Menu {
id: contentMenu
MenuItem {
text: "Cut"
onTriggered: {}
}
MenuItem {
text: "Copy"
onTriggered: {}
}
MenuItem {
text: "Paste"
onTriggered: {}
}
MenuSeparator { }
Menu {
title: "More"
MenuItem {
text: "Edit"
}
MenuItem {
text: "Select All"
}
}
}
}
}