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. QT_SCALE_FACTOR issue for values < 1
Forum Updated to NodeBB v4.3 + New Features

QT_SCALE_FACTOR issue for values < 1

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.1k 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.
  • D Offline
    D Offline
    DeepakH
    wrote on 26 Apr 2021, 08:09 last edited by
    #1

    Hello,

    I am currently developing a desktop application in Qt 5.12.3 ( windows ) and was facing an issue w.r.t resolution.
    When I deploy the application on my customer's premises, I want to either scale up/scale down the application size depending upon the resolution.
    Layouts only help upto a certain extent, as they do not resize the icons within the buttons or change the text font size of components depending upon the resolution of the monitor.

    Setting the environment variable QT_SCALE_FACTOR >= 1 ( say 1.5 , 2 etc ) does the trick for me. It resizes the size of buttons ( and icons within them ), labels ( and their font sizes ) and other gui components.
    However when I have to shrink the application, any value of QT_SCALE_FACTOR < 1 ( say 0.9 or 0.5 ) , it distorts the gui. I am unable to see components such as buttons, labels etc which I have used in my application.

    I'm guessing that I must have missed setting some attributes for QApplication, but I'm unsure.
    Any ideas on what the issue might be ?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 26 Apr 2021, 21:22 last edited by
      #2

      Hi,

      Based on this bug report, reduction is not the purpose of that variable.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      D 1 Reply Last reply 27 Apr 2021, 03:58
      1
      • S SGaist
        26 Apr 2021, 21:22

        Hi,

        Based on this bug report, reduction is not the purpose of that variable.

        D Offline
        D Offline
        DeepakH
        wrote on 27 Apr 2021, 03:58 last edited by
        #3

        @SGaist Thanks a lot for the prompt response.
        Do you have any suggestions, if I want to reduce the size of the application and its corresponding widget components ( including its icons, font etc ) ?
        Any help or alternatives would be welcome!

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 27 Apr 2021, 13:14 last edited by
          #4

          If there's a need to cut your UI by half, then you should rather have a GUI that is adapted to such a small screen.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          1/4

          26 Apr 2021, 08:09

          • Login

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