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"
    }


 }
}
_______________________________________________
SailfishOS.org Devel mailing list

Reply via email to