summaryrefslogtreecommitdiff
path: root/vcl/qt5/Qt5Graphics.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/qt5/Qt5Graphics.cxx')
-rw-r--r--vcl/qt5/Qt5Graphics.cxx26
1 files changed, 5 insertions, 21 deletions
diff --git a/vcl/qt5/Qt5Graphics.cxx b/vcl/qt5/Qt5Graphics.cxx
index c769b4e13795..c89747f98869 100644
--- a/vcl/qt5/Qt5Graphics.cxx
+++ b/vcl/qt5/Qt5Graphics.cxx
@@ -32,14 +32,10 @@
Qt5Graphics::Qt5Graphics( Qt5Frame *pFrame, QImage *pQImage )
: m_pFrame( pFrame )
- , m_pQImage( pQImage )
- , m_aLineColor( 0x00, 0x00, 0x00 )
- , m_aFillColor( 0xFF, 0xFF, 0XFF )
- , m_eCompositionMode( QPainter::CompositionMode_SourceOver )
, m_pTextStyle{ nullptr, }
, m_aTextColor( 0x00, 0x00, 0x00 )
{
- ResetClipRegion();
+ m_pBackend = std::make_unique<Qt5GraphicsBackend>(m_pFrame, pQImage);
if (!initWidgetDrawBackends(false))
{
@@ -54,26 +50,14 @@ Qt5Graphics::~Qt5Graphics() { ReleaseFonts(); }
void Qt5Graphics::ChangeQImage(QImage* pQImage)
{
- m_pQImage = pQImage;
- ResetClipRegion();
+ m_pBackend->setQImage(pQImage);
+ m_pBackend->ResetClipRegion();
}
-SalGraphicsImpl* Qt5Graphics::GetImpl() const { return nullptr; }
+SalGraphicsImpl* Qt5Graphics::GetImpl() const { return m_pBackend.get(); }
SystemGraphicsData Qt5Graphics::GetGraphicsData() const { return SystemGraphicsData(); }
-bool Qt5Graphics::supportsOperation(OutDevSupportType eType) const
-{
- switch (eType)
- {
- case OutDevSupportType::B2DDraw:
- case OutDevSupportType::TransparentRect:
- return true;
- default:
- return false;
- }
-}
-
#if ENABLE_CAIRO_CANVAS
bool Qt5Graphics::SupportsCairo() const { return false; }
@@ -114,7 +98,7 @@ void Qt5Graphics::handleDamage(const tools::Rectangle& rDamagedRegion)
QImage* pImage = static_cast<Qt5Graphics_Controls*>(m_pWidgetDraw.get())->getImage();
QImage blit(*pImage);
blit.setDevicePixelRatio(1);
- Qt5Painter aPainter(*this);
+ Qt5Painter aPainter(*m_pBackend);
aPainter.drawImage(QPoint(rDamagedRegion.getX(), rDamagedRegion.getY()), blit);
aPainter.update(toQRect(rDamagedRegion));
}