mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
825eb019ab
commit
6ebbc3d74e
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue