- m_slider = new QSlider(Qt::Horizontal, this);
- m_slider->setRange(min, max);
- //m_slider->setPageStep((max - min) / 10);
- layout->addWidget(m_slider);
-
- m_spinBox = new QSpinBox(this);
- m_spinBox->setRange(min, max);
- if (!suffix.isEmpty())
- m_spinBox->setSuffix(suffix);
- layout->addWidget(m_spinBox);
+DoubleParameterWidget::DoubleParameterWidget(const QString &name, double value, double min, double max, double defaultValue, const QString &comment, int id, const QString &suffix, int decimals, QWidget *parent) :
+ QWidget(parent)
+{
+ setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum);
+ QGridLayout *layout = new QGridLayout(this);
+ layout->setContentsMargins(0, 0, 0, 0);
+ layout->setSpacing(0);
+
+ m_dragVal = new DragValue(name, defaultValue, decimals, min, max, id, suffix, this);
+ layout->addWidget(m_dragVal, 0, 1);
+
+ if (!comment.isEmpty()) {
+ setToolTip(comment);
+ }
+ m_dragVal->setValue(value, false);
+ connect(m_dragVal, SIGNAL(valueChanged(double,bool)), this, SLOT(slotSetValue(double,bool)));
+ connect(m_dragVal, SIGNAL(inTimeline(int)), this, SIGNAL(setInTimeline(int)));
+}