-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyTreeView.h
More file actions
68 lines (56 loc) · 1.41 KB
/
Copy pathMyTreeView.h
File metadata and controls
68 lines (56 loc) · 1.41 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#pragma once
#ifndef MYTREEVIEW_H
#define MYTREEVIEW_H
#include <QTreeView>
#include "ImgOrganizer/COLOR.h"
#include <iostream>
#include "qevent.h"
#include "qmimedata.h"
#include <QStandardItem>
#include <QDrag>
#include "MyStandardItemModel.h"
#include <QLabel>
#include <QFileSystemModel>
#include <filesystem>
#include <QMenu>
#include <QAction>
#include <QCursor>
#include <QMessageBox>
QT_BEGIN_NAMESPACE
class QDragEnterEvent;
class QDropEvent;
class QDragMoveEvent;
class QMouseEvent;
QT_END_NAMESPACE
/* *************************************
* Class for viewing the filesystem
*
* This class derrives from QTreeView
*
* added options:
*
* 1) adding and removing folders in an added contex menu
*
* 2) drag and drop options
*
* 3) key events
*
* ************************************** */
class MyTreeView : public QTreeView{
Q_OBJECT
public:
MyTreeView(QWidget *parent = nullptr);
bool CopyFile(const QString& sourceFile, const QString& destinationDir);
public slots:
void ShowContextMenu(const QPoint &pos);
///virtual void startDrag(Qt::DropActions supportedActions) override{}
void addFolder();
void removeFolder();
protected:
void dragEnterEvent(QDragEnterEvent *event) override;
void dragMoveEvent(QDragMoveEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void dropEvent(QDropEvent *event) override;
private:
};
#endif // MYTREEVIEW_H