1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 22:53:53 +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.

44 lines
911 B
C++
Raw Normal View History

2015-12-08 16:21:58 +00:00
#ifndef CSM_PREFS_INTSETTING_H
#define CSM_PREFS_INTSETTING_H
#include "setting.hpp"
class QSpinBox;
2015-12-08 16:21:58 +00:00
namespace CSMPrefs
{
class IntSetting : public Setting
{
Q_OBJECT
int mMin;
int mMax;
std::string mTooltip;
int mDefault;
QSpinBox* mWidget;
2015-12-08 16:21:58 +00:00
public:
2015-12-15 11:19:48 +00:00
IntSetting(Category* parent, QMutex* mutex, const std::string& key, const std::string& label, int default_);
2015-12-08 16:21:58 +00:00
2015-12-15 11:19:48 +00:00
// defaults to [0, std::numeric_limits<int>::max()]
IntSetting& setRange(int min, int max);
2015-12-08 16:21:58 +00:00
IntSetting& setMin(int min);
IntSetting& setMax(int max);
IntSetting& setTooltip(const std::string& tooltip);
/// Return label, input widget.
std::pair<QWidget*, QWidget*> makeWidgets(QWidget* parent) override;
void updateWidget() override;
2015-12-08 16:21:58 +00:00
private slots:
2015-12-08 16:21:58 +00:00
void valueChanged(int value);
};
}
#endif