diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2014-08-02 01:08:19 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-08-04 07:43:42 -0700 |
commit | 6ebbc3d74e8f6e692df046ec3c679cac293a300b (patch) | |
tree | b626518823bf38729c6c3108d849b75fc09452ce | |
parent | 825eb019abf1ee7fb477a43f76da573a60fea188 (diff) | |
download | subsurface-6ebbc3d74e8f6e692df046ec3c679cac293a300b.tar.gz |
Print: enable the vector table print only for Qt5.0 and newer
In #671 a user reported that the table print outputs a blank page if there
are dives for one page or less to be printed.
This doesn't really makes any sense.
A possible bug in Qt4's QPicture is suspected, so we only enable the
vector print for Qt 5.0 and newer versions.
See #671
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/printlayout.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp index 7c0894db5..1d34a0633 100644 --- a/qt-ui/printlayout.cpp +++ b/qt-ui/printlayout.cpp @@ -419,6 +419,13 @@ void PrintLayout::printTable() for (i = 0; i < total; i++) { if (i > 0) printer->newPage(); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + (void)headingRowHeightD2; + QRegion region(0, pageIndexes.at(i) - 1, + table.width(), + pageIndexes.at(i + 1) - pageIndexes.at(i) + 1); + table.render(&painter, QPoint(0, 0), region); +#else QRegion region(0, pageIndexes.at(i) + headingRowHeightD2 - 1, table.width(), pageIndexes.at(i + 1) - (pageIndexes.at(i) + headingRowHeightD2) + 1); @@ -429,6 +436,7 @@ void PrintLayout::printTable() table.render(&picPainter, QPoint(0, 0), region); picPainter.end(); painter.drawPicture(QPoint(0, headingRowHeightD2), pic); +#endif progress++; emit signalProgress(done + (progress * 10) / total); } |