Commit 2d415c82 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Git: Use initStyleOption instead of setting options in paint

Change-Id: Idc14c157478c7092fce7d688044cb0a99e47bebe
Reviewed-by: default avatarStephen Kelly <stephen.kelly@kdab.com>
parent a5375cbe
...@@ -807,12 +807,11 @@ class ResetItemDelegate : public LogItemDelegate ...@@ -807,12 +807,11 @@ class ResetItemDelegate : public LogItemDelegate
{ {
public: public:
ResetItemDelegate(LogChangeWidget *widget) : LogItemDelegate(widget) {} 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()) if (index.row() < currentRow())
o.font.setStrikeOut(true); option->font.setStrikeOut(true);
QStyledItemDelegate::paint(painter, o, index); LogItemDelegate::initStyleOption(option, index);
} }
}; };
......
...@@ -102,8 +102,6 @@ protected: ...@@ -102,8 +102,6 @@ protected:
LogItemDelegate(LogChangeWidget *widget); LogItemDelegate(LogChangeWidget *widget);
int currentRow() const; int currentRow() const;
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const = 0;
private: private:
LogChangeWidget *m_widget; LogChangeWidget *m_widget;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment