ParamWidget.h 789 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#ifndef PARAMWIDGET_H
#define PARAMWIDGET_H

#include <QWidget>
#include "ui_ParamWidget.h"

class ParamWidget : public QWidget
{
    Q_OBJECT
    
public:
    explicit ParamWidget(QWidget *parent = 0);
    ~ParamWidget();
    void setupInt(QString title,QString description,int value,int min,int max);
    void setupDouble(QString title,QString description,double value,double min,double max);
    void setupCombo(QString title,QString description,QList<QPair<int,QString> > list);
    void setValue(double value);
private:
    enum VIEWTYPE
    {
        INT,
        DOUBLE,
        COMBO
    };
    double m_min;
    double m_max;
    double m_dvalue;
    int m_ivalue;
    VIEWTYPE type;
    QList<QPair<int,QString> > m_valueList;
    Ui::ParamWidget ui;
};

#endif // PARAMWIDGET_H