X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fdoubleparameterwidget.cpp;h=3f4838c5fa9d7024081229832ce7c7128a5a2619;hb=5d4e8497fc4b3681f3024bf8fc8bf4e338fbbdc4;hp=136a3bcba32862882bea20dbbefeaf65a97d5e7f;hpb=ce68de86827a11cd0dc96465fba021b2f7ceea55;p=kdenlive diff --git a/src/doubleparameterwidget.cpp b/src/doubleparameterwidget.cpp index 136a3bcb..3f4838c5 100644 --- a/src/doubleparameterwidget.cpp +++ b/src/doubleparameterwidget.cpp @@ -31,9 +31,9 @@ #include -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), - m_commentLabel(NULL) +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), + m_commentLabel(NULL) { setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum); QGridLayout *layout = new QGridLayout(this); @@ -44,24 +44,16 @@ DoubleParameterWidget::DoubleParameterWidget(const QString &name, double value, layout->addWidget(m_dragVal, 0, 1); if (!comment.isEmpty()) { - m_commentLabel = new QLabel(comment, this); - m_commentLabel->setWordWrap(true); - m_commentLabel->setTextFormat(Qt::RichText); - m_commentLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop); - m_commentLabel->setFrameShape(QFrame::StyledPanel); - m_commentLabel->setFrameShadow(QFrame::Raised); - m_commentLabel->setHidden(true); - layout->addWidget(m_commentLabel, 1, 0, 1, -1); + setToolTip(comment); } - m_dragVal->setValue(value); - connect(m_dragVal, SIGNAL(valueChanged(double, bool)), this, SLOT(slotSetValue(double, bool))); + 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))); } DoubleParameterWidget::~DoubleParameterWidget() { delete m_dragVal; - if (m_commentLabel) delete m_commentLabel; } int DoubleParameterWidget::spinSize() @@ -105,13 +97,7 @@ void DoubleParameterWidget::setInTimelineProperty(bool intimeline) void DoubleParameterWidget::slotShowComment( bool show) { - if (m_commentLabel) { - m_commentLabel->setVisible(show); - if (show) - layout()->setContentsMargins(0, 0, 0, 15); - else - layout()->setContentsMargins(0, 0, 0, 0); - } + Q_UNUSED(show) } #include "doubleparameterwidget.moc"