The comment is available as a tooltip.
See: http://kdenlive.org/mantis/view.php?id=1939
svn path=/trunk/kdenlive/; revision=5193
<parameter type="simplekeyframe" name="Spatial" default="40" min="0" max="1000" factor="1000">
<name>Spatial</name>
+ <comment>Amount of spatial filtering</comment>
</parameter>
<parameter type="simplekeyframe" name="Temporal" default="60" min="0" max="1000" factor="1000">
<name>Temporal</name>
+ <comment>Amount of temporal filtering</comment>
</parameter>
</effect>
#include <KLocalizedString>
-DoubleParameterWidget::DoubleParameterWidget(const QString &name, int value, int min, int max, int defaultValue, const QString suffix, QWidget *parent) :
+DoubleParameterWidget::DoubleParameterWidget(const QString &name, int value, int min, int max, int defaultValue, const QString &comment, const QString suffix, QWidget *parent) :
QWidget(parent),
m_default(defaultValue)
{
+ setToolTip(comment);
+
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
* @param min Minimum value
* @param max maximum value
* @param defaultValue Value used when using reset functionality
+ * @param comment A comment explaining the parameter. Will be shown for the tooltip.
* @param suffix (optional) Suffix to display in spinbox
* @param parent (optional) Parent Widget */
- DoubleParameterWidget(const QString &name, int value, int min, int max, int defaultValue, const QString suffix = QString(), QWidget* parent = 0);
+ DoubleParameterWidget(const QString &name, int value, int min, int max, int defaultValue, const QString &comment, const QString suffix = QString(), QWidget* parent = 0);
/** @brief Updates the label to display @param name. */
void setName(const QString &name);
/** @brief Gets the parameter's value. */
for (int i = 0; i < namenode.count() ; i++) {
QDomElement pa = namenode.item(i).toElement();
QDomNode na = pa.firstChildElement("name");
+ QDomNode commentNode = pa.firstChildElement("comment");
QString type = pa.attribute("type");
QString paramName = i18n(na.toElement().text().toUtf8().data());
+ QString comment;
+ if (!commentNode.isNull())
+ comment = i18n(commentNode.toElement().text().toUtf8().data());
QWidget * toFillin = new QWidget(m_baseWidget);
QString value = pa.attribute("value").isNull() ?
pa.attribute("default") : pa.attribute("value");
max = pa.attribute("max").toInt();
DoubleParameterWidget *doubleparam = new DoubleParameterWidget(paramName, (int)(value.toDouble() + 0.5), min, max,
- pa.attribute("default").toInt(), pa.attribute("suffix"), this);
+ pa.attribute("default").toInt(), comment, pa.attribute("suffix"), this);
m_vbox->addWidget(doubleparam);
m_valueItems[paramName] = doubleparam;
connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(collectAllParameters()));
{
keyframe_list->blockSignals(true);
m_params.append(e.cloneNode().toElement());
+
QDomNode na = e.firstChildElement("name");
QString paramName = i18n(na.toElement().text().toUtf8().data());
+ QDomNode commentNode = e.firstChildElement("comment");
+ QString comment;
+ if (!commentNode.isNull())
+ comment = i18n(commentNode.toElement().text().toUtf8().data());
+
int columnId = keyframe_list->columnCount();
keyframe_list->insertColumn(columnId);
keyframe_list->setHorizontalHeaderItem(columnId, new QTableWidgetItem(paramName));
DoubleParameterWidget *doubleparam = new DoubleParameterWidget(paramName, 0,
m_params.at(columnId).attribute("min").toInt(), m_params.at(columnId).attribute("max").toInt(),
- m_params.at(columnId).attribute("default").toInt(), m_params.at(columnId).attribute("suffix"), this);
+ m_params.at(columnId).attribute("default").toInt(), comment, m_params.at(columnId).attribute("suffix"), this);
connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustKeyframeValue(int)));
m_slidersLayout->addWidget(doubleparam, columnId, 0);