Skip to content
Snippets Groups Projects
Commit 2d415c82 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Git: Use initStyleOption instead of setting options in paint


Change-Id: Idc14c157478c7092fce7d688044cb0a99e47bebe
Reviewed-by: default avatarStephen Kelly <stephen.kelly@kdab.com>
parent a5375cbe
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
};
......
......@@ -102,8 +102,6 @@ protected:
LogItemDelegate(LogChangeWidget *widget);
int currentRow() const;
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const = 0;
private:
LogChangeWidget *m_widget;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment