Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.2.1, 5.11.1
-
-
e823c351c6226765ccfe66e2ee93a2797dcc9721 (qt/qtbase/5.12)
Description
QFont QFont::resolve(const QFont &other) const
The above method neglects to set the returned font's resolve_mask to QFont::AllPropertiesResolved despite having resolved the font.
We found this while trying to work around an issue with font propagation down a widget hierarchy when one of the widgets in the middle of the hierarchy was set to use a stylesheet (and thus interrupted normal font propagation). We wrote a FontPropagator object event filter which maintains the propagation by trying to take the parent widget's font() and setting it to the child widget via QWidget::setFont. We discovered the parent font (which itself got set via normal propagation from its parent) had resolved_mask set to "0" due to this defect, which in turn cause an incorrect "resolve" attempt (and thus resolving to QApplication::font(), which is wrong) when calling QWidget::setFont() on the child.
Suggested fix is to always set "font.resolve_mask = QFont::AllPropertiesResolved;" following the call to "font.d->resolve(resolve_mask, other.d.data());". This resolved the issue on our end.
Attachments
Issue Links
- relates to
-
QTBUG-34133 Modifying a font in style delegate doesn't work when text is elided
-
- Closed
-