Skip to content
Permalink
Browse files

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)
  • Loading branch information
nyalldawson committed Jul 30, 2018
1 parent 44332c1 commit 388f9e204c06dcb0b68fdd80d08ae0b2993e6d30
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/core/layout/qgslayoutexporter.cpp
@@ -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

0 comments on commit 388f9e2

Please sign in to comment.
You can’t perform that action at this time.