8 QAbstractItemDelegate(parent), rowHeight(_rowHeight), row(_row){}
11 const QModelIndex &index )
const
16 bool isStateSelected = option.state & QStyle::State_Selected;
17 bool isStateHovered = option.state & QStyle::State_MouseOver;
19 QRect selectedRect = option.rect;
20 selectedRect.setLeft(0);
21 painter->fillRect(selectedRect, this->
row->
rectColor(isStateHovered, isStateSelected));
23 painter->translate(option.rect.topLeft());
25 row->setStyleSheet(qobject_cast<QWidget*>(parent())->styleSheet());
26 this->row->
init(
row, index, isStateHovered, isStateSelected);
27 row->setAttribute(Qt::WA_DontShowOnScreen,
true);
28 row->setGeometry(option.rect);
29 row->resize(option.rect.width(),option.rect.height());
30 row->render(painter, QPoint(), QRegion(), QWidget::DrawChildren );
FurListRow * getRowFactory()
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
FurAbstractListItemDelegate(int _rowHeight, FurListRow<> *_row, QObject *parent=nullptr)
virtual void init(T, const QModelIndex &, bool isHovered, bool isSelected) const
virtual QColor rectColor(bool isHovered, bool isSelected)
virtual T createHolder(int)