2021-11-18 14:58:01 +00:00
|
|
|
#ifndef DUST3D_APPLICATION_INT_NUMBER_WIDGET_H_
|
|
|
|
#define DUST3D_APPLICATION_INT_NUMBER_WIDGET_H_
|
|
|
|
|
2019-07-26 01:20:32 +00:00
|
|
|
#include <QToolButton>
|
|
|
|
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QLabel)
|
|
|
|
QT_FORWARD_DECLARE_CLASS(QSlider)
|
|
|
|
|
2022-10-18 09:35:04 +00:00
|
|
|
class IntNumberWidget : public QWidget {
|
2019-07-26 01:20:32 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2022-10-18 09:35:04 +00:00
|
|
|
explicit IntNumberWidget(QWidget* parent = nullptr, bool singleLine = true);
|
2019-07-26 01:20:32 +00:00
|
|
|
void setRange(int min, int max);
|
|
|
|
int value() const;
|
2022-10-18 09:35:04 +00:00
|
|
|
void setItemName(const QString& name);
|
2019-07-26 01:20:32 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void increaseValue();
|
|
|
|
void descreaseValue();
|
|
|
|
void setValue(int value);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void valueChanged(int value);
|
2022-10-18 09:35:04 +00:00
|
|
|
|
2019-07-26 01:20:32 +00:00
|
|
|
private:
|
|
|
|
void updateValueLabel(int value);
|
|
|
|
|
|
|
|
private:
|
2022-10-18 09:35:04 +00:00
|
|
|
QLabel* m_label = nullptr;
|
|
|
|
QSlider* m_slider = nullptr;
|
2019-07-26 01:20:32 +00:00
|
|
|
QString m_itemName;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|