1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00
OpenMW/apps/opencs/model/prefs/doublesetting.hpp
2022-10-31 21:04:01 +01:00

50 lines
1.1 KiB
C++

#ifndef CSM_PREFS_DOUBLESETTING_H
#define CSM_PREFS_DOUBLESETTING_H
#include "setting.hpp"
class QDoubleSpinBox;
namespace CSMPrefs
{
class Category;
class DoubleSetting : public Setting
{
Q_OBJECT
int mPrecision;
double mMin;
double mMax;
std::string mTooltip;
double mDefault;
QDoubleSpinBox* mWidget;
public:
DoubleSetting(
Category* parent, QMutex* mutex, const std::string& key, const std::string& label, double default_);
DoubleSetting& setPrecision(int precision);
// defaults to [0, std::numeric_limits<double>::max()]
DoubleSetting& setRange(double min, double max);
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;
private slots:
void valueChanged(double value);
};
}
#endif