Changeset View
Changeset View
Standalone View
Standalone View
src/KGraphEditorElementTreeWidget.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 _KGRAPHEDITORELEMENTTREEWIDGET_H_ | 19 | #ifndef _KGRAPHEDITORELEMENTTREEWIDGET_H_ | ||
21 | #define _KGRAPHEDITORELEMENTTREEWIDGET_H_ | 20 | #define _KGRAPHEDITORELEMENTTREEWIDGET_H_ | ||
22 | 21 | | |||
23 | #include <QTreeWidget> | 22 | #include <QTreeWidget> | ||
24 | 23 | | |||
25 | /** | 24 | /** | ||
26 | * This is the widget used to list the attributes of an element and edit them | 25 | * This is the widget used to list the attributes of an element and edit them | ||
27 | * | 26 | * | ||
28 | * @short Element attributes editing widget | 27 | * @short Element attributes editing widget | ||
29 | * @author Gael de Chalendar <kleag@free.fr> | 28 | * @author Gael de Chalendar <kleag@free.fr> | ||
30 | */ | 29 | */ | ||
31 | class KGraphEditorElementTreeWidget : public QTreeWidget | 30 | class KGraphEditorElementTreeWidget : 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 KGraphEditorElementTreeWidget(QWidget* parent = nullptr); | 37 | explicit KGraphEditorElementTreeWidget(QWidget *parent = nullptr); | ||
39 | 38 | | |||
40 | /** | 39 | /** | ||
41 | * Default Destructor | 40 | * Default Destructor | ||
42 | */ | 41 | */ | ||
43 | ~KGraphEditorElementTreeWidget() override; | 42 | ~KGraphEditorElementTreeWidget() 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 slotAddAttribute(); | 48 | void slotAddAttribute(); | ||
51 | void slotRemoveAttribute(); | 49 | void slotRemoveAttribute(); | ||
52 | 50 | | |||
53 | Q_SIGNALS: | 51 | Q_SIGNALS: | ||
54 | void addAttribute(const QString&); | 52 | void addAttribute(const QString &); | ||
55 | void removeAttribute(const QString&); | 53 | void removeAttribute(const QString &); | ||
56 | 54 | | |||
57 | private: | 55 | private: | ||
58 | void setupPopup(const QPoint& point); | 56 | void setupPopup(const QPoint &point); | ||
59 | 57 | | |||
60 | QMenu* m_popup; | 58 | QMenu *m_popup; | ||
61 | QTreeWidgetItem* m_item; | 59 | QTreeWidgetItem *m_item; | ||
62 | }; | 60 | }; | ||
63 | 61 | | |||
64 | | ||||
65 | #endif // _KGRAPHEDITORELEMENTTREEWIDGET_H_ | 62 | #endif // _KGRAPHEDITORELEMENTTREEWIDGET_H_ |