import QtQuick 2.3
import Qt.labs.folderlistmodel 2.1
import QtQuick.Controls.Styles 1.2
import QtQuick.Controls 1.2
import QtQuick.Window 2.15
ListView {
id:listView
width: Screen.desktopAvailableWidth
height: Screen.desktopAvailableHeight
property bool mRadioBtnVisible: false
FolderListModel {
id: folderModel
showDotAndDotDot: true
showDirs: true
folder: /*"file:///D:"*/ fileSystemModel.mySetRootPath()
nameFilters: [".dat"]
}
Component {
id: fileDelegate
Row{
Rectangle{
color: "#FFDEAD"
id:mRadioBtn
width: 40
height: 40
border.color: "#ffffff"
border.width: 1
RadioButton{
id:mRadioBtn1
//anchors.fill: parent
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
visible: mRadioBtnVisible
onCheckedChanged: {
if(mBtnText.text == ".."){
}
else if(mBtnText.text == "."){}
else{
fileSystemModel.addRemoveFile(checked,folderModel.folder.toString(),(folderModel.folder+"/"+mBtnText.text).toString());
}
}
}
MouseArea{
anchors.fill: parent
onClicked: {
mRadioBtn1.checked = !mRadioBtn1.checked
}
}
}
Rectangle{
height: 40
width:listView.width-mRadioBtn.width
// color: "#FFDEAD"
border.color: "#ffffff"
border.width: 1
color: rect_mouse.pressed ? "#01968c" : (rect_mouse.containsMouse ? "#20c9b3" : "#FFDEAD")
Text {
id:mBtnText
// width: parent.width-mRadioBtn.width-misFolder.width
anchors.verticalCenter: parent.verticalCenter
text: fileName
}
Text {
id:misFolder
width: 20
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
Component.onCompleted: {
var mIndex = folderModel.indexOf(fol
qml文件资源管理器
最新推荐文章于 2024-05-15 15:26:17 发布
qml文件管理器,由于我的项目不需要添加文件和文件夹,所以没有写入这部分的功能,喜欢加图片的小伙伴也可以加一些图片进去
摘要由CSDN通过智能技术生成