summaryrefslogtreecommitdiff
path: root/vcl/qt5/Qt5Graphics.cxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-10-30 20:19:45 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-11-06 12:05:32 +0100
commitc512af2bc6aea89b471c20927372c8769c8f866d (patch)
tree9a005a0cf854daa327a53cc6f4d9c46448d38153 /vcl/qt5/Qt5Graphics.cxx
parent1426437be0530a8ba5749c7e76c5ce0e9053af2f (diff)
QT5 always generate a QPainter
Change-Id: Ie8684cd4be56fb6d88d9643a6326307590115a80
Diffstat (limited to 'vcl/qt5/Qt5Graphics.cxx')
-rw-r--r--vcl/qt5/Qt5Graphics.cxx22
1 files changed, 14 insertions, 8 deletions
diff --git a/vcl/qt5/Qt5Graphics.cxx b/vcl/qt5/Qt5Graphics.cxx
index aebb486c2453..7c33c2781df4 100644
--- a/vcl/qt5/Qt5Graphics.cxx
+++ b/vcl/qt5/Qt5Graphics.cxx
@@ -53,25 +53,31 @@ Qt5Graphics::~Qt5Graphics()
delete m_pTextStyle[ i ];
}
-void Qt5Graphics::PreparePainter()
+void Qt5Graphics::PreparePainter( QPainter& rPainter, sal_uInt8 nTransparency )
{
- if ( m_pPainter.get() )
- return;
if ( m_pQImage )
- m_pPainter.reset( new QPainter( m_pQImage ) );
+ rPainter.begin( m_pQImage );
else
{
assert( dynamic_cast< QPaintDevice* >( m_pFrame->GetQWidget() ) );
- m_pPainter.reset( new QPainter( m_pFrame->GetQWidget() ) );
+ rPainter.begin( m_pFrame->GetQWidget() );
}
- if (!m_aClipRegion.isEmpty())
- m_pPainter->setClipRegion( m_aClipRegion );
+ rPainter.setClipRegion( m_aClipRegion );
+ if ( SALCOLOR_NONE != m_aLineColor )
+ {
+ QColor aColor = QColor::fromRgb( QRgb( m_aLineColor ) );
+ aColor.setAlpha( nTransparency );
+ rPainter.setPen( aColor );
+ }
+ else
+ rPainter.setPen( Qt::NoPen );
+ rPainter.setCompositionMode( m_eCompositionMode );
}
void Qt5Graphics::ChangeQImage( QImage *pQImage )
{
- m_pPainter.reset();
m_pQImage = pQImage;
+ ResetClipRegion();
}
SalGraphicsImpl* Qt5Graphics::GetImpl() const