[SailfishDevel] cannot hide() contextmenu

Wim de Vries wsvries at xs4all.nl
Tue Dec 17 13:17:19 UTC 2013


Hi,
I am trying a contextmenu. I can show() it, but not hide it.
Clicking on the lower rectangle does not hide it:

import QtQuick 2.0
import Sailfish.Silica 1.0

Page {
     id: pageT

Rectangle
  {
     id : timerWindow
     anchors.top: parent.top
     anchors.left: parent.left
     anchors.right: parent.right
     height : 400
     color : "#00FF00"
  MouseArea
   {
   anchors.fill : parent
   onClicked:
    {
    contextMenu.show(timerWindow)
    }
   }
  }

Rectangle
  {
     id : timerWindow2
     anchors.top: timerWindow.bottom
     anchors.left: parent.left
     anchors.right: parent.right
     anchors.bottom: parent.bottom
     color : "#0000FF"
  MouseArea
   {
   anchors.fill : parent
   onClicked:
    {
    console.log("hiding")
       contextMenu.hide()
    }
   }
  }

ContextMenu
  {
    anchors.fill: parent
    property bool menuShown : false
    id: contextMenu
     MenuItem {
         text: "Option 1"
     }
     MenuItem {
         text: "Option 2"
     }


  }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20131217/15a7ec80/attachment.html>


More information about the Devel mailing list