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. Disable DPI scaling in QT 6?
Forum Updated to NodeBB v4.3 + New Features

Disable DPI scaling in QT 6?

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

    Greetings,

    Is there any way to disable DPI scaling in QT 6?

    Thank you,

    1 Reply Last reply
    2
    • martin_kyM Offline
      martin_kyM Offline
      martin_ky
      wrote last edited by
      #2

      Yes, it's possible, using environment variables.

      Not sure about other platforms, but on Windows, setting following environment variables before launching your program works fine:

      set QT_ENABLE_HIGHDPI_SCALING=0
      set QT_FONT_DPI=96
      

      The first variable disables DPI scaling: i.e. widgets and QPainter will not do any scaling - 1 px line will be one physical pixel wide on the screen.

      The second variable disables scaling of fonts.

      M 1 Reply Last reply
      0
      • martin_kyM martin_ky

        Yes, it's possible, using environment variables.

        Not sure about other platforms, but on Windows, setting following environment variables before launching your program works fine:

        set QT_ENABLE_HIGHDPI_SCALING=0
        set QT_FONT_DPI=96
        

        The first variable disables DPI scaling: i.e. widgets and QPainter will not do any scaling - 1 px line will be one physical pixel wide on the screen.

        The second variable disables scaling of fonts.

        M Online
        M Online
        Mizmas
        wrote last edited by
        #3

        @martin_ky That's what I've been doing for the app I'm developing, can this cause any problems for non resizable apps?

        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