diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-07-11 20:22:19 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-11 17:01:59 -0700 |
commit | 8cd4a5f3d1109cb1ded07f35556a77089350fe41 (patch) | |
tree | 060226c38fb75967a3269b587dc6e9742d0044c2 /qt-ui | |
parent | e18f4dfdeecfb8fdc3cf7bcb7168d84613d4fc7b (diff) | |
download | subsurface-8cd4a5f3d1109cb1ded07f35556a77089350fe41.tar.gz |
Render the table print in curves.
We can use QPicture to record the painting done by a QPainter and it will
be saved in vector format, then we can simply paint that.
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/printlayout.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp index 8327105ba..159cd04db 100644 --- a/qt-ui/printlayout.cpp +++ b/qt-ui/printlayout.cpp @@ -6,6 +6,8 @@ #include <QTableView> #include <QHeaderView> #include <QPointer> +#include <QPicture> + #include "mainwindow.h" #include "../dive.h" #include "../display.h" @@ -136,6 +138,9 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn) painter.setRenderHint(QPainter::SmoothPixmapTransform); painter.scale(scaleX, scaleY); + QPicture pic; + QPainter picPainter; + // setup the profile widget QPointer<ProfileWidget2> profile = MainWindow::instance()->graphics(); const int profileFrameStyle = profile->frameStyle(); @@ -196,7 +201,10 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn) // draw a table painter.translate((scaledW + padW) * col, (scaledH + padH) * row + yOffsetTable); model.setDive(dive); - table->render(&painter); + picPainter.begin(&pic); + table->render(&picPainter); + picPainter.end(); + painter.drawPicture(QPoint(0,0), pic); painter.setTransform(origTransform); col++; printed++; |