| 55 | } |
| 56 | |
| 57 | void drawSelectionRect(QPainter *painter, const QStyleOptionViewItem &option, |
| 58 | const QRect &rect) |
| 59 | { |
| 60 | if ((option.state & QStyle::State_Selected)) |
| 61 | painter->fillRect(rect, option.palette.brush(QPalette::Highlight)); |
| 62 | else |
| 63 | { |
| 64 | QColor backgroundColor = option.palette.color(QPalette::Background); |
| 65 | backgroundColor.setAlpha(160); |
| 66 | painter->fillRect(rect, QBrush(backgroundColor)); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | void drawFocusRect(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect) |
| 71 | { |