[SailfishDevel] cannot hide() contextmenu

Bea Lam bea.lam at jolla.com
Wed Dec 18 01:24:54 UTC 2013


Hello,

On 17 Dec 2013, at 11:17 pm, Wim de Vries <wsvries at xs4all.nl> wrote:
> Hi,
> I am trying a contextmenu. I can show() it, but not hide it.
> Clicking on the lower rectangle does not hide it:

Just remove the “anchors.fill: parent” from your ContextMenu declaration. The ContextMenu type internally adjusts its ‘height’ property in order to make its contents appear and disappear when you call show() and hide(), so if you fix the menu’s dimensions using anchors.fill, it will not be able to internally control its height, as anchors take precedence over width/height values.

In any case, you wouldn’t want to explicitly control the height of a ContextMenu because it automatically adjusts its height according to the number of items in the menu.

cheers,
Bea


More information about the Devel mailing list