QStyledItemDelegate Conflicting With 'QTableView' Stylesheet
-
In the above image you can see that the QStyledItemDelegate is having the default stylesheet when the item is selected, on focus or on hovering it is not following the QTableView Stylesheet but if i select the the cell which is QStyledItemDelegate everything is fine. The first cell is QStyledItemDelegate.
my QTableView is set on "setSelectionBehavior(QAbstractItemView::SelectRows);" and i am painting the icon and text myself inside paintEvent of QStyledItemDelegate
-
You should call QStyledItemDelegate::paint function inside yours QStyledItemDelegate derived class before painting of icons and text:
void IconsRenderItemDelegate::paint(QPainter *painter,
const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QStyledItemDelegate::paint(painter, options, index);// Draw somethig
}