X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fdragvalue.h;h=22e9916cf3b6a080691091ccd6b479ffb6ca11fe;hb=848304cd283eb5a6c13cecc57b696e91bb92f729;hp=53adb2b8b3e639c2785584eb463e2283807ef50f;hpb=6898a01de5854d00ebb724b4b77e3d59c0d2d9be;p=kdenlive diff --git a/src/dragvalue.h b/src/dragvalue.h index 53adb2b8..22e9916c 100644 --- a/src/dragvalue.h +++ b/src/dragvalue.h @@ -38,7 +38,7 @@ class CustomLabel : public QProgressBar { Q_OBJECT public: - CustomLabel(const QString &label, bool showSlider = true, int precision = 0, QWidget *parent = 0); + CustomLabel(const QString &label, bool showSlider = true, int range = 1000, QWidget *parent = 0); void setProgressValue(double value); void setStep(double step); @@ -54,10 +54,8 @@ private: QPoint m_dragStartPosition; QPoint m_dragLastPosition; bool m_dragMode; - double m_step; bool m_showSlider; - double m_precision; - double m_value; + double m_step; void slotValueInc(double factor = 1); void slotValueDec(double factor = 1); void setNewValue(double, bool); @@ -77,7 +75,18 @@ class DragValue : public QWidget Q_OBJECT public: - DragValue(const QString &label, double defaultValue, int decimals, int id, const QString suffix, bool showSlider = true, QWidget* parent = 0); + /** + * @brief Default constructor. + * @param label The label that will be displayed in the progress bar + * @param defaultValue The default value + * @param decimals The number of decimals for the parameter. 0 means it is an integer + * @param min The minimum value + * @param max The maximum value + * @param id Used to identify this widget. If this parameter is set, "Show in Timeline" will be available in context menu. + * @param suffix The suffix that will be displayed in the spinbox (for example '%') + * @param showSlider If disabled, user can still drag on the label but no progress bar is shown + */ + DragValue(const QString &label, double defaultValue, int decimals, double min = 0, double max = 100, int id = -1, const QString suffix = QString(), bool showSlider = true, QWidget* parent = 0); virtual ~DragValue(); /** @brief Returns the precision = number of decimals */ @@ -110,11 +119,11 @@ public: public slots: /** @brief Sets the value (forced to be in the valid range) and emits valueChanged. */ void setValue(double value, bool final = true); + void setValueFromProgress(double value, bool final); /** @brief Resets to default value */ void slotReset(); signals: - void valueChanged(int value, bool final = true); void valueChanged(double value, bool final = true); void inTimeline(int);