{
QRect r
= rect.
adjusted(0,
-5,
50,
5);
painter->fillRect(r, brush);
r = rect.adjusted(20, -5, 25, 0);
if (state == Qt::Checked)
painter
->drawPixmap
(r,
QPixmap("check-icon.png"));
/*else
painter->drawPixmap(r, QPixmap());*/
}
void CheckboxDelegate::drawCheck(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, Qt::CheckState state) const
{
QBrush brush(QColor(19, 19, 70));
QRect r = rect.adjusted(0, -5, 50, 5);
painter->fillRect(r, brush);
r = rect.adjusted(20, -5, 25, 0);
if (state == Qt::Checked)
painter->drawPixmap(r, QPixmap("check-icon.png"));
/*else
painter->drawPixmap(r, QPixmap());*/
}
To copy to clipboard, switch view to plain text mode
Bookmarks