Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved QPainter FontMetrics returns different values on the same Graphics view and scene

    General and Desktop
    1
    1
    67
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • faiszalkhan
      faiszalkhan last edited by

      I have two graphics rect items drawn on the same graphics scene and graphics view. I am rendering text on the rect items for which I take font metrics from the painter to calculate text width and height.

      As per observation for other graphics items, the value of painter->fontMetrics->height() and painter->fontMetrics->averageCharWidth() increases in value when moving a screen of low dpi to high dpi.

      What could be the issue that painter->fontMetrics() is different for the two graphics items which are drawn in the same manner?

      Picture for reference:
      fontMetricsIssueCapture.PNG

      Please help.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post