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-tes3mp/apps/opencs/model/prefs/intsetting.hpp

46 lines
1.0 KiB
C++

#ifndef CSM_PREFS_INTSETTING_H
#define CSM_PREFS_INTSETTING_H
#include "setting.hpp"
class QSpinBox;
namespace CSMPrefs
{
class IntSetting : public Setting
{
Q_OBJECT
int mMin;
int mMax;
std::string mTooltip;
int mDefault;
QSpinBox* mWidget;
public:
IntSetting (Category *parent, Settings::Manager *values,
QMutex *mutex, const std::string& key, const std::string& label, int default_);
// defaults to [0, std::numeric_limits<int>::max()]
IntSetting& setRange (int min, int max);
IntSetting& setMin (int min);
IntSetting& setMax (int max);
IntSetting& setTooltip (const std::string& tooltip);
/// Return label, input widget.
virtual std::pair<QWidget *, QWidget *> makeWidgets (QWidget *parent);
virtual void updateWidget();
private slots:
void valueChanged (int value);
};
}
#endif