mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Do not plot text twice for information.
Well, the information was bad, it was being printed twice if the text is HTML, print only once. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
94bcd2622a
commit
571755cc64
1 changed files with 8 additions and 3 deletions
|
@ -346,8 +346,7 @@ ProfilePrintDelegate::ProfilePrintDelegate(QObject *parent) : QStyledItemDelegat
|
|||
{
|
||||
}
|
||||
|
||||
/* this method overrides the default table drawing method and places grid lines only at certain rows and columns */
|
||||
void ProfilePrintDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
static void paintRect(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index)
|
||||
{
|
||||
const QRect rect(option.rect);
|
||||
const int row = index.row();
|
||||
|
@ -368,6 +367,12 @@ void ProfilePrintDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
|||
painter->drawLine(rect.topRight(), rect.bottomRight());
|
||||
}
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
/* this method overrides the default table drawing method and places grid lines only at certain rows and columns */
|
||||
void ProfilePrintDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
paintRect(painter, option, index);
|
||||
QStyledItemDelegate::paint(painter, option, index);
|
||||
}
|
||||
|
||||
|
@ -409,6 +414,7 @@ HTMLDelegate::HTMLDelegate(QObject *parent) : ProfilePrintDelegate(parent)
|
|||
|
||||
void HTMLDelegate::paint(QPainter* painter, const QStyleOptionViewItem & option, const QModelIndex &index) const
|
||||
{
|
||||
paintRect(painter, option, index);
|
||||
QStyleOptionViewItemV4 options = option;
|
||||
initStyleOption(&options, index);
|
||||
painter->save();
|
||||
|
@ -422,7 +428,6 @@ void HTMLDelegate::paint(QPainter* painter, const QStyleOptionViewItem & option,
|
|||
QRect clip(0, 0, options.rect.width(), options.rect.height());
|
||||
doc.drawContents(painter, clip);
|
||||
painter->restore();
|
||||
ProfilePrintDelegate::paint(painter,option,index);
|
||||
}
|
||||
|
||||
QSize HTMLDelegate::sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const
|
||||
|
|
Loading…
Reference in a new issue