-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfileexplorer.h
More file actions
45 lines (33 loc) · 857 Bytes
/
fileexplorer.h
File metadata and controls
45 lines (33 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef FILEEXPLORER_H
#define FILEEXPLORER_H
#include <QWidget>
class QTreeView;
class QFileSystemModel;
class QVBoxLayout;
class FileExplorer : public QWidget
{
Q_OBJECT
public:
explicit FileExplorer(QWidget *parent = nullptr);
~FileExplorer();
public slots:
void navigateToPath(const QString &path);
void refresh();
void goToRoot();
signals:
void fileOpened(const QString &path);
void fileDeleted(const QString &path);
private:
QTreeView *treeView;
QFileSystemModel *model;
void setupUI();
void setupModel();
void setupContextMenu();
QString getRootPath() const;
private slots:
void showContextMenu(const QPoint &pos);
void openFile(const QString &path);
void fileProperties(const QString &path);
void deleteFile(const QString &path);
};
#endif // FILEEXPLORER_H