Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. QT_ENABLE_HIGHDPI_SCALING has no effect?
Forum Updated to NodeBB v4.3 + New Features

QT_ENABLE_HIGHDPI_SCALING has no effect?

Scheduled Pinned Locked Moved Solved Qt 6
8 Posts 3 Posters 3.4k 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.
  • A Offline
    A Offline
    Asperamanca
    wrote on last edited by
    #1

    I'm porting a project from Qt5 to Qt6, and have issues with the changed high DPI scaling behavior.
    So I wanted to disable it for testing, like documented here.

    But I don't see any effect, no matter if I set QT_ENABLE_HIGHDPI_SCALING to 0 or 1.

    I am working on Windows, so the caveats regarding Wayland and macOS don't apply.

    1 Reply Last reply
    0
    • TomZT Offline
      TomZT Offline
      TomZ
      wrote on last edited by
      #2

      On Qt6 the "HIGHDPI" is always on. It no longer is an option.

      Yes, your app may look different on your device as a result and you may need to do some testing across different devices.

      The good thing is that once you get this settled, your app will really have the same dimensions on different devices. Even using pixel sizes as those are not really pixels anymore. Much like webdevelopment uses pixels which are not pixels.

      A 1 Reply Last reply
      0
      • TomZT TomZ

        On Qt6 the "HIGHDPI" is always on. It no longer is an option.

        Yes, your app may look different on your device as a result and you may need to do some testing across different devices.

        The good thing is that once you get this settled, your app will really have the same dimensions on different devices. Even using pixel sizes as those are not really pixels anymore. Much like webdevelopment uses pixels which are not pixels.

        A Offline
        A Offline
        Asperamanca
        wrote on last edited by
        #3

        @TomZ said in QT_ENABLE_HIGHDPI_SCALING has no effect?:

        On Qt6 the "HIGHDPI" is always on. It no longer is an option.

        That may be the case, but the Qt 6.4. documentation also mentioned the QT_ENABLE_HIGHDPI_SCALING explicitly, so I am curious why that doesn't work.

        TomZT 1 Reply Last reply
        0
        • A Asperamanca

          @TomZ said in QT_ENABLE_HIGHDPI_SCALING has no effect?:

          On Qt6 the "HIGHDPI" is always on. It no longer is an option.

          That may be the case, but the Qt 6.4. documentation also mentioned the QT_ENABLE_HIGHDPI_SCALING explicitly, so I am curious why that doesn't work.

          TomZT Offline
          TomZT Offline
          TomZ
          wrote on last edited by
          #4

          @Asperamanca said in QT_ENABLE_HIGHDPI_SCALING has no effect?:

          That may be the case, but the Qt 6.4. documentation also mentioned the QT_ENABLE_HIGHDPI_SCALING explicitly, so I am curious why that doesn't work.

          You mean this ?

          QT_ENABLE_HIGHDPI_SCALING Set to 0 to disable high-dpi scaling; effectively reverting to Qt 5 default behavior. Note that this has no effect on platforms such as Wayland or macOS - it does not disable any native high-DPI support. This variable is intended for testing purposes only, and we do not recommend setting it on a permanent basis.

          A 1 Reply Last reply
          0
          • TomZT TomZ

            @Asperamanca said in QT_ENABLE_HIGHDPI_SCALING has no effect?:

            That may be the case, but the Qt 6.4. documentation also mentioned the QT_ENABLE_HIGHDPI_SCALING explicitly, so I am curious why that doesn't work.

            You mean this ?

            QT_ENABLE_HIGHDPI_SCALING Set to 0 to disable high-dpi scaling; effectively reverting to Qt 5 default behavior. Note that this has no effect on platforms such as Wayland or macOS - it does not disable any native high-DPI support. This variable is intended for testing purposes only, and we do not recommend setting it on a permanent basis.

            A Offline
            A Offline
            Asperamanca
            wrote on last edited by
            #5

            @TomZ
            Yes. I'm on Windows, so based on that information, I would expect it to work.

            1 Reply Last reply
            1
            • Q Offline
              Q Offline
              Queequeg
              wrote on last edited by
              #6

              Me too.

              QT_ENABLE_HIGHDPI_SCALING set to 0 is not working for me on Windows 10. How to use this option correctly?

              A 1 Reply Last reply
              0
              • Q Queequeg

                Me too.

                QT_ENABLE_HIGHDPI_SCALING set to 0 is not working for me on Windows 10. How to use this option correctly?

                A Offline
                A Offline
                Asperamanca
                wrote on last edited by
                #7

                @Queequeg
                Calling

                qputenv("QT_ENABLE_HIGHDPI_SCALING", "0");
                

                before constructing QGuiApplication seems to work.

                Q 1 Reply Last reply
                3
                • A Asperamanca

                  @Queequeg
                  Calling

                  qputenv("QT_ENABLE_HIGHDPI_SCALING", "0");
                  

                  before constructing QGuiApplication seems to work.

                  Q Offline
                  Q Offline
                  Queequeg
                  wrote on last edited by
                  #8

                  @Asperamanca confirmed. Thank you so much!

                  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