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. How to make an application responsive to screen DPI/Resolution?
Forum Updated to NodeBB v4.3 + New Features

How to make an application responsive to screen DPI/Resolution?

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

    Hey there,

    First of all, happy 2022 to everybody! :)

    Guys, I was wondering the best approach to make my app be responsive to different screen sizes. I'm working on a major version of my tool and the main goal is to do a complete UI review including high-resolution assets (icons, images, background, etc) and make the software adjust the widget sizes according to the current resolution.

    I'm aware of Qt's magic tricks on this subject (https://doc.qt.io/qt-5/highdpi.html), but one thing bothers me... When using, for example, QT_SCALE_FACTOR with a value greater than 1 the UI is exaggeratedly resized (in my case) causing a not so optimized use of all the available screen size. For example:

    The image below is my app running on a 4K screen without using QT_SCALE_FACTOR. What I would like to do is to "automagically" increase the size of icons, toolbars and so on without scaling the entire UI.

    pgmodeler_scale_factor_x1_4K_.png

    Now, when I use QT_SCALE_FACTOR on the same screen the result is:

    pgmodeler_scale_factor_x2_4K_.png

    So, my question is, if there's a way to scale things without appealing to QT_SCALE_FACTOR how to do that? I was thinking of testing a silly solution that is iterating over the widget's children and resizing only those belonging to certain classes (QToolButton, QPushButton). Does this make sense? Is there a way to use the scale routines implemented by Qt in the way I need?

    Thanks in advance.

    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