Created new painter bug.

This commit is contained in:
2026-01-22 22:16:19 +01:00
parent ab4abd214e
commit 37fcc5e888
8 changed files with 110 additions and 150 deletions

View File

@@ -3,19 +3,14 @@
#include <QWidget>
#include <bcvalue.h>
#include <ui_bcvalueeditor.h>
class QSlider;
class QPushButton;
class BCValue;
struct BCValueEditorParams
{
int value{0};
int min{0};
int max{0};
};
class BCValueEditor : public QWidget, private Ui::BCValueEditor
{
Q_OBJECT
@@ -25,13 +20,24 @@ public:
explicit BCValueEditor(QWidget *parent = nullptr);
int value() const;
void setValueAndRange( const BCValueEditorParams& params );
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