Rectangle{
id:view_Rec
anchors.fill: parent
border.color: "black"
border.width: 1
Column{
id:view_Row
width: parent.width-10
height: parent.height-10
anchors.centerIn: parent
spacing: 5
Rectangle{
id:open_Rec
width: parent.width
height: 30
color: "#00000000"
Text {
id: open_Text
text: qsTr("打开")
font.pointSize: fontSize
font.bold: true
color: fontColor
anchors.left: parent.left
anchors.leftMargin: 15
anchors.verticalCenter: parent.verticalCenter
}
MouseArea{
id:open_MA
anchors.fill: parent
hoverEnabled: true
onEntered: {open_Rec.color = "#99cef0"}
onExited: {open_Rec.color = "#00000000"}
onClicked: {
fileDialog.open()
}
}
}
}
}
FileDialog{
id:fileDialog
title: "!!!!"
nameFilters: ["*.json"]
}
当选择了文件之后的改变
onAccepted: {}