-
- m_name = new QLabel(name, this);
- layout->addWidget(m_name, 0, 0);
-
- m_slider = new QSlider(Qt::Horizontal, this);
- m_slider->setRange(min, max);
- //m_slider->setPageStep((max - min) / 10);
- layout->addWidget(m_slider, 0, 1);
-
- m_spinBox = new QSpinBox(this);
- m_spinBox->setRange(min, max);
- m_spinBox->setKeyboardTracking(false);
- if (!suffix.isEmpty())
- m_spinBox->setSuffix(suffix);
- layout->addWidget(m_spinBox, 0, 2);
-
- QToolButton *reset = new QToolButton(this);
- reset->setAutoRaise(true);
- reset->setIcon(KIcon("edit-undo"));
- reset->setToolTip(i18n("Reset to default value"));
- layout->addWidget(reset, 0, 3);
-
- m_commentLabel = new QLabel(comment, this);
- m_commentLabel->setWordWrap(true);
- m_commentLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
- m_commentLabel->setFrameShape(QFrame::StyledPanel);
- m_commentLabel->setFrameShadow(QFrame::Raised);
- m_commentLabel->setBackgroundRole(QPalette::AlternateBase);
- m_commentLabel->setHidden(true);
- layout->addWidget(m_commentLabel, 1, 0, 1, -1);
-
- connect(m_slider, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
- connect(m_spinBox, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
- connect(reset, SIGNAL(clicked(bool)), this, SLOT(slotReset()));
-
- m_spinBox->setValue(value);
+ 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)));