-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathadvancedtoolbox.h
More file actions
77 lines (62 loc) · 2.03 KB
/
advancedtoolbox.h
File metadata and controls
77 lines (62 loc) · 2.03 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
69
70
71
72
73
74
75
76
77
#ifndef ADVANCEDTOOLBOX_H
#define ADVANCEDTOOLBOX_H
#include <QFrame>
#include <QWidget>
#include <QIcon>
class AdvancedToolBoxPrivate;
class ToolBoxTitle;
class ToolBoxSplitterHandle;
class AdvancedToolBox : public QWidget
{
Q_OBJECT
public:
explicit AdvancedToolBox(QWidget *parent = nullptr);
~AdvancedToolBox();
QSize sizeHint() const;
QSize minimumSizeHint() const;
void addWidget(QWidget * widget, const QString & label, const QIcon & icon = QIcon());
int indexOf(QWidget * widget);
QWidget * takeIndex(int index);
QWidget * widget(int index);
void setItemExpand(int index, bool expand = true);
void setItemVisible(int index, bool visible = true);
void setItemText(int index, const QString & text);
void setItemIcon(int index, const QIcon & icon);
QString itemText(int index);
QIcon itemIcon(int index);
int textIndentation();
void resetTextIndentation(int indent = -1);
void setDragSortEnable(bool enable);
void setAnimationEnable(bool enable);
protected:
bool event(QEvent *e);
void paintEvent(QPaintEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
void dragMoveEvent(QDragMoveEvent *event);
void dropEvent(QDropEvent *event);
void dragLeaveEvent(QDragLeaveEvent *event);
void startDrag(int index, const QPoint & gpos);
private:
Q_DECLARE_PRIVATE(AdvancedToolBox)
Q_DISABLE_COPY(AdvancedToolBox)
QScopedPointer<AdvancedToolBoxPrivate> d_ptr;
private:
friend class ToolBoxTitle;
friend class ToolBoxSplitterHandle;
};
class ToolBoxSplitterHandle : public QWidget
{
public:
ToolBoxSplitterHandle(AdvancedToolBox * parent);
void setIndex(int index);
int index();
protected:
void mouseMoveEvent(QMouseEvent *) override;
void mousePressEvent(QMouseEvent *) override;
void mouseReleaseEvent(QMouseEvent *) override;
private:
int _index = -1;
bool pressed = false;
QPoint moveStart;
};
#endif // ADVANCEDTOOLBOX_H