1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-06 00:40:04 +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.

49 lines
1.1 KiB
C++
Raw Normal View History

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