From 5adaa8d868b6718e07035152351b14449cea95d3 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Fri, 20 May 2022 16:47:42 +0200 Subject: Add painter render hint for brush pattern transformation [ChangeLog][QtGui][QPainter] In Qt 5, the predefined brush patterns would always be transformed along with the object being painted. In Qt 6.0 onwards, they would or would not, depending on the SmoothPixmapTransformation render hint. Instead of this somewhat surprising behavior, make the default be untransformed (i.e. cosmetic), which makes sense when it comes to dpr scaling. For the cases where one wants scaling, a new render hint is introduced to enable that: NonCosmeticPatternBrushes. Change-Id: I2208c7a28af9056d7ab97a529b66bf2d502c3c4f Reviewed-by: Allan Sandfeld Jensen --- src/gui/image/qpicture.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui/image') diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp index 3f4dec37d5..da8c5ef1e5 100644 --- a/src/gui/image/qpicture.cpp +++ b/src/gui/image/qpicture.cpp @@ -814,6 +814,8 @@ bool QPicture::exec(QPainter *painter, QDataStream &s, int nrecords) bool(ul & QPainter::Antialiasing)); painter->setRenderHint(QPainter::SmoothPixmapTransform, bool(ul & QPainter::SmoothPixmapTransform)); + painter->setRenderHint(QPainter::NonCosmeticBrushPatterns, + bool(ul & QPainter::NonCosmeticBrushPatterns)); break; case QPicturePrivate::PdcSetCompositionMode: s >> ul; -- cgit v1.2.3