Skip to content

Commit

Permalink
Hack is still required, but maybe using non-deprecated api will help?
Browse files Browse the repository at this point in the history
Sometimes qt is great, sometimes I want to punch it in it's silly
little cute face

(cherry-picked from df05369)
  • Loading branch information
nyalldawson committed Jul 31, 2018
1 parent 44332c1 commit 388f9e2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/layout/qgslayoutexporter.cpp
Expand Up @@ -1108,8 +1108,11 @@ void QgsLayoutExporter::updatePrinterPageSize( QgsLayout *layout, QPrinter &prin
{
QgsLayoutSize pageSize = layout->pageCollection()->page( page )->sizeWithUnits();
QgsLayoutSize pageSizeMM = layout->renderContext().measurementConverter().convert( pageSize, QgsUnitTypes::LayoutMillimeters );
printer.setOrientation( layout->pageCollection()->page( page )->orientation() == QgsLayoutItemPage::Portrait ? QPrinter::Portrait : QPrinter::Landscape );
printer.setPaperSize( pageSizeMM.toQSizeF(), QPrinter::Millimeter );

QPageLayout pageLayout( QPageSize( pageSizeMM.toQSizeF(), QPageSize::Millimeter ),
QPageLayout::Portrait,
QMarginsF( 0, 0, 0, 0 ) );
printer.setPageLayout( pageLayout );
}

QgsLayoutExporter::ExportResult QgsLayoutExporter::renderToLayeredSvg( const SvgExportSettings &settings, double width, double height, int page, QRectF bounds, const QString &filename, int svgLayerId, const QString &layerName, QDomDocument &svg, QDomNode &svgDocRoot, bool includeMetadata ) const
Expand Down

0 comments on commit 388f9e2

Please sign in to comment.