QtExamples/QtQFileSystemModelEx/ExQFileSystemModel.h
touwoyimuli deff6bad43 feat: QFileSystemModel
QFileSystemModel(文件系统的模型)的介绍和使用
2019-09-15 00:35:08 +08:00

38 lines
951 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef EXQFILESYSTEMMODEL_H
#define EXQFILESYSTEMMODEL_H
#include <QMainWindow>
#include <QLabel>
#include <QCheckBox>
#include <QFileSystemModel>
namespace Ui {
class ExQFileSystemModel;
}
class ExQFileSystemModel : public QMainWindow
{
Q_OBJECT
public:
explicit ExQFileSystemModel(QWidget *parent = nullptr);
~ExQFileSystemModel();
void init(); //初始化,以及初始化状态栏
private slots:
void on_treeView_clicked(const QModelIndex &index); //单击treeView会在状态栏显示当前节点的信息
private:
Ui::ExQFileSystemModel *ui;
QLabel* m_labFileName; //文件名
QLabel* m_labFileSize; //文件大小
QLabel* m_labFileType; //文件类型
QLabel* m_labPath; //路径
QCheckBox* m_chkBoxIsFile; //当前是否为文件或文件夹
QFileSystemModel* m_model; //设置文件系统的模型
};
#endif // EXQFILESYSTEMMODEL_H