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. [Solved] Managing font size at Mac and Windows
Qt 6.11 is out! See what's new in the release blog

[Solved] Managing font size at Mac and Windows

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.3k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi together,

    the problem is the well known and good described 72dpi at Mac and 96dpi at Windows problem. I have found a lot of discussion to this theme.
    But I have not found a document what describes how can a handle this. I need a description what I have to do that the displayed font has the same high at different systems. Please also cover QML. Is there a global setting in Qt 5.1?
    I'm sure there is a solution but I haven't found it, sorry.

    Thanks

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      I have solved the problem for our application by creating a factor which is used in every font.size declaration.
      This property is computed during the startup of the application by using the logicalDpiY from the QApplication::desktop() parameter.

      @QQuickView viewer;
      viewer.rootContext()->setContextProperty("fontFactor",
      72.0/QApplication::desktop()->logicalDpiY());@

      The number 72.0dpi is used, because the GUI-Development is made at a MAC.

      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