<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
I am trying a contextmenu. I can show() it, but not hide it.<br>
Clicking on the lower rectangle does not hide it:<br>
<br>
<font face="Times New Roman, Times, serif">import QtQuick 2.0<br>
import Sailfish.Silica 1.0<br>
<br>
Page {<br>
id: pageT<br>
<br>
Rectangle <br>
{<br>
id : timerWindow<br>
anchors.top: parent.top<br>
anchors.left: parent.left<br>
anchors.right: parent.right<br>
height : 400<br>
color : "#00FF00"<br>
MouseArea<br>
{<br>
anchors.fill : parent<br>
onClicked:<br>
{<br>
contextMenu.show(timerWindow)<br>
}<br>
}<br>
}<br>
<br>
Rectangle <br>
{<br>
id : timerWindow2<br>
anchors.top: timerWindow.bottom<br>
anchors.left: parent.left<br>
anchors.right: parent.right<br>
anchors.bottom: parent.bottom<br>
color : "#0000FF"<br>
MouseArea<br>
{<br>
anchors.fill : parent<br>
onClicked:<br>
{<br>
console.log("hiding")<br>
contextMenu.hide()<br>
}<br>
}<br>
}<br>
<br>
ContextMenu<br>
{<br>
anchors.fill: parent<br>
property bool menuShown : false<br>
id: contextMenu<br>
MenuItem {<br>
text: "Option 1"<br>
}<br>
MenuItem {<br>
text: "Option 2"<br>
}<br>
<br>
<br>
}<br>
}</font><br>
</body>
</html>