1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-24 10:53:53 +00:00
openmw/apps/opencs/model/prefs/doublesetting.hpp

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

50 lines
1.1 KiB
C++
Raw Normal View History

2015-12-10 09:58:38 +00:00
#ifndef CSM_PREFS_DOUBLESETTING_H
#define CSM_PREFS_DOUBLESETTING_H
#include "setting.hpp"
class QDoubleSpinBox;
2015-12-10 09:58:38 +00:00
namespace CSMPrefs
{
2022-10-19 17:02:00 +00:00
class Category;
2015-12-10 09:58:38 +00:00
class DoubleSetting : public Setting
{
Q_OBJECT
int mPrecision;
2015-12-10 09:58:38 +00:00
double mMin;
double mMax;
std::string mTooltip;
double mDefault;
QDoubleSpinBox* mWidget;
2015-12-10 09:58:38 +00:00
public:
DoubleSetting(
2015-12-15 11:19:48 +00:00
Category* parent, QMutex* mutex, const std::string& key, const std::string& label, double default_);
2015-12-10 09:58:38 +00:00
DoubleSetting& setPrecision(int precision);
2015-12-10 09:58:38 +00:00
2016-04-02 18:02:56 +00:00
// defaults to [0, std::numeric_limits<double>::max()]
DoubleSetting& setRange(double min, double max);
2015-12-10 09:58:38 +00:00
DoubleSetting& setMin(double min);
DoubleSetting& setMax(double max);
DoubleSetting& setTooltip(const std::string& tooltip);
/// Return label, input widget.
std::pair<QWidget*, QWidget*> makeWidgets(QWidget* parent) override;
void updateWidget() override;
2015-12-10 09:58:38 +00:00
private slots:
2015-12-10 09:58:38 +00:00
void valueChanged(double value);
};
}
#endif