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. QFileDialog on 4K screen

QFileDialog on 4K screen

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.0k 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.
  • Q Offline
    Q Offline
    qtnebula
    wrote on last edited by qtnebula
    #1

    Hi,

    The issue that I have is that on 4K screen native QFileDialog dialog looks tiny (despite 200% OS user scale setting)

    Is it possible to make it aware of desktop 200% user scale setting ?

    Alternatively, is it possible to apply stylesheet (to compensate the resolution) to QFileDialog instance but still keep it native ?

    In my application I use the QT recommended approach:

    Always use the qreal versions of the QPainter drawing API.
    Size windows and dialogs in relation to the screen size.
    Replace hard-coded sizes in layouts and drawing code by values calculated from font metrics or screen size.
    

    I don't know what to do with QFileDialog though...

    Thanks a lot!

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Did you try anything from ?
      http://doc.qt.io/qt-5/highdpi.html

      Also when you say native QFileDialog , do you mean
      native to Qt. ( its version ) or native to the OS via the
      Qt::DontUseNativeDialog flag ?

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qtnebula
        wrote on last edited by qtnebula
        #3

        By native I mean OS file dialog (with all bells and whistles)

        I have the following lines in my code:

        setAttribute(Qt::AA_EnableHighDpiScaling);
        setDesktopSettingsAware(true);
        

        I tried other true/false combinations but without spotting any difference.
        Also tried to open dialog passing null parent

        mrjjM 1 Reply Last reply
        0
        • Q qtnebula

          By native I mean OS file dialog (with all bells and whistles)

          I have the following lines in my code:

          setAttribute(Qt::AA_EnableHighDpiScaling);
          setDesktopSettingsAware(true);
          

          I tried other true/false combinations but without spotting any difference.
          Also tried to open dialog passing null parent

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

          @qtnebula
          So if you use another app, and open the FileDialog from that app
          its also ultra small ?

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            qtnebula
            wrote on last edited by
            #5

            Apparently I had to do sign out and sign in to apply windows user scale correctly to all applications.
            After doing this everything look fine.

            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