mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 05:13:30 -07:00
- Fixed (workaround, maybe Qt's bug?) for transfers list background painting problem.
This commit is contained in:
parent
183544b959
commit
a5ac742c1f
4 changed files with 95 additions and 31 deletions
|
@ -72,10 +72,15 @@ class DLListDelegate: public QAbstractItemDelegate {
|
|||
}
|
||||
painter->fillRect(option.rect, option.palette.brush(cg, QPalette::Highlight));
|
||||
}else{
|
||||
value = index.data(Qt::BackgroundColorRole);
|
||||
if (value.isValid() && qvariant_cast<QColor>(value).isValid()){
|
||||
painter->fillRect(option.rect, qvariant_cast<QColor>(value));
|
||||
}
|
||||
painter->fillRect(option.rect, option.palette.brush(cg, QPalette::Base));
|
||||
// The following should work but is broken (retry with future versions of Qt)
|
||||
// QVariant value = index.data(Qt::BackgroundRole);
|
||||
// if (qVariantCanConvert<QBrush>(value)) {
|
||||
// QPointF oldBO = painter->brushOrigin();
|
||||
// painter->setBrushOrigin(option.rect.topLeft());
|
||||
// painter->fillRect(option.rect, qvariant_cast<QBrush>(value));
|
||||
// painter->setBrushOrigin(oldBO);
|
||||
// }
|
||||
}
|
||||
}
|
||||
switch(index.column()){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue