forked from qt-creator/qt-creator
Git: Use initStyleOption instead of setting options in paint
Change-Id: Idc14c157478c7092fce7d688044cb0a99e47bebe Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
a5375cbe32
commit
2d415c8228
@@ -807,12 +807,11 @@ class ResetItemDelegate : public LogItemDelegate
|
||||
{
|
||||
public:
|
||||
ResetItemDelegate(LogChangeWidget *widget) : LogItemDelegate(widget) {}
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const
|
||||
{
|
||||
QStyleOptionViewItem o = option;
|
||||
if (index.row() < currentRow())
|
||||
o.font.setStrikeOut(true);
|
||||
QStyledItemDelegate::paint(painter, o, index);
|
||||
option->font.setStrikeOut(true);
|
||||
LogItemDelegate::initStyleOption(option, index);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user