Skip to content

Commit 388f9e2

Browse files
committedJul 31, 2018
Hack is still required, but maybe using non-deprecated api will help?
Sometimes qt is great, sometimes I want to punch it in it's silly little cute face (cherry-picked from df05369)
1 parent 44332c1 commit 388f9e2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎src/core/layout/qgslayoutexporter.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,8 +1108,11 @@ void QgsLayoutExporter::updatePrinterPageSize( QgsLayout *layout, QPrinter &prin
11081108
{
11091109
QgsLayoutSize pageSize = layout->pageCollection()->page( page )->sizeWithUnits();
11101110
QgsLayoutSize pageSizeMM = layout->renderContext().measurementConverter().convert( pageSize, QgsUnitTypes::LayoutMillimeters );
1111-
printer.setOrientation( layout->pageCollection()->page( page )->orientation() == QgsLayoutItemPage::Portrait ? QPrinter::Portrait : QPrinter::Landscape );
1112-
printer.setPaperSize( pageSizeMM.toQSizeF(), QPrinter::Millimeter );
1111+
1112+
QPageLayout pageLayout( QPageSize( pageSizeMM.toQSizeF(), QPageSize::Millimeter ),
1113+
QPageLayout::Portrait,
1114+
QMarginsF( 0, 0, 0, 0 ) );
1115+
printer.setPageLayout( pageLayout );
11131116
}
11141117

11151118
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

0 commit comments

Comments
 (0)
Please sign in to comment.