Debug updates.

This commit is contained in:
Christoph Holzheuer
2026-01-08 14:55:47 +01:00
parent c40f288aaa
commit f19a33cc5f
14 changed files with 154 additions and 138 deletions

View File

@@ -202,13 +202,18 @@ void BCAnimatedDelegate::paint(QPainter *painter, const QStyleOptionViewItem& op
case 1:
if(_rowOpacities.contains(row))
paintHighlightRow(painter,option,index);
paintHighlightRow(painter,option,index.row());
break;
case 2:
if( row>-1 && row <= _valueList.size() )
paintSliderIndicator(painter,option,index);
{
const BCValue& bcValue = *(_valueList[ index.row()].get());
qDebug() << " --- paintSLider: " << bcValue.label << " type: " << (int)bcValue.valueType << " flags:" << bcValue.valueFlags.toInt() << " RO: " << bcValue.isReadOnly();
if( !bcValue.isReadOnly())
paintSliderIndicator(painter,option,bcValue);
}
default:
break;
@@ -216,35 +221,39 @@ void BCAnimatedDelegate::paint(QPainter *painter, const QStyleOptionViewItem& op
}
void BCAnimatedDelegate::paintHighlightRow(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
void BCAnimatedDelegate::paintHighlightRow(QPainter* painter, const QStyleOptionViewItem& option, int row) const
{
painter->save();
painter->setRenderHint(QPainter::Antialiasing);
int row = index.row();
qreal opacity =_rowOpacities.value(row);
painter->setOpacity(opacity);
// Margin von 4px
QRect itemRect = option.rect.adjusted(3, 3, -3, -3);
// Border (2px solid #2196F3)
QPen borderPen( Qt::red, 1);
// oranger rahmen
QPen borderPen( QColor(0xFF8C00), 1);
painter->setPen(borderPen);
painter->setBrush(Qt::NoBrush);
// highlight background
//QColor highlightColor = option.palette.highlight().color();
//highlightColor.setAlphaF(0.3); // 0.0 bis 1.0 (float ist oft lesbarer)
//painter->fillRect(option.rect, highlightColor);
painter->drawRoundedRect(itemRect, 2, 2);
painter->restore();
}
void BCAnimatedDelegate::paintSliderIndicator(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
void BCAnimatedDelegate::paintSliderIndicator(QPainter* painter, const QStyleOptionViewItem& option, const BCValue& bcValue) const
{
const BCValue& bcValue = *(_valueList[ index.row()].get());
qDebug() << " --- paintSLider: " << bcValue.label << ": " << (int)bcValue.valueType;
// wenn Werte readOnly sind, dann brauchen keinen EditHint
if( bcValue.flags.testFlag(BCValue::Flag::ReadOnly) )
//if( bcValue.valueFlags.testFlag(BCValue::Flag::ReadOnly) )
// || bcValue.valueType == BCValue::ValueType::Plain )
return;
// return;
// Hintergrund
if (option.state & QStyle::State_Selected)