1 /***************************************************************************
2 * Copyright (C) 2010 by Till Theato (root@ttill.de) *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
21 #ifndef DOUBLEPARAMETERWIDGET_H
22 #define DOUBLEPARAMETERWIDGET_H
32 * @class DoubleParameterWidget
33 * @brief Widget to choose a double parameter (for a effect) with the help of a slider and a spinbox.
36 * The widget does only handle integers, so the parameter has to be converted into the proper double range afterwards.
39 class DoubleParameterWidget : public QWidget
43 /** @brief Sets up the parameter's GUI.
44 * @param name Name of the parameter
45 * @param value Value of the parameter
46 * @param min Minimum value
47 * @param max maximum value
48 * @param defaultValue Value used when using reset functionality
49 * @param comment A comment explaining the parameter. Will be shown for the tooltip.
50 * @param suffix (optional) Suffix to display in spinbox
51 * @param parent (optional) Parent Widget */
52 DoubleParameterWidget(const QString &name, int value, int min, int max, int defaultValue, const QString &comment, const QString suffix = QString(), QWidget* parent = 0);
54 /** @brief Updates the label to display @param name. */
55 void setName(const QString &name);
57 /** @brief Gets the parameter's value. */
61 /** @brief Sets the value to @param value. */
62 void setValue(int value);
64 /** @brief Sets value to m_default. */
68 /** @brief Shows/Hides the comment label. */
69 void slotShowComment(bool show);
71 void slotSetValue(qreal value, bool final);
79 QLabel *m_commentLabel;
82 void valueChanged(int);