Fill the home buttons' outlined text with the winding rule

The Home tab buttons draw their label as a QPainterPath: a black stroke,
then a white fill. Upstream #7539 (2026-11-04) moved the label from the
stylesheet's sans-serif/Helvetica Neue to the theme's InterfaceDefault
font, which on macOS is the system font, SF Pro. Its glyph outlines have
overlapping contours, and QPainterPath fills with Qt::OddEvenFill by
default, so every overlap stayed unfilled and showed the black stroke
underneath as dark notches inside the letters. The same symptom was
upstream issue 6490, fixed in January for the old font.

Qt::WindingFill fills overlapping contours. Checked on macOS with
Homebrew Qt 6.12: the notches are gone.
This commit is contained in:
Bruno Alexandre Rosa 2026-11-09 07:53:17 -03:00 • committed by RickyRister
parent 587c4b43c1
commit 9e98a6386d

View file

@ -118,6 +118,7 @@ void HomeStyledButton::paintEvent(QPaintEvent *event)
QPainterPath path; QPainterPath path;
path.addText(center, font(), text()); path.addText(center, font(), text());
path.setFillRule(Qt::WindingFill);
QPen pen(Qt::black, 4.0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); QPen pen(Qt::black, 4.0, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
painter.strokePath(path, pen); painter.strokePath(path, pen);