OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
shortcutsetting.hpp
Go to the documentation of this file.
1 #ifndef CSM_PREFS_SHORTCUTSETTING_H
2 #define CSM_PREFS_SHORTCUTSETTING_H
3 
4 #include <QKeySequence>
5 
6 #include "setting.hpp"
7 
8 class QEvent;
9 class QPushButton;
10 
11 namespace CSMPrefs
12 {
13  class ShortcutSetting : public Setting
14  {
15  Q_OBJECT
16 
17  public:
18 
19  ShortcutSetting(Category* parent, Settings::Manager* values, QMutex* mutex, const std::string& key,
20  const std::string& label);
21 
22  virtual std::pair<QWidget*, QWidget*> makeWidgets(QWidget* parent);
23 
24  protected:
25 
26  bool eventFilter(QObject* target, QEvent* event);
27 
28  private:
29 
30  bool handleEvent(QObject* target, int mod, int value, bool active);
31 
32  void storeValue(const QKeySequence& sequence);
33  void resetState();
34 
35  static const int MaxKeys = 4;
36 
37  QPushButton* mButton;
38 
42 
43  private slots:
44 
45  void buttonToggled(bool checked);
46  };
47 }
48 
49 #endif
int mEditorPos
Definition: shortcutsetting.hpp:40
QPushButton * mButton
Definition: shortcutsetting.hpp:37
ShortcutSetting(Category *parent, Settings::Manager *values, QMutex *mutex, const std::string &key, const std::string &label)
Definition: shortcutsetting.cpp:17
Definition: category.hpp:12
virtual std::pair< QWidget *, QWidget * > makeWidgets(QWidget *parent)
Definition: shortcutsetting.cpp:30
bool mEditorActive
Definition: shortcutsetting.hpp:39
void resetState()
Definition: shortcutsetting.cpp:172
static const int MaxKeys
Definition: shortcutsetting.hpp:35
Definition: setting.hpp:22
bool eventFilter(QObject *target, QEvent *event)
Definition: shortcutsetting.cpp:49
Definition: shortcutsetting.hpp:13
bool handleEvent(QObject *target, int mod, int value, bool active)
Definition: shortcutsetting.cpp:97
void buttonToggled(bool checked)
Definition: shortcutsetting.cpp:190
Settings management (can change during runtime)
Definition: settings.hpp:17
int mEditorKeys[MaxKeys]
Definition: shortcutsetting.hpp:41
void storeValue(const QKeySequence &sequence)
Definition: shortcutsetting.cpp:157