-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathnormaltreeview.hpp
50 lines (37 loc) · 1.08 KB
/
normaltreeview.hpp
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
46
47
48
49
50
#ifndef NORMALTREEVIEW_HPP
#define NORMALTREEVIEW_HPP
#include "treemodel.hpp"
#include "treeview.hpp"
#include <QFileInfo>
class NormalTreeModel : public BaseTreeModel
{
Q_OBJECT
public:
explicit NormalTreeModel(QObject *parent);
void setTr();
void setDatas(const QFileInfoList &fileInfos, bool depth = false);
[[nodiscard]] auto rowCount(const QModelIndex &idx = QModelIndex()) const -> int override;
protected:
[[nodiscard]] auto columnCount(const QModelIndex &idx) const -> int override
{
Q_UNUSED(idx)
return m_headerList.size();
}
[[nodiscard]] auto headerData(int section, Qt::Orientation orientation, int role) const
-> QVariant override;
private:
QStringList m_headerList;
};
class NormalTreeView : public TreeView
{
Q_OBJECT
public:
explicit NormalTreeView(QWidget *parent = nullptr);
~NormalTreeView() override;
void setDatas(const QFileInfoList &fileInfos);
private:
void setupUI();
class NormalTreeViewPrivate;
QScopedPointer<NormalTreeViewPrivate> d_ptr;
};
#endif // NORMALTREEVIEW_HPP