qt-creatorhighdpi

Change Qt Creator Interface Scaling / Font Size


Can I change Qt Creator's (latest version: 4.14.0, Windows 10) general GUI font size (or scaling)?

The problem is, my system display scaling is set to 250% and I have two options for high DPI compatibility in Qt Creator, but both have issues:

I can disable Creator's built-in High DPI Scaling and force System (Enhanced) in the Windows compatibility settings:

enter image description here

Or I can enable Creator's built-in scaling and leave the Windows compatibility scaling override turned off (Application scaling):

enter image description here

In the former case, it's actually a size I find very comfortable except the cursors are all too small and Designer gets wonky (plus it's tricky to layout GUI's because apps all run in System (Enhanced) mode from Creator).

In the latter case, the cursors and Designer work, and it's nice to not have heavy anti-aliasing everywhere, except the GUI font is too large for me, and everything feels cramped (especially the top bar, and the left bar reminds me of one of those old school children's telephones with the huge buttons). Plus the general GUI font is different enough in size from my editor font that the whole thing just feels jarring and kind of stresses me out.

So what I think I'd like to do, ideally, is use application scaling like in the latter example, but just shrink the GUI font size to match the former.

I think I ran through all the options thoroughly, and all I can find is settings for the editor window and the console, but not the rest of the GUI.

To be honest, I'm actually not entirely sure why they don't look the same; my expectation was that Qt's built-in High DPI support would take the scale factor into account in the same way that Windows' System (Enhanced) mode does, but I'm sure it's more complicated than that.


Solution

  • The problem is Qt automatically round up your 250% scaling to 300%. For Qt Creator application, you can create a "QT_SCALE_FACTOR_ROUNDING_POLICY" environment variable, and set it to "PassThrough". You can find details in this question: Qt Creator "too big" on 3840x2160 and 150% scaling on Windows 10. It's also worth noting that Qt also behaves like this coding a GUI program. This can be fixed with:

    QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);