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