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
  • Loading branch information
nyalldawson committed Jul 30, 2018
1 parent a87a7b7 commit df05369
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Binary file not shown.
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 df05369

Please sign in to comment.