Save / Restore the QPainter before operations.

I don't know if this fixes anything, but it is asked of us to
do that by the Qt docs.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-07-17 20:18:14 -03:00 committed by Dirk Hohndel
parent 774a785a99
commit d3c0a723b8
2 changed files with 12 additions and 0 deletions

View file

@ -353,6 +353,7 @@ void ProfilePrintDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
const int row = index.row();
const int col = index.column();
painter->save();
// grid color
painter->setPen(QPen(QColor(0xff999999)));
// horizontal lines
@ -366,6 +367,7 @@ void ProfilePrintDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
if (col == 4 || (col == 0 && row > 5))
painter->drawLine(rect.topRight(), rect.bottomRight());
}
painter->restore();
QStyledItemDelegate::paint(painter, option, index);
}