-
Notifications
You must be signed in to change notification settings - Fork 0
/
mytreewidget.h
62 lines (50 loc) · 1.52 KB
/
mytreewidget.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
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
#ifndef MYTREEWIDGET_H
#define MYTREEWIDGET_H
#include <QTreeWidget>
#include <QLineEdit>
#include <QSignalBlocker>
#include <QDebug>
#include <QMouseEvent>
#include <QMenu>
class MyTreeWidget : public QTreeWidget
{
Q_OBJECT
public:
MyTreeWidget(QWidget* parent = 0);
~MyTreeWidget();
void mouseDoubleClickEvent(QMouseEvent*);
void mousePressEvent(QMouseEvent*);
public slots:
void addChild(QString=""); // child created externally
void createChild(); // child create internally
void renameChild(QString,QString);
bool hasConflict(QString,int count_start = 0);
void overWriteChild(QString);
void removeChild(QString);
private slots:
void contextMenu(QPoint);
void open();
void play();
void rename();
void del();
void openFileLocation();
signals:
void newChildCreated(QString);
void clickedToSetCurrentPlaylist(QString);
void clickedToMap(QString);
void clickedToClearMap();
void overWritten(QString);
void clickedToRenameChild(QString,QString);
void clickedToOpen(QString);
void clickedToPlay();
void clickedToRename();
void clickedToDelete(QString);
void clickedToOpenFileLocation(QString);
private:
const QTreeWidgetItem* last_item_created = new QTreeWidgetItem; // for playlist
QMenu* context_menu;
QTreeWidgetItem* item_with_context_menu = new QTreeWidgetItem;
private slots:
void sendChildName(QTreeWidgetItem*,int);
};
#endif // MYTREEWIDGET_H