ParamWidget.h 1.07 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
#ifndef PARAMWIDGET_H
#define PARAMWIDGET_H

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

class ParamWidget : public QWidget
{
    Q_OBJECT
    
public:
12
    explicit ParamWidget(QString param,QWidget *parent = 0);
13 14 15 16 17
    ~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);
18 19 20 21 22 23 24 25
signals:
    void doubleValueChanged(QString param,double value);
    void intValueChanged(QString param,int value);
private slots:
    void doubleSpinEditFinished();
    void intSpinEditFinished();
    void comboIndexChanged(int index);
    void valueSliderReleased();
26
private:
27
    QString m_param;
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
    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