diff options
author | Axel Spoerl <axel.spoerl@qt.io> | 2024-04-26 08:27:10 +0000 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2024-04-26 19:26:06 +0200 |
commit | 35309856201dea2f14e53468a3c39a777c062729 (patch) | |
tree | 7c29d3adb5e034e4c526033b6ef0e3ade958e0a5 /src | |
parent | 94e83aa7d7d05cf0b6636bdfac5cdcb38706aa73 (diff) |
Revert "QCommonStyle: paint arrows with anti-aliasing"
This reverts commit 74e8f673b827c57ebf2bf802840c19e4a1ac848b.
Reason for revert: the change as is makes the rendering of arrows in the
styles unpleasantly blurry.
Pick-to: 6.7
Change-Id: I59ccd7373631a550276465caffb7d3074ff5893c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 418a0c2c5f..6ff85e2c1b 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -761,11 +761,11 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q % HexString<uint>(pe), opt, QSize(size, size), dpr); if (!QPixmapCache::find(pixmapName, &pixmap)) { - const qreal border = size / 5.; - const qreal sqsize = size; - pixmap = styleCachePixmap(QSize(size, size), dpr); + const qreal border = dpr * (size / 5.); + const qreal sqsize = dpr * size; + pixmap = QPixmap(QSize(size, size)); + pixmap.fill(Qt::transparent); QPainter imagePainter(&pixmap); - imagePainter.setRenderHint(QPainter::Antialiasing); QPolygonF poly; switch (pe) { @@ -812,6 +812,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q imagePainter.drawPolygon(poly); imagePainter.end(); + pixmap.setDevicePixelRatio(dpr); QPixmapCache::insert(pixmapName, pixmap); } int xOffset = r.x() + (r.width() - size)/2; |