这些菜单默认显示在左侧。我想在菜单开始出现之前在左侧放置一些文本。
如何将菜单向右推以便为菜单栏中的文本创建空间?
我想要以下内容:
该文本“AmplifyRemote”出现在菜单启动之前。这里如何实现呢?
ApplicationWindow
{
id: window; visible: true; width: Screen.width; height: Screen.height; flags: Qt.FramelessWindowHint
menuBar:
MenuBar
{
id: menuBar
Menu { title: qsTr("File") }
Menu { title: qsTr("Edit") }
Menu { title: qsTr("View") }
Menu { title: qsTr("Help") }
delegate: MenuBarItem {
id: menuBarItem
font
{
pointSize: decoration.font_size_8
family: decoration.font_family
}
contentItem: Text {
text: menuBarItem.text
font: menuBarItem.font
opacity: enabled ? 1.0 : 0.3
color: menuBarItem.highlighted ? "white":"#3F3F3F"
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
background: Rectangle {
implicitWidth: 40
implicitHeight: 40
opacity: enabled ? 1 : 0.3
color: menuBarItem.highlighted ? "#292a38" : "transparent"
}
}
background: Rectangle {
implicitWidth: 40
implicitHeight: 11
color: "#d2d2d2"
// This is the text I want before menus start
Text{ text:"jjjjjjjjj"; anchors.left: parent.left}
Rectangle {
color: "#21be2b"
width: parent.width
height: 1
anchors.bottom: parent.bottom
}
}
}
慕森卡
相关分类