You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw-tes3coop/apps/opencs/model/prefs/shortcutsetting.hpp

50 lines
1.0 KiB
C++

#ifndef CSM_PREFS_SHORTCUTSETTING_H
#define CSM_PREFS_SHORTCUTSETTING_H
#include <QKeySequence>
#include "setting.hpp"
class QEvent;
class QPushButton;
namespace CSMPrefs
{
class ShortcutSetting : public Setting
{
Q_OBJECT
public:
ShortcutSetting(Category* parent, Settings::Manager* values, QMutex* mutex, const std::string& key,
const std::string& label);
virtual std::pair<QWidget*, QWidget*> makeWidgets(QWidget* parent);
protected:
bool eventFilter(QObject* target, QEvent* event);
private:
bool handleEvent(QObject* target, int mod, int value, bool active);
void storeValue(const QKeySequence& sequence);
void resetState();
static const int MaxKeys = 4;
QPushButton* mButton;
bool mEditorActive;
int mEditorPos;
int mEditorKeys[MaxKeys];
private slots:
void buttonToggled(bool checked);
};
}
#endif