API Documentation
Documentation for developing SailfishOS applicationsMenuItem QML Type
Encapsulates a menu item More...
Import Statement: | import Sailfish.Silica 1.0 |
Inherits: |
Properties
- color : color
- down : bool
- font.bold : bool
- font.capitalization : enumeration
- font.family : string
- font.italic : bool
- font.letterSpacing : real
- font.pixelSize : int
- font.pointSize : real
- font.strikeout : bool
- font.underline : bool
- font.weight : enumeration
- font.wordSpacing : real
- horizontalAlignment : enumeration
- text : string
Signals
- clicked()
- delayedClick()
- earlyClick()
Detailed Description
The MenuItem type provides a menu item for use in PullDownMenu, PushUpMenu and ContextMenu. A MenuItem provides a text label and activation handling via the onClicked handler.
PushUpMenu { MenuItem { text: "Option 1" onClicked: console.log("Clicked option 1") } MenuItem { text: "Option 2" onClicked: console.log("Clicked option 2") } }
Property Documentation
This property holds the color of the text.
Holds the capitalization formatting that is applied to the displayed text. This is one of:
- Font.MixedCase - no capitalization is applied (the default value)
- Font.AllUppercase - all text is rendered in uppercase
- Font.AllLowercase - all text is rendered in lowercase
- Font.SmallCaps - text is rendered in small caps
- Font.Capitalize - the first letter of each word is rendered with a capital letter
Controls the spacing (in pixels) between letters in the displayed text.
Specifying a positive value increases the default spacing between letters, and specifying a negative value decreases this spacing.
True if the displayed text is rendered with a strikeout style, otherwise false.
Holds the weight value for rendering the displayed text.
This is one of the following (listed from lightest to heaviest):
- Font.Light
- Font.Normal (the default value)
- Font.DemiBold
- Font.Bold
- Font.Black
Controls the spacing (in pixels) between words in the displayed text.
Specifying a positive value increases the default spacing between words, and specifying a negative value decreases this spacing.
Sets the horizontal alignment of the text. The valid values are: Text.AlignLeft, Text.AlignRight, Text.AlignHCenter and Text.AlignJustify.
The default value is Text.AlignHCenter
This property holds the text to display in the MenuItem.
Signal Documentation
This signal is emitted when the MenuItem is clicked.
This signal is emitted when the MenuItem is clicked and the menu (ContextMenu, PullDownMenu, PushUpMenu) containing the MenuItem is closed.
This signal is emitted before the click transition is played, for example to preload content shown when clicked() is emitted.