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:
Lubomir I. Ivanov 2014-08-02 01:08:19 +03:00 committed by Dirk Hohndel
parent 825eb019ab
commit 6ebbc3d74e

View file

@ -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);
}