Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.3
-
None
-
863929f44 (dev), 381135d56 (6.7), f62b5daa5 (6.6), 65d96953a (tqtc/lts-6.5), 59b581701 (tqtc/lts-5.15)
Description
A bunch of warnings show up in the output when rendering an svg file containing <text> elements using either:
- QSvgRenderer::render, with a painter argument whose font size has been set using QFont::setPixelSize,
- QSvgWidget displaying the svg file, where the widget's font size is set in pixels for example by an application wide stylesheet,
- Other widgets capable of rendering svg such as a QToolButton with an svg icon set.
The warning is "QFont::setPixelSize: Pixel size <= 0 (-300)" and is shown whenever the widget etc. is repainted. It does not affect the actual visual output.
Reproducer cmake project attached, just need to set the svg file path to wherever you extract it to.
Issue appears to be in `QSvgText::precheck` when it calls `font.setPixelSize((100.0 / originalFontSize) * maxFontSize)`. If the painter's font size is set in pixels, `originalFontSize` is -1.
Attachments
Issue Links
- resulted in
-
QTBUG-128583 Regression in QtSvgTinyDocument: Runtime warnings logged to the console
- Closed
For Gerrit Dashboard: QTBUG-122752 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
546775,4 | Avoid runtime warnings about negative font sizes | dev | qt/qtsvg | Status: MERGED | +2 | 0 |
548758,2 | Avoid runtime warnings about negative font sizes | 6.7 | qt/qtsvg | Status: MERGED | +2 | 0 |
548938,3 | Avoid runtime warnings about negative font sizes | 6.6 | qt/qtsvg | Status: MERGED | +2 | 0 |
549264,2 | Avoid runtime warnings about negative font sizes | tqtc/lts-6.5 | qt/tqtc-qtsvg | Status: MERGED | +2 | 0 |
549423,2 | Avoid runtime warnings about negative font sizes | tqtc/lts-5.15 | qt/tqtc-qtsvg | Status: MERGED | +2 | 0 |