diff options
Diffstat (limited to 'qt-ui/modeldelegates.cpp')
-rw-r--r-- | qt-ui/modeldelegates.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index 87629bd1b..2adaaebc7 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -15,14 +15,16 @@ void StarWidgetsDelegate::paint(QPainter* painter, const QStyleOptionViewItem& o QVariant value = index.model()->data(index, Qt::DisplayRole); + if(option.state & QStyle::State_Selected) + painter->fillRect(option.rect, option.palette.highlight()); + else + painter->fillRect(option.rect, index.model()->data(index, Qt::BackgroundRole).value<QBrush>()); + if (!value.isValid()) return; int rating = value.toInt(); - if(option.state & QStyle::State_Selected) - painter->fillRect(option.rect, option.palette.highlight()); - painter->save(); painter->setRenderHint(QPainter::Antialiasing, true); |