700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > QML 打开文件夹对话框选择文件保存路径

QML 打开文件夹对话框选择文件保存路径

时间:2021-06-12 13:56:11

相关推荐

QML 打开文件夹对话框选择文件保存路径

import QtQuick 2.14import QtQuick.Controls 2.14import Qt.labs.platform 1.0ApplicationWindow {visible: truewidth: 800height: 600title: qsTr("选择文件夹对话框")Rectangle {id: inputBoxwidth: 350height: 40color: "#F3F6FA"clip: trueborder.width: 1border.color: "#DFE0E4"radius: 5anchors.centerIn: parentTextInput {id: inputBoxInputtext:folderDialog.foldercolor: "#707070"font.pixelSize: 16activeFocusOnTab: trueselectByMouse: true //是否可以选择文本selectedTextColor: "white" //设置选择文本的字体颜色selectionColor: "#4A6DBC" //设置选择框的颜色verticalAlignment: TextInput.AlignVCenterhorizontalAlignment: TextInput.AlignLeftanchors.fill: parentleftPadding: 3rightPadding: 3}}Button{text: qsTr("选择路径")height: 40width: 120anchors{verticalCenter: inputBox.verticalCenterleft: inputBox.rightleftMargin: 20}MouseArea{anchors.fill: parentonClicked: {folderDialog.open()}}}FolderDialog {id: folderDialogfolder: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0] //默认打开Pictures文件夹}}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。