2021-11-18 14:58:01 +00:00
|
|
|
#ifndef DUST3D_APPLICATION_FLOAT_NUMBER_WIDGET_H_
|
|
|
|
#define DUST3D_APPLICATION_FLOAT_NUMBER_WIDGET_H_
|
|
|
|
|
2018-04-17 13:13:32 +00:00
|
|
|
#include <QToolButton>
|
|
|
|
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QLabel)
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QSlider)
|
|
|
|
|
2022-10-18 09:35:04 +00:00
|
|
|
class FloatNumberWidget : public QWidget {
|
2018-04-17 13:13:32 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-10-18 09:35:04 +00:00
|
|
|
explicit FloatNumberWidget(QWidget* parent = nullptr, bool singleLine = true);
|
2018-04-17 13:13:32 +00:00
|
|
|
void setRange(float min, float max);
|
|
|
|
float value() const;
|
2022-10-18 09:35:04 +00:00
|
|
|
void setItemName(const QString& name);
|
2020-10-18 05:03:15 +00:00
|
|
|
void setSliderFixedWidth(float width);
|
2018-04-17 13:13:32 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void increaseValue();
|
|
|
|
void descreaseValue();
|
|
|
|
void setValue(float value);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void valueChanged(float value);
|
2022-10-18 09:35:04 +00:00
|
|
|
|
2018-09-06 15:04:59 +00:00
|
|
|
private:
|
|
|
|
void updateValueLabel(float value);
|
2018-04-17 13:13:32 +00:00
|
|
|
|
|
|
|
private:
|
2022-10-18 09:35:04 +00:00
|
|
|
QLabel* m_label = nullptr;
|
|
|
|
QSlider* m_slider = nullptr;
|
2018-09-06 15:04:59 +00:00
|
|
|
QString m_itemName;
|
2018-04-17 13:13:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|