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 windows dpi setting.
Forum Updated to NodeBB v4.3 + New Features

disable windows dpi setting.

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 5 Posters 1.7k 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.
  • P Offline
    P Offline
    Pada_
    wrote on last edited by
    #1

    Using Windows 8.1 64Bit + Using Qt 5.4

    Windows 8.1 Display Settings-> Magnification Settings

    Small (100%) Medium (125%) Large (150%) Small was selected.

    And if you run the developed program and change the window magnification setting to large, the text inside the program will be bigger.

    Do you know how to get a small (100%) value regardless of the window magnification setting value?

    I set it in qt.conf but it doesn't change.

    [Platforms]
    WindowsArguments = dpiawareness=0

    or

    [Platforms]
    WindowsArguments = dpiawareness=2

    30ac3c08-b532-4a91-95ba-147d0361131e-image.png

    1 Reply Last reply
    0
    • gde23G Offline
      gde23G Offline
      gde23
      wrote on last edited by
      #2

      add

      QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
      

      to the beginning of your main() function

      mrjjM 1 Reply Last reply
      1
      • gde23G gde23

        add

        QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
        

        to the beginning of your main() function

        mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @gde23
        Actually i think he wants to try
        Qt::AA_DisableHighDpiScaling

        1 Reply Last reply
        1
        • hskoglundH Offline
          hskoglundH Offline
          hskoglund
          wrote on last edited by
          #4

          Hi, I had the same problem, solved it by placing a qt.conf next to the .exe with these 2 lines:
          [Platforms]
          WindowsArguments = dpiawareness=0

          Maybe Qt 5.4 doesn't support (too old?) passing the setting via qt.conf, you could try instead starting your .exe file from a CMD window:

          your-exe-file -platform windows:dpiawareness=0
          
          P 1 Reply Last reply
          2
          • hskoglundH hskoglund

            Hi, I had the same problem, solved it by placing a qt.conf next to the .exe with these 2 lines:
            [Platforms]
            WindowsArguments = dpiawareness=0

            Maybe Qt 5.4 doesn't support (too old?) passing the setting via qt.conf, you could try instead starting your .exe file from a CMD window:

            your-exe-file -platform windows:dpiawareness=0
            
            P Offline
            P Offline
            Pada_
            wrote on last edited by
            #5

            @ gde23
            @mrjj

            Unfortunately, I am using Qt 5.4 version,
            Qt :: AA_DisableHighDpiScaling
            can not use.

            @hskoglund
            where is the qt.conf file
            I tried to find the same file on the C drive, but it didn't work.

            jsulmJ 1 Reply Last reply
            0
            • P Pada_

              @ gde23
              @mrjj

              Unfortunately, I am using Qt 5.4 version,
              Qt :: AA_DisableHighDpiScaling
              can not use.

              @hskoglund
              where is the qt.conf file
              I tried to find the same file on the C drive, but it didn't work.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Pada_ said in disable windows dpi setting.:

              where is the qt.conf file

              You have to create it

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              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