AppFwk : Make sure painter->save always matches painter->restore

This commit is contained in:
Magne Sjaastad 2019-11-06 10:36:05 +01:00
parent c090992342
commit be1781fd3b

View File

@ -512,12 +512,13 @@ void PdmUiTreeViewItemDelegate::paint(QPainter *painter, const QStyleOptionViewI
{
QStyledItemDelegate::paint(painter, option, index);
// Save painter so we can restore it
painter->save();
auto it = m_attributes.find(index);
if (it == m_attributes.end()) return;
// Save painter so we can restore it
painter->save();
const int insideTopBottomMargins = 1;
const int insideleftRightMargins = 6;
const int outsideLeftRightMargins = 4;