summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-07-17 22:01:11 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-18 10:14:57 -0700
commit571755cc6472007cf0099a65e265b4c1cf1afde3 (patch)
tree4db8965ed36294c6f6a53de66f83cd30caa3323c /qt-ui
parent94bcd2622a386172ea1150e16cf4628eb78a3760 (diff)
downloadsubsurface-571755cc6472007cf0099a65e265b4c1cf1afde3.tar.gz
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>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/modeldelegates.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp
index 3fb8bea40..a2c61e2f6 100644
--- a/qt-ui/modeldelegates.cpp
+++ b/qt-ui/modeldelegates.cpp
@@ -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