MenuSeparator QML Type

Separates a group of items in a menu from adjacent items. 更多...

import 语句: import QtQuick.Controls 2.2
Since: Qt 5.8
继承: Control

详细描述

MenuSeparator is used to visually distinguish between groups of items in a menu by separating them with a line.

import QtQuick 2.6
import QtQuick.Controls 2.1
Menu {
    id: menu
    MenuItem {
        text: qsTr("New...")
    }
    MenuItem {
        text: qsTr("Open...")
    }
    MenuItem {
        text: qsTr("Save")
    }
    MenuSeparator {
        padding: 0
        topPadding: 12
        bottomPadding: 12
        contentItem: Rectangle {
            implicitWidth: 200
            implicitHeight: 1
            color: "#1E000000"
        }
    }
    MenuItem {
        text: qsTr("Exit")
    }
}
					

另请参阅 Customizing MenuSeparator and 分隔符控件 .