Hi,
title says it all, I want to draw the checkmark with a colored background in the paint function of a custom delegate derived from QSytledItemDelegate. So far I tried
focusrectOption.rect = layerRect;
focusrectOption.
backgroundColor = QColor(151,
165,
255);
QApplication::style()->drawPrimitive
(QStyle::PE_IndicatorCheckBox,
&focusrectOption, painter
);
QStyleOptionFocusRect focusrectOption;
focusrectOption.rect = layerRect;
focusrectOption.backgroundColor = QColor(151,165,255);
QApplication::style()->drawPrimitive(QStyle::PE_IndicatorCheckBox, &focusrectOption, painter);
To copy to clipboard, switch view to plain text mode
and giving the QPainter a background color
QApplication::style()->drawPrimitive
(QStyle::PE_IndicatorCheckBox,
&checkBoxOption, painter
);
painter->setBackground(QBrush(QColor(151,165,255)));
QApplication::style()->drawPrimitive(QStyle::PE_IndicatorCheckBox, &checkBoxOption, painter);
To copy to clipboard, switch view to plain text mode
but it just doesnt draw anything. Any idea how to achieve this without having to draw the checkmark myself with lines?
Bookmarks