mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-10-31 16:17:29 +08:00
89 lines
1.7 KiB
QML
89 lines
1.7 KiB
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
import QtQuick.Window
|
|
import QtQuick.Controls
|
|
import FluentUI
|
|
import "qrc:///example/qml/component"
|
|
|
|
FluScrollablePage{
|
|
|
|
title:"Menu"
|
|
|
|
FluArea{
|
|
Layout.fillWidth: true
|
|
height: 100
|
|
paddings: 10
|
|
Layout.topMargin: 20
|
|
Column{
|
|
id:layout_column
|
|
spacing: 15
|
|
anchors{
|
|
verticalCenter: parent.verticalCenter
|
|
left:parent.left
|
|
}
|
|
|
|
FluButton{
|
|
text:"左击菜单"
|
|
Layout.topMargin: 20
|
|
onClicked:{
|
|
menu.popup()
|
|
}
|
|
}
|
|
|
|
FluButton{
|
|
text:"右击菜单"
|
|
Layout.topMargin: 20
|
|
onClicked: {
|
|
showSuccess("请按鼠标右击")
|
|
}
|
|
MouseArea{
|
|
anchors.fill: parent
|
|
acceptedButtons: Qt.RightButton
|
|
onClicked: {
|
|
menu.popup()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
CodeExpander{
|
|
Layout.fillWidth: true
|
|
Layout.topMargin: -1
|
|
code:'FluMenu{
|
|
id:menu
|
|
FluMenuItem:{
|
|
text:"删除"
|
|
onClicked: {
|
|
showError("删除")
|
|
}
|
|
}
|
|
FluMenuItem:{
|
|
text:"修改"
|
|
onClicked: {
|
|
showInfo("修改")
|
|
}
|
|
}
|
|
}
|
|
menu.popup()
|
|
'
|
|
}
|
|
|
|
FluMenu{
|
|
id:menu
|
|
FluMenuItem{
|
|
text:"删除"
|
|
onClicked: {
|
|
showError("删除")
|
|
}
|
|
}
|
|
FluMenuItem{
|
|
text:"修改"
|
|
onClicked: {
|
|
showInfo("修改")
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|