BALL 1.5.0
hotkeyTable.h
Go to the documentation of this file.
1#ifndef BALL_VIEW_WIDGETS_HOTKEY_TABLE_H
2#define BALL_VIEW_WIDGETS_HOTKEY_TABLE_H
3
4#ifndef BALL_VIEW_KERNEL_COMMON_H
6#endif
7
8#ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
10#endif
11
12#ifndef BALL_VIEW_WIDGETS_PYWIDGET_H
14#endif
15
16#include <QtWidgets/QTableWidget>
17#include <QtWidgets/QItemDelegate>
18
19namespace BALL
20{
21 namespace VIEW
22 {
24 : public QItemDelegate
25 {
26 public:
27
29
30 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
31 const QModelIndex &index) const;
32
33 void setEditorData(QWidget *editor, const QModelIndex &index) const;
34 void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
35
37 const QStyleOptionViewItem &option, const QModelIndex &index) const;
38 private:
39
40 QStringList sl_keys_;
41 QStringList sl_modifier_;
42 };
43
48 : public QTableWidget,
50 {
51 Q_OBJECT
52
53 public:
54
57 {
58 NONE = 0,
59 SHIFT
60 // ALT // currently not working!
61 };
62
64 HotkeyTable(QWidget* parent = 0, const char* name = "PythonSettings");
65
67 virtual bool getValue(String& value) const;
68
70 virtual bool setValue(const String& value);
71
73 std::list<Hotkey> getContent() const;
74
76 void setContent(const std::list<Hotkey>& hotkeys);
77
78 public Q_SLOTS:
79
81 virtual void addEmptyRow();
82
84 virtual void removeSelection();
85
89 virtual void appendHotkey(const String& modif, const String& F_key,
90 const String& command, String comment = "");
91
92 private:
93 QStringList modifier_, keys_;
94 ComboBoxDelegate delegate_;
95 };
96 }
97}
98
99#endif //BALL_VIEW_WIDGETS_HOTKEY_TABLE_H
Definition: constants.h:13
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
ComboBoxDelegate(QObject *parent=0)
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
void setEditorData(QWidget *editor, const QModelIndex &index) const
virtual void appendHotkey(const String &modif, const String &F_key, const String &command, String comment="")
std::list< Hotkey > getContent() const
HotkeyTable(QWidget *parent=0, const char *name="PythonSettings")
virtual bool setValue(const String &value)
Overload this in derived classes!
void setContent(const std::list< Hotkey > &hotkeys)
virtual bool getValue(String &value) const
Overload this in derived classes!
virtual void removeSelection()
virtual void addEmptyRow()
#define BALL_DEPRECATED
Definition: COMMON/global.h:64