Details
-
Suggestion
-
Resolution: Done
-
Not Evaluated
-
4.8.x, 5.9.0
-
None
-
c0c4be672bd652d29a5c8f52e31ad76a1361e320 (qt/qtbase/dev)
Description
The classes QTextLayout, QFontMetrics, QFontMetricsF and QFont each offer a constructor where you can provide a pointer to a QPaintDevice. In the end, all they ever do is read the dpi settings from the paint device.
When writing code that performs layout calculations, e.g. for printing, you are forced to keep a lot of methods non-const for the sole reason that the paint device is required as a non-const parameter. Using const_cast is possible, but ugly (triggers warnings in static code analysis, etc.)
Suggestion: Make these QPaintDevice constructor parameters const
Attachments
Issue Links
- is duplicated by
-
QTBUG-55037 QFontMetrics constructor should use a const pointer to paintdevice
-
- Closed
-