|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
效果:
知识点1:获取所在路径
知识点2:ListView拖动效果
新建Rect.qml文件:
- import QtQuick 2.0
- import Qt.labs.folderlistmodel 2.1//想查看文件名必须加这行
- ListView{
- width: 750; height: 100
- FolderListModel {//自动显示程序所在文件夹的文件名
- id: folderModel
- }
- Component {
- id: fileDelegate
- Text {
- font.pixelSize: 20
- color:"blue"
- text: {
- fileName
- filePath
- }
- font.family: "仿宋"
- font.bold: true
- }
- }
- model: folderModel
- delegate: fileDelegate
- }
复制代码
main.qml文件:
- import QtQuick 2.5
- import QtQuick.Window 2.2
- Window {
- visible: true
- width: 750
- height: 100
- title: qsTr("Hello World")
- MainForm {}
- }
复制代码
MainForm.ui.qml文件:
- import QtQuick 2.5
- Rect{}
复制代码
Preview: 明天介绍物体圆周运动
|
|