Apply suggestion from @ZeldaZach

Co-authored-by: Zach H <zahalpern+github@gmail.com>
This commit is contained in:
BruebachL 2026-11-08 09:00:58 +01:00 • committed by GitHub
parent aa91cac408
commit 24c973483c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -85,9 +85,7 @@ void AltTableDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
}
if (index.column() == activeColumn) {
const QVariant activeData = index.data(Qt::UserRole);
const bool active =
activeData.isValid() ? activeData.toBool() : text.compare(QStringLiteral("yes"), Qt::CaseInsensitive) == 0;
const bool active = index.data(Qt::UserRole).toBool();
const QPalette::ColorRole tintRole = active ? QPalette::Highlight : QPalette::PlaceholderText;
if (!pill_painter::paint(painter, opt, tintRole, emphasisRole, text)) {
QStyledItemDelegate::paint(painter, opt, index);