diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-07-17 21:06:12 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-18 10:14:27 -0700 |
commit | 7a70f15f9b3f71666e51f33f185541e0d3fb4cff (patch) | |
tree | d71e8712b9ad7e56a8803850c9ac01a8e0dc8582 | |
parent | 30499fdb30148edbf51c9f33964c18537badf148 (diff) | |
download | subsurface-7a70f15f9b3f71666e51f33f185541e0d3fb4cff.tar.gz |
Add the HTML Delegate to printing.
This patch just adds the HTML Delegate to print the text.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/modeldelegates.cpp | 4 | ||||
-rw-r--r-- | qt-ui/modeldelegates.h | 1 | ||||
-rw-r--r-- | qt-ui/printlayout.cpp | 3 |
3 files changed, 7 insertions, 1 deletions
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp index b11c4614d..3fb8bea40 100644 --- a/qt-ui/modeldelegates.cpp +++ b/qt-ui/modeldelegates.cpp @@ -403,6 +403,10 @@ QWidget *DoubleSpinBoxDelegate::createEditor(QWidget *parent, const QStyleOption return w; } +HTMLDelegate::HTMLDelegate(QObject *parent) : ProfilePrintDelegate(parent) +{ +} + void HTMLDelegate::paint(QPainter* painter, const QStyleOptionViewItem & option, const QModelIndex &index) const { QStyleOptionViewItemV4 options = option; diff --git a/qt-ui/modeldelegates.h b/qt-ui/modeldelegates.h index 88ea3f159..bc5dd3fcd 100644 --- a/qt-ui/modeldelegates.h +++ b/qt-ui/modeldelegates.h @@ -113,6 +113,7 @@ private: class HTMLDelegate : public ProfilePrintDelegate { Q_OBJECT public: + explicit HTMLDelegate(QObject *parent = 0); virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; }; diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp index 8b4d4ab45..384a0efd2 100644 --- a/qt-ui/printlayout.cpp +++ b/qt-ui/printlayout.cpp @@ -261,7 +261,6 @@ QTableView *PrintLayout::createProfileTable(ProfilePrintModel *model, const int // notes table->setSpan(6, 0, 1, 5); table->setSpan(7, 0, 5, 5); - /* resize row heights to the 'profilePrintRowHeights' indexes. * profilePrintTableMaxH will then hold the table height. */ int i; @@ -284,6 +283,8 @@ QTableView *PrintLayout::createProfileTable(ProfilePrintModel *model, const int table->resize(tableW, profilePrintTableMaxH); // hide the grid and set a stylesheet table->setItemDelegate(new ProfilePrintDelegate(table)); + table->setItemDelegateForRow(7, new HTMLDelegate(table)); + table->setShowGrid(false); table->setStyleSheet( "QTableView { border: none }" |