Sailfish OS
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS
Select Page
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS

API Documentation

Documentation for developing SailfishOS applications
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon

Contents

  • Properties
  • Signals
  • Detailed Description

MenuItem QML Type

Encapsulates a menu item More...

Import Statement: import Sailfish.Silica 1.0
Inherits:

Label

  • List of all members, including inherited members

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

color : color

This property holds the color of the text.


down : bool

This property is true when the item is selected.


font.bold : bool

True if the displayed text is rendered in bold, otherwise false.


font.capitalization : enumeration

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

font.family : string

The name of the font family for rendering the displayed text.


font.italic : bool

True if the displayed text is rendered in italics, otherwise false.


font.letterSpacing : real

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.


font.pixelSize : int

The size of the displayed text, in pixels.


font.pointSize : real

The size of the displayed text, in points.


font.strikeout : bool

True if the displayed text is rendered with a strikeout style, otherwise false.


font.underline : bool

True if the displayed text is rendered with an underline, otherwise false.


font.weight : enumeration

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

font.wordSpacing : real

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.


horizontalAlignment : enumeration

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


text : string

This property holds the text to display in the MenuItem.


Signal Documentation

clicked()

This signal is emitted when the MenuItem is clicked.


delayedClick()

This signal is emitted when the MenuItem is clicked and the menu (ContextMenu, PullDownMenu, PushUpMenu) containing the MenuItem is closed.


earlyClick()

This signal is emitted before the click transition is played, for example to preload content shown when clicked() is emitted.


  • Legal
  • Contact Us
  • Jolla Mobile Ltd © 2025

  • Facebook
  • Twitter
  • Mastodon
  • YouTube
  • LinkedIn