1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00
OpenMW/apps/opencs/model/prefs/modifiersetting.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
974 B
C++
Raw Normal View History

2016-07-27 13:53:33 -04:00
#ifndef CSM_PREFS_MODIFIERSETTING_H
#define CSM_PREFS_MODIFIERSETTING_H
#include "setting.hpp"
2022-10-19 19:02:00 +02:00
#include <string>
#include <utility>
2022-10-09 10:39:43 +00:00
class QMutex;
class QObject;
class QWidget;
2016-07-27 13:53:33 -04:00
class QEvent;
class QPushButton;
namespace CSMPrefs
{
2022-10-09 10:39:43 +00:00
class Category;
2023-11-12 00:52:09 +01:00
class ModifierSetting final : public TypedSetting<std::string>
2016-07-27 13:53:33 -04:00
{
Q_OBJECT
public:
2023-11-12 00:52:09 +01:00
explicit ModifierSetting(
Category* parent, QMutex* mutex, std::string_view key, const QString& label, Settings::Index& index);
2016-07-27 13:53:33 -04:00
SettingWidgets makeWidgets(QWidget* parent) override;
2016-07-27 13:53:33 -04:00
void updateWidget() override;
2016-07-27 13:53:33 -04:00
protected:
bool eventFilter(QObject* target, QEvent* event) override;
2016-07-27 13:53:33 -04:00
private:
bool handleEvent(QObject* target, int mod, int value);
void storeValue(int modifier);
void resetState();
2016-07-27 13:53:33 -04:00
QPushButton* mButton;
bool mEditorActive;
private slots:
void buttonToggled(bool checked);
};
}
#endif