Tor Arne Vestbø eeb0740f2e QTextHtmlParser: Handle fractional font-size pixel values
The CSS spec defines the font-size as being a length, which is a
combination of a real number and a unit. This applies to the 'px'
unit as well, so by treating px values as integers when parsing
we were failing to parse not only '12.5px' but also '12.0px'.

The code now uses QMetaType::fromType<qreal> but then sets the
resulting pixel type on the QFont as an integer, as QFont does
not support fractional pixel sizes.

Other code paths in the CSS parsing machinery use QString::toInt(),
either directly or via intValueHelper() or lengthValue(). The font
code path can potentially be ported over to these other APIs for
consistency, but to keep the patch simple this is left for a
follow-up.

Pick-to: 6.5 6.2 5.15
Change-Id: I972cfe0f3fa3c785efa18c7593d6a497ff28911c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 5731e3e185d3a69502b2bc4f1fee48c156b34c3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-13 12:08:27 +00:00
2024-02-29 15:35:57 +01:00
2024-07-12 01:42:29 +00:00
2024-02-02 15:23:02 +00:00
Description
Qt Base (Core, Gui, Widgets, Network, ...)
822 MiB
Languages
C++ 84.3%
HTML 4.9%
C 3.9%
CMake 3.6%
Objective-C++ 2%
Other 0.8%