mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-11 03:21:29 +00:00
printing: use independent profile instance for printing plan
In analogy to normal printing, don't misuse the mainwindow's profile widget to do the printing. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
956a6d6c68
commit
811c8a441e
1 changed files with 6 additions and 4 deletions
|
@ -609,13 +609,15 @@ void PlannerWidgets::printDecoPlan()
|
||||||
painter.setRenderHint(QPainter::Antialiasing);
|
painter.setRenderHint(QPainter::Antialiasing);
|
||||||
painter.setRenderHint(QPainter::SmoothPixmapTransform);
|
painter.setRenderHint(QPainter::SmoothPixmapTransform);
|
||||||
|
|
||||||
ProfileWidget2 *profile = MainWindow::instance()->graphics;
|
// TODO: Annoyingly, this still needs a parent window? Otherwise,
|
||||||
QSize origSize = profile->size();
|
// the profile is shown as its own window, when calling show() below.
|
||||||
|
auto profile = std::make_unique<ProfileWidget2>(DivePlannerPointsModel::instance(), MainWindow::instance());
|
||||||
|
profile->show(); // Ominous: if the scene isn't shown, parts of the plot are missing. Needs investigation.
|
||||||
profile->resize(renderSize.toSize());
|
profile->resize(renderSize.toSize());
|
||||||
|
profile->setPlanState(&displayed_dive, 0);
|
||||||
|
profile->plotDive(&displayed_dive, 0, true, true);
|
||||||
profile->setPrintMode(true);
|
profile->setPrintMode(true);
|
||||||
profile->render(&painter);
|
profile->render(&painter);
|
||||||
profile->resize(origSize);
|
|
||||||
profile->setPrintMode(false);
|
|
||||||
|
|
||||||
QByteArray byteArray;
|
QByteArray byteArray;
|
||||||
QBuffer buffer(&byteArray);
|
QBuffer buffer(&byteArray);
|
||||||
|
|
Loading…
Reference in a new issue