[SailfishDevel] Silica QML objects that can have a menu property

Thomas Tanghus thomas at tanghus.net
Fri Oct 11 13:14:34 UTC 2019


On torsdag den 10. oktober 2019 06.30.33 CEST E.S. Rosenberg wrote:
> Hi all,
> My question may be very simple - is ListItem the only type of object that
> may display a text on a page that can have a "menu" property? I went over
> the Silica reference quickly and I didn't find any other similar items.
> 
> The reason I ask this is that I have a single item I am displaying to
> which I am adding a context menu and semantically it just seemed weird
> that I would have to put that inside of a ListItem to be able to add a
> menu: ContextMenu property.
> 
> Or did I miss some other object that does support this property?

You can set the 'container' property to the parent of the menu as done in:
https://github.com/tanghus/kitchen-timer-qml/blob/master/qml/pages/TimerPage.qml#L220

There it's a BackgroundItem:
https://github.com/tanghus/kitchen-timer-qml/blob/master/qml/pages/TimerPage.qml#L124

Or did I misunderstand you?

-- 


/Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20191011/2b05585c/attachment.sig>


More information about the Devel mailing list