资源简介
QT文件资源管理器

代码片段和文件信息
#include “filemanager.h“
#include
#include
#include
#include
#include
#include
//构造函数
FileManager::FileManager(QWidget *parent)
: QWidget(parent)
{
QLabel *pathLabel = new QLabel(this);
pathLabel->setText(tr(“path“));
initSystem();
connect(treeView SIGNAL(doubleClicked(QModelIndex )) table SLOT(setRootIndex(QModelIndex )));
connect(table SIGNAL(doubleClicked(QModelIndex )) thisSLOT(showChild(QModelIndex)));
connect(treeView SIGNAL(doubleClicked(QModelIndex ))thisSLOT(showPath(QModelIndex)));
connect(table SIGNAL(doubleClicked(QModelIndex )) thisSLOT(showPath(QModelIndex)));
connect(backPtnSIGNAL(clicked())SLOT(GoBack()));
connect(advancePtnSIGNAL(clicked())SLOT(GoAhead()));
connect(tableSIGNAL(clicked(QModelIndex))thisSLOT(getPath(QModelIndex)));
QSplitter *splitter = new QSplitter(this);
splitter->addWidget(treeView);
splitter->addWidget(table);
splitter->show();
QHBoxLayout *hlayout = new QHBoxLayout;
QVBoxLayout *vlayout = new QVBoxLayout;
hlayout->addWidget(advancePtn);
hlayout->addWidget(backPtn);
hlayout->addWidget(pathLabel);
hlayout->addWidget(pathLine);
vlayout->addLayout(hlayout);
vlayout->addWidget(splitter);
setLayout(vlayout);
}
//析构函数
FileManager::~FileManager()
{
delete model;
delete treeView;
delete table;
delete pathLine;
delete backPtn;
delete advancePtn;
}
//新建文本文档
void FileManager::newTxtFile(void)
{
QString path = model->fileInfo(DirIndex).absoluteFilePath();//获取程序当前文件路径
#ifdef _WIN32
path.replace(“/““\\“);//将路径中的‘/‘替换为windows中的‘\\‘
path = path + “\\“;
#else
path = path + “/“;//LINUX路径
#endif
if(!findSameFile(tr(“NewNotepad.txt“)path))
{
QFile file(path+tr(“NewNotepad.txt“));
file.open(QIODevice::WriteOnly);
file.close();
}
else
{
int i = 1;
QString num;
while(1)
{
QString filename = tr(“NewNotepad“)+num.setNum(i)+“.txt“;
if(!findSameFile(filenamepath))
{
QFile file(path+filename);
file.open(QIODevice::WriteOnly);
file.close();
return;
}
i++;
}
}
}
//新建excel表格
void FileManager::newExelFile(void)
{
QString path = model->fileInfo(DirIndex).absoluteFilePath();//获取程序当前文件路径
#ifdef _WIN32
path.replace(“/““\\“);//将路径中的‘/‘替换为windows中的‘\\‘
path = path + “\\“;
#else
path = path + “/“;
#endif
if(!findSameFile(tr(“Microsoft Excel.xls“)path))
{
QFile file(path+tr(“Microsoft Excel.xls“));
file.open(QIODevice::WriteOnly);
file.close();
}
else
{
int i = 1;
QString num;
while(1)
{
QStrin
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 16791 2015-12-10 15:16 fileManager_Qt\filemanager.cpp
文件 1586 2015-12-10 09:55 fileManager_Qt\filemanager.h
文件 192 2015-12-10 10:29 fileManager_Qt\FileManager.pro
文件 129 2012-12-24 22:28 fileManager_Qt\icon.qrc
文件 23935 2012-12-24 22:18 fileManager_Qt\images\back.png
文件 23910 2012-12-24 22:18 fileManager_Qt\images\go.png
文件 1089 2015-12-10 11:38 fileManager_Qt\main.cpp
目录 0 2018-12-27 18:49 fileManager_Qt\images
目录 0 2018-12-27 18:49 fileManager_Qt
----------- --------- ---------- ----- ----
67632 9
- 上一篇:KWIC体系结构风格与模式
- 下一篇:基于STC89C52RC的超声波测距系统设计
相关资源
- 酒店管理系统基于Qt Creator5)
- vtk QT做的三维地质可视化系统2of2
- Qt局域网聊天软件
- Qt Creator opengl实现四元数鼠标控制轨迹
- QT局域网聊天系统(基于QT5.修改过)
- qt-电子点菜系统
- C 餐厅叫号系统(QT平)
- QT 实现文件下载
- qt图像处理
- QT,JPEG解码源代码(已完成)
- Qt 播放音频文件
- Qt 读取16进制的data文件
- MQTT+串口(usart)透传
- 易语言QQTEA算法源码
- VC工程转Qt工程文件的工具
- MQTT推送Demo
- 基于Linux、QT的视频监控系统的设计与
- Qt 百度地图 定位
- QT酷炫界面开发指南《QmlBook》
- Ubuntu下操作Excel,qt代码
- Qt图片浏览器 --基于Qt的Graphics View f
- qtnribbon2破解
- Qt软件开发 完整项目代码
- MQTT_3.1protocol_Specific中文版
- 在QT中使用RTP进行视频的采集和传输
- Mini6410 Qt4和Qtopia编程开发指南
- Qt实现Code39条形码
- qt_ffmpeg_mp4_export_and_import.zip
- QT5.5入门与项目实战
- Huffman Compress 霍夫曼编码 压缩 解压缩
评论
共有 条评论