-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvideofiletreeview.h
More file actions
40 lines (31 loc) · 1.04 KB
/
videofiletreeview.h
File metadata and controls
40 lines (31 loc) · 1.04 KB
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
#ifndef VIDEOFILETREEVIEW_H
#define VIDEOFILETREEVIEW_H
#include <QTreeView>
#include <QStringList>
#include <QDir>
#include <QModelIndex>
// Forward declarations
class QFileSystemModel;
class FolderFirstSortProxyModel; // <<< Added forward declaration
/**
* @brief The VideoFileTreeView class provides a view for Browse directory structures,
* displaying only subdirectories and specified video files.
* Sorts folders before files.
* Emits a signal when a video file is double-clicked.
*/
class VideoFileTreeView : public QTreeView {
Q_OBJECT
public:
explicit VideoFileTreeView(QWidget *parent = nullptr);
~VideoFileTreeView();
void setRootDirectory(const QString &path);
signals:
void videoFileDoubleClicked(const QString &filePath);
private slots:
void onItemDoubleClicked(const QModelIndex &index);
private:
QFileSystemModel *fileSystemModel; // Source model
FolderFirstSortProxyModel *proxyModel; // Proxy model for custom sorting
QStringList videoFileFilters;
};
#endif // VIDEOFILETREEVIEW_H