44 lines
827 B
C++
44 lines
827 B
C++
#ifndef BCValueEditor_H
|
|
#define BCValueEditor_H
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <bcvalue.h>
|
|
#include <ui_bcvalueeditor.h>
|
|
|
|
class QSlider;
|
|
class QPushButton;
|
|
class BCValue;
|
|
|
|
class BCValueEditor : public QWidget, private Ui::BCValueEditor
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit BCValueEditor(QWidget *parent = nullptr);
|
|
|
|
int value() const;
|
|
void setValueAndRange( const BCValue::ValueRange& params );
|
|
|
|
// helper functions
|
|
static QRect updateEditorRect( const QRect& rect);
|
|
static void paintSliderIndicator(QPainter* painter, const QRect& rect, double ratio );
|
|
|
|
|
|
signals:
|
|
|
|
void valueChanged(int value);
|
|
void valueCommited(int value);
|
|
|
|
protected:
|
|
|
|
static constexpr int cTextBlockOffset = 130;
|
|
static constexpr int cPaddingRight = 8;
|
|
static constexpr int cSliderWidth = 117;
|
|
|
|
};
|
|
|
|
#endif // BCValueEditor_H
|