1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00
OpenMW/apps/opencs/model/prefs/intsetting.hpp

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

49 lines
983 B
C++
Raw Normal View History

2015-12-08 17:21:58 +01:00
#ifndef CSM_PREFS_INTSETTING_H
#define CSM_PREFS_INTSETTING_H
#include "setting.hpp"
class QSpinBox;
2022-10-19 19:02:00 +02:00
class QMutex;
class QObject;
class QWidget;
2015-12-08 17:21:58 +01:00
namespace CSMPrefs
{
2022-10-19 19:02:00 +02:00
class Category;
2023-11-12 00:52:09 +01:00
class IntSetting final : public TypedSetting<int>
2015-12-08 17:21:58 +01:00
{
Q_OBJECT
int mMin;
int mMax;
std::string mTooltip;
QSpinBox* mWidget;
2015-12-08 17:21:58 +01:00
public:
2023-11-12 00:52:09 +01:00
explicit IntSetting(
Category* parent, QMutex* mutex, const std::string& key, const QString& label, Settings::Index& index);
2015-12-08 17:21:58 +01:00
2015-12-15 12:19:48 +01:00
// defaults to [0, std::numeric_limits<int>::max()]
IntSetting& setRange(int min, int max);
2015-12-08 17:21:58 +01:00
IntSetting& setMin(int min);
IntSetting& setMax(int max);
IntSetting& setTooltip(const std::string& tooltip);
/// Return label, input widget.
SettingWidgets makeWidgets(QWidget* parent) override;
2015-12-08 17:21:58 +01:00
void updateWidget() override;
2015-12-08 17:21:58 +01:00
private slots:
2015-12-08 17:21:58 +01:00
void valueChanged(int value);
};
}
#endif