mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Change from QPainter to QPaintDevice in the API for PDF rendering
* This is to be able to use QPagedPaintDevice::nextPage in the Multi plot rendering.
This commit is contained in:
@@ -40,7 +40,6 @@
|
||||
#include <QFileInfo>
|
||||
#include <QMdiSubWindow>
|
||||
#include <QPageLayout>
|
||||
#include <QPainter>
|
||||
#include <QPdfWriter>
|
||||
|
||||
CAF_CMD_SOURCE_INIT( RicSnapshotViewToFileFeature, "RicSnapshotViewToFileFeature" );
|
||||
@@ -90,12 +89,11 @@ void RicSnapshotViewToFileFeature::savePlotPDFReportAs( const QString& fileName,
|
||||
pdfPrinter.setPageLayout( plot->pageLayout() );
|
||||
pdfPrinter.setCreator( QCoreApplication::applicationName() );
|
||||
pdfPrinter.setResolution( resolution );
|
||||
QPainter painter( &pdfPrinter );
|
||||
QRect widgetRect = plot->viewWidget()->contentsRect();
|
||||
QRect fullPageRect = pdfPrinter.pageLayout().fullRectPixels( resolution );
|
||||
QRect paintRect = pdfPrinter.pageLayout().paintRectPixels( resolution );
|
||||
QRect widgetRect = plot->viewWidget()->contentsRect();
|
||||
QRect fullPageRect = pdfPrinter.pageLayout().fullRectPixels( resolution );
|
||||
QRect paintRect = pdfPrinter.pageLayout().paintRectPixels( resolution );
|
||||
plot->viewWidget()->resize( paintRect.size() );
|
||||
plot->renderWindowContent( &painter );
|
||||
plot->renderWindowContent( &pdfPrinter );
|
||||
plot->viewWidget()->resize( widgetRect.size() );
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user