OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
doublesetting.hpp
Go to the documentation of this file.
1 #ifndef CSM_PREFS_DOUBLESETTING_H
2 #define CSM_PREFS_DOUBLESETTING_H
3 
4 #include "setting.hpp"
5 
6 namespace CSMPrefs
7 {
8  class DoubleSetting : public Setting
9  {
10  Q_OBJECT
11 
13  double mMin;
14  double mMax;
15  std::string mTooltip;
16  double mDefault;
17 
18  public:
19 
20  DoubleSetting (Category *parent, Settings::Manager *values,
21  QMutex *mutex, const std::string& key, const std::string& label,
22  double default_);
23 
24  DoubleSetting& setPrecision (int precision);
25 
26  // defaults to [0, std::numeric_limits<double>::max()]
27  DoubleSetting& setRange (double min, double max);
28 
29  DoubleSetting& setMin (double min);
30 
31  DoubleSetting& setMax (double max);
32 
33  DoubleSetting& setTooltip (const std::string& tooltip);
34 
36  virtual std::pair<QWidget *, QWidget *> makeWidgets (QWidget *parent);
37 
38  private slots:
39 
40  void valueChanged (double value);
41  };
42 }
43 
44 #endif
std::string mTooltip
Definition: doublesetting.hpp:15
Definition: doublesetting.hpp:8
Definition: category.hpp:12
double mMin
Definition: doublesetting.hpp:13
double mMax
Definition: doublesetting.hpp:14
DoubleSetting & setMin(double min)
Definition: doublesetting.cpp:35
int mPrecision
Definition: doublesetting.hpp:12
DoubleSetting & setTooltip(const std::string &tooltip)
Definition: doublesetting.cpp:47
double mDefault
Definition: doublesetting.hpp:16
DoubleSetting & setPrecision(int precision)
Definition: doublesetting.cpp:22
virtual std::pair< QWidget *, QWidget * > makeWidgets(QWidget *parent)
Return label, input widget.
Definition: doublesetting.cpp:53
Definition: setting.hpp:22
DoubleSetting(Category *parent, Settings::Manager *values, QMutex *mutex, const std::string &key, const std::string &label, double default_)
Definition: doublesetting.cpp:15
DoubleSetting & setMax(double max)
Definition: doublesetting.cpp:41
DoubleSetting & setRange(double min, double max)
Definition: doublesetting.cpp:28
Settings management (can change during runtime)
Definition: settings.hpp:17
void valueChanged(double value)
Definition: doublesetting.cpp:74