很简单的代码,直接帖上来吧
MouseArea{
anchors.fill: parent
property var pos1
onPressed: {
pos1 = mouseX
if(pos1<20 || pos1> parent.width - 20)
{
mouse.accepted = true
}else
{
mouse.accepted = false
}
}
onReleased: {
if(pos1<20&&mouseX>40 || pos1> parent.width - 20&& mouseX< parent.width - 40)
{
mainView.pop()
mainView.currentItem.forceActiveFocus()
}
}
}