summaryrefslogtreecommitdiff
path: root/vcl/qt5/Qt5Graphics_GDI.cxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-07-05 18:10:27 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2018-07-06 10:47:33 +0200
commitbd39726fe67cad9eb133daf4a8ab8c2b19dddfe1 (patch)
tree869349f7fd05d85986b2ffc4f05ad0580a1cb10c /vcl/qt5/Qt5Graphics_GDI.cxx
parent30bf6b73178a6cf793cddb9c646560808f5faba7 (diff)
Qt5 implement invert for blinking cursor
The different modes are quite probably not correctly implemented, as multiple backends disagree here. Change-Id: I08fc3096487ca95f4905ae9f0e4b5d3897fca483
Diffstat (limited to 'vcl/qt5/Qt5Graphics_GDI.cxx')
-rw-r--r--vcl/qt5/Qt5Graphics_GDI.cxx25
1 files changed, 23 insertions, 2 deletions
diff --git a/vcl/qt5/Qt5Graphics_GDI.cxx b/vcl/qt5/Qt5Graphics_GDI.cxx
index 08c620c11796..146849007035 100644
--- a/vcl/qt5/Qt5Graphics_GDI.cxx
+++ b/vcl/qt5/Qt5Graphics_GDI.cxx
@@ -444,9 +444,30 @@ std::shared_ptr<SalBitmap> Qt5Graphics::getBitmap(long nX, long nY, long nWidth,
Color Qt5Graphics::getPixel(long nX, long nY) { return m_pQImage->pixel(nX, nY); }
-void Qt5Graphics::invert(long /*nX*/, long /*nY*/, long /*nWidth*/, long /*nHeight*/,
- SalInvert /*nFlags*/)
+void Qt5Graphics::invert(long nX, long nY, long nWidth, long nHeight, SalInvert nFlags)
{
+ Qt5Painter aPainter(*this);
+ if (SalInvert::N50 & nFlags)
+ {
+ aPainter.setCompositionMode(QPainter::RasterOp_SourceXorDestination);
+ aPainter.setBrush(Qt::DiagCrossPattern);
+ aPainter.fillRect(nX, nY, nWidth, nHeight, aPainter.brush());
+ }
+ else
+ {
+ if (SalInvert::TrackFrame & nFlags)
+ {
+ aPainter.setCompositionMode(QPainter::RasterOp_SourceXorDestination);
+ aPainter.setPen(Qt::DashLine);
+ aPainter.drawRect(nX, nY, nWidth, nHeight);
+ }
+ else
+ {
+ aPainter.setCompositionMode(QPainter::RasterOp_SourceXorDestination);
+ aPainter.fillRect(nX, nY, nWidth, nHeight, Qt::white);
+ }
+ }
+ aPainter.update(nX, nY, nWidth, nHeight);
}
void Qt5Graphics::invert(sal_uInt32 /*nPoints*/, const SalPoint* /*pPtAry*/, SalInvert /*nFlags*/)