Fix problem with black background in snapshot export

This commit is contained in:
Gaute Lindkvist
2020-01-08 14:52:28 +01:00
parent 3fc7378b8f
commit a58d854030
11 changed files with 44 additions and 27 deletions

View File

@@ -350,6 +350,7 @@ void RiuMultiPlotPage::renderTo( QPaintDevice* paintDevice )
void RiuMultiPlotPage::renderTo( QPainter* painter, double scalingFactor )
{
setSelectionsVisible( false );
painter->fillRect( painter->viewport(), Qt::white );
m_plotTitle->render( painter );
// Subtract margins because we are rendering into part inside the margins

View File

@@ -623,7 +623,6 @@ void RiuQwtPlotWidget::renderTo( QPainter* painter, const QRect& targetRect, dou
QPoint canvasBottomRightInWindowCoords = canvasBottomRightInPlotCoords + plotTopLeftInWindowCoords;
QwtPlotRenderer renderer( this );
renderer.setDiscardFlag( QwtPlotRenderer::DiscardBackground, true );
renderer.render( this, painter, targetRect );
static_cast<QwtPlotCanvas*>( this->canvas() )->setPaintAttribute( QwtPlotCanvas::BackingStore, true );