2014-04-26 14:40:58 +00:00
|
|
|
#ifndef CSVSETTINGS_RANGEVIEW_HPP
|
|
|
|
#define CSVSETTINGS_RANGEVIEW_HPP
|
|
|
|
|
|
|
|
#include "view.hpp"
|
|
|
|
#include "../../model/settings/support.hpp"
|
|
|
|
|
|
|
|
class QStringListModel;
|
2014-05-03 23:58:43 +00:00
|
|
|
class QAbstractSpinBox;
|
2014-04-26 14:40:58 +00:00
|
|
|
|
|
|
|
namespace CSVSettings
|
|
|
|
{
|
|
|
|
class RangeView : public View
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2014-05-04 02:50:08 +00:00
|
|
|
QWidget *mRangeWidget;
|
2014-05-03 23:58:43 +00:00
|
|
|
CSMSettings::SettingType mRangeType;
|
2014-04-26 14:40:58 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
explicit RangeView (CSMSettings::Setting *setting,
|
|
|
|
Page *parent);
|
|
|
|
|
|
|
|
protected:
|
2014-05-07 02:58:50 +00:00
|
|
|
|
|
|
|
///virtual function called through View
|
2014-04-26 14:40:58 +00:00
|
|
|
void updateView (bool signalUpdate = true) const;
|
|
|
|
|
2014-05-07 02:58:50 +00:00
|
|
|
///construct a slider-based view
|
2014-05-04 02:50:08 +00:00
|
|
|
void buildSlider (CSMSettings::Setting *setting);
|
2014-05-07 02:58:50 +00:00
|
|
|
|
|
|
|
///construct a spinbox-based view
|
2014-05-03 23:58:43 +00:00
|
|
|
void buildSpinBox (CSMSettings::Setting *setting);
|
|
|
|
|
2014-04-26 14:40:58 +00:00
|
|
|
private slots:
|
2014-05-03 23:58:43 +00:00
|
|
|
|
2014-05-07 02:58:50 +00:00
|
|
|
///responds to valueChanged signals
|
2014-05-03 23:58:43 +00:00
|
|
|
void slotUpdateView (int value);
|
|
|
|
void slotUpdateView (double value);
|
|
|
|
|
2014-04-26 14:40:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class RangeViewFactory : public QObject, public IViewFactory
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit RangeViewFactory (QWidget *parent = 0)
|
|
|
|
: QObject (parent)
|
|
|
|
{}
|
|
|
|
|
|
|
|
RangeView *createView (CSMSettings::Setting *setting,
|
|
|
|
Page *parent);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif // CSVSETTINGS_RANGEVIEW_HPP
|