71 const QRect filling =
m_d->fillingRect();
72 const QColor backgroundColor =
palette().color(QPalette::Base);
78 QStyleOptionViewItem option;
79 const int gridHint = style()->styleHint(QStyle::SH_Table_GridLineColor, &option,
this);
80 const QColor gridColor =
static_cast<QRgb>(gridHint);
81 const QPen gridPen(gridColor);
84 p.setBrush(backgroundColor);
92 if (isChecked() || hasFocus() ||
m_d->isHovering) {
93 p.setPen(hasFocus() ||
m_d->isHovering ? frameColor : Qt::transparent);
94 p.setBrush(isChecked() ? fillColor : Qt::transparent);
99 QString textValue = text();
102 QPalette::ColorRole textRole = QPalette::Text;
106 shadowRect.translate(1,1);
107 QColor textColor =
palette().color(textRole);
108 QColor shadowColor = (textColor.value() <= 128)
109 ? QColor(255,255,255,160) : QColor(0,0,0,160);
111 int flags = Qt::AlignCenter | Qt::TextHideMnemonic;
113 p.setPen(shadowColor);
114 p.drawText(shadowRect, flags, textValue);
117 p.drawText(
bounds, flags, textValue);