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:
Orgad Shaneh
2013-12-02 23:28:21 +02:00
committed by Orgad Shaneh
parent a5375cbe32
commit 2d415c8228
2 changed files with 3 additions and 6 deletions

View File

@@ -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);
}
};