Skip to content

Use QFontMetricsF over QFontMetrics #6230

Closed

Description

@Nerixyz

We currently use QFontMetrics, but we should use QFontMetricsF instead as stated in the docs:

QFontMetrics functions calculate the size of characters and strings for a given font. The class is an integer-based version of QFontMetricsF and will round all numbers to the nearest integer. This means its results will be inaccurate for any font with fractional metrics. In most cases QFontMetricsF should be used instead.

This might be a bit tricky as we use integers for most things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions