Skip to content

UniDeskMenuItem Type

Menu item control based on QtQuick MenuItem. Supports icons, submenu arrows, checkmarks, and highlight states.

ItemDescription
Control TypeVisual Control
Source FileUniDesk/Controls/UniDeskMenuItem.qml
InheritsQtQuick Templates MenuItem
QML Importimport UniDesk.Controls 1.0

Custom Properties

PropertyTypeDefaultDescription
disabledboolfalseWhether the item is disabled
iconDelegateComponentIcon delegate (defaults to internal icon component)
iconSpacingint5Spacing between icon and text
iconSourcestringIcon source path
iconSizeint16Icon size
textColorcolorTheme-adaptiveText color

Style

  • Auto-height based on content
  • Themed background on hover (highlighted)
  • Font: UniDeskTextStyle.little
  • Supports checkmarks (checkable) and submenu arrows

Example

qml
import UniDesk.Controls 1.0

UniDeskMenu {
    UniDeskMenuItem {
        text: "Open"
        iconSource: "qrc:/media/img/folder.svg"
        onTriggered: console.log("open")
    }
    UniDeskMenuItem {
        text: "Save As"
        iconSource: "qrc:/media/img/save.svg"
    }
    UniDeskMenuSeparator {}
    UniDeskMenuItem {
        text: "Exit"
        onTriggered: Qt.quit()
    }
}

Released under the CC BY-SA 4.0 open documentation license.