forked from ic005k/Xplist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mytreeview.h
36 lines (27 loc) · 770 Bytes
/
mytreeview.h
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
#ifndef MYTREEVIEW_H
#define MYTREEVIEW_H
#include <QAbstractItemView>
#include <QDebug>
#include <QKeyEvent>
#include <QMessageBox>
#include <QObject>
#include <QTreeView>
#include <QWidget>
typedef struct _NodeP {
int nRowNo;
std::vector<_NodeP> arChildren;
} NodeExpand;
class MyTreeView : public QTreeView {
Q_OBJECT
enum DropIndicatorPosition { OnItem, AboveItem, BelowItem, OnViewport };
protected:
void keyPressEvent(QKeyEvent* event) override;
void dropEvent(QDropEvent* event) override;
void dragEnterEvent(QDragEnterEvent* event) override;
void dragMoveEvent(QDragMoveEvent* event) override;
void dragLeaveEvent(QDragLeaveEvent* event) override;
public:
explicit MyTreeView(QWidget* parent);
private:
};
#endif // MYTREEVIEW_H