Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPainter FontMetrics returns different values on the same Graphics view and scene
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 208 Views
  • 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.
  • faiszalkhanF Offline
    faiszalkhanF Offline
    faiszalkhan
    wrote on last edited by
    #1

    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:
    alt textfontMetricsIssueCapture.PNG

    Please help.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved