2026-01-11 11:37:52 +01:00
|
|
|
#ifndef BCValueEditor_H
|
|
|
|
|
#define BCValueEditor_H
|
|
|
|
|
|
2026-01-10 22:18:54 +01:00
|
|
|
|
|
|
|
|
#include <QWidget>
|
2026-01-22 22:16:19 +01:00
|
|
|
|
|
|
|
|
#include <bcvalue.h>
|
2026-01-11 11:37:52 +01:00
|
|
|
#include <ui_bcvalueeditor.h>
|
2026-01-10 22:18:54 +01:00
|
|
|
|
|
|
|
|
class QSlider;
|
|
|
|
|
class QPushButton;
|
|
|
|
|
class BCValue;
|
|
|
|
|
|
2026-01-11 11:37:52 +01:00
|
|
|
class BCValueEditor : public QWidget, private Ui::BCValueEditor
|
2026-01-10 22:18:54 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2026-01-19 16:44:52 +01:00
|
|
|
explicit BCValueEditor(QWidget *parent = nullptr);
|
2026-01-10 22:18:54 +01:00
|
|
|
|
2026-01-21 17:07:00 +01:00
|
|
|
int value() const;
|
2026-01-22 22:16:19 +01:00
|
|
|
void setValueAndRange( const BCValue::ValueRange& params );
|
|
|
|
|
|
|
|
|
|
// helper functions
|
|
|
|
|
static QRect updateEditorRect( const QRect& rect);
|
|
|
|
|
static void paintSliderIndicator(QPainter* painter, const QRect& rect, double ratio );
|
|
|
|
|
|
2026-01-10 22:18:54 +01:00
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
|
|
void valueChanged(int value);
|
2026-01-18 18:52:30 +01:00
|
|
|
void valueCommited(int value);
|
2026-01-10 22:18:54 +01:00
|
|
|
|
2026-01-22 22:16:19 +01:00
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
static constexpr int cTextBlockOffset = 130;
|
|
|
|
|
static constexpr int cPaddingRight = 8;
|
|
|
|
|
static constexpr int cSliderWidth = 117;
|
|
|
|
|
|
2026-01-10 22:18:54 +01:00
|
|
|
};
|
2026-01-21 17:07:00 +01:00
|
|
|
|
2026-01-11 11:37:52 +01:00
|
|
|
#endif // BCValueEditor_H
|