Changeset View
Changeset View
Standalone View
Standalone View
src/KGraphEditorNodesTreeWidget.h
Show All 10 Lines | 1 | /* This file is part of KGraphViewer. | |||
---|---|---|---|---|---|
11 | General Public License for more details. | 11 | General Public License for more details. | ||
12 | 12 | | |||
13 | You should have received a copy of the GNU General Public License | 13 | You should have received a copy of the GNU General Public License | ||
14 | along with this program; if not, write to the Free Software | 14 | along with this program; if not, write to the Free Software | ||
15 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 15 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
16 | 02110-1301, USA | 16 | 02110-1301, USA | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | | ||||
20 | #ifndef _KGRAPHEDITORNODESTREEWIDGET_H_ | 19 | #ifndef _KGRAPHEDITORNODESTREEWIDGET_H_ | ||
21 | #define _KGRAPHEDITORNODESTREEWIDGET_H_ | 20 | #define _KGRAPHEDITORNODESTREEWIDGET_H_ | ||
22 | 21 | | |||
23 | #include <QTreeWidget> | 22 | #include <QTreeWidget> | ||
24 | 23 | | |||
25 | /** | 24 | /** | ||
26 | * This is the widget used to list the nodes and and edit their attributes | 25 | * This is the widget used to list the nodes and and edit their attributes | ||
27 | * | 26 | * | ||
28 | * @short Nodes attributes editing widget | 27 | * @short Nodes attributes editing widget | ||
29 | * @author Gael de Chalendar <kleag@free.fr> | 28 | * @author Gael de Chalendar <kleag@free.fr> | ||
30 | */ | 29 | */ | ||
31 | class KGraphEditorNodesTreeWidget : public QTreeWidget | 30 | class KGraphEditorNodesTreeWidget : public QTreeWidget | ||
32 | { | 31 | { | ||
33 | Q_OBJECT | 32 | Q_OBJECT | ||
34 | public: | 33 | public: | ||
35 | /** | 34 | /** | ||
36 | * Default Constructor | 35 | * Default Constructor | ||
37 | */ | 36 | */ | ||
38 | explicit KGraphEditorNodesTreeWidget(QWidget* parent = nullptr); | 37 | explicit KGraphEditorNodesTreeWidget(QWidget *parent = nullptr); | ||
39 | 38 | | |||
40 | /** | 39 | /** | ||
41 | * Default Destructor | 40 | * Default Destructor | ||
42 | */ | 41 | */ | ||
43 | ~KGraphEditorNodesTreeWidget() override; | 42 | ~KGraphEditorNodesTreeWidget() override; | ||
44 | 43 | | |||
45 | protected: | 44 | protected: | ||
46 | | ||||
47 | void contextMenuEvent(QContextMenuEvent* e) override; | 45 | void contextMenuEvent(QContextMenuEvent *e) override; | ||
48 | 46 | | |||
49 | protected Q_SLOTS: | 47 | protected Q_SLOTS: | ||
50 | void slotRemoveNode(); | 48 | void slotRemoveNode(); | ||
51 | void slotAddAttribute(); | 49 | void slotAddAttribute(); | ||
52 | void slotRemoveAttribute(); | 50 | void slotRemoveAttribute(); | ||
53 | 51 | | |||
54 | public Q_SLOTS: | 52 | public Q_SLOTS: | ||
55 | void slotRemoveElement(const QString& id); | 53 | void slotRemoveElement(const QString &id); | ||
56 | 54 | | |||
57 | Q_SIGNALS: | 55 | Q_SIGNALS: | ||
58 | void removeNode(const QString&); | 56 | void removeNode(const QString &); | ||
59 | void addAttribute(const QString&); | 57 | void addAttribute(const QString &); | ||
60 | void removeAttribute(const QString&,const QString&); | 58 | void removeAttribute(const QString &, const QString &); | ||
61 | 59 | | |||
62 | private: | 60 | private: | ||
63 | void setupPopup(const QPoint& point); | 61 | void setupPopup(const QPoint &point); | ||
64 | 62 | | |||
65 | QMenu* m_popup; | 63 | QMenu *m_popup; | ||
66 | QTreeWidgetItem* m_item; | 64 | QTreeWidgetItem *m_item; | ||
67 | }; | 65 | }; | ||
68 | 66 | | |||
69 | #endif // _KGRAPHEDITORNODESTREEWIDGET_H_ | 67 | #endif // _KGRAPHEDITORNODESTREEWIDGET_H_ |