Fixed slider painting, part II, before slider widget rewrite

This commit is contained in:
2026-03-29 20:40:31 +02:00
parent c8a088173f
commit 0389f98ba6
6 changed files with 29 additions and 27 deletions

View File

@@ -119,7 +119,7 @@ void BCValueDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, c
void BCValueDelegate::paint(QPainter *painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
{
// Standard-Zeichnen (Text, Hintergrund, Selection) durchführen
// Standard-Zeichnen (Text, Hintergrund, Selection) durchführen
QStyledItemDelegate::paint(painter, option, index);
int row = index.row();
@@ -143,10 +143,14 @@ void BCValueDelegate::paint(QPainter *painter, const QStyleOptionViewItem& optio
}
/**
* @brief Zeichnet der 'Sliderindicator', also den Anteil des Gesamtwerts als Fortschrittsbalken
*/
void BCValueDelegate::paintPlainSliderIndicator(QPainter* painter, const QRect& rect, double ratio )const
{
QRect sliderRect = BCValueSlider::updateEditorRect( rect );
qDebug() << " --- Paint SLIDER ";
QRect sliderRect = BCValueSlider::clipToSliderRect( rect );
BCValueSlider::paintSliderIndicator(painter, sliderRect, ratio );
}
@@ -181,8 +185,8 @@ void BCValueDelegate::paintHighlightRow(QPainter* painter, const QStyleOptionVie
void BCValueDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex& index) const
{
Q_UNUSED(index)
QRect sliderRect = BCValueSlider::updateEditorRect( option.rect );
QRect baseRect = option.rect.adjusted( 0,0,0 + BCValueSlider::cToolIconOffset, 0 );
QRect sliderRect = BCValueSlider::clipToSliderRect( baseRect );
editor->setGeometry(sliderRect); // Slider nur über Progress Bar
}