Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect UI scaling with high DPI laptop screen #49764

Closed
2 tasks done
jbp35 opened this issue Aug 12, 2022 · 3 comments
Closed
2 tasks done

Incorrect UI scaling with high DPI laptop screen #49764

jbp35 opened this issue Aug 12, 2022 · 3 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@jbp35
Copy link
Contributor

jbp35 commented Aug 12, 2022

What is the bug or the crash?

The UI of QGIS is not scaled properly on Windows 10 when using a high DPI laptop screen with an additional external monitor.

Screenshot 2022-08-12 142130

Screenshot 2022-08-12 144924

Steps to reproduce the issue

Install and run QGIS with 4K high DPI screen.

Versions

All versions up to 3.26

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

  • I tried with a new QGIS profile

Additional context

The DevicePixelRatio of the 4K screen does not seems to be set correctly in QGIS as we can see in this comparison of QGIS console output and the standalone DprGadget provided by QT:

Screenshot 2022-08-20 090325

This appears to me that this is due to the fact that the flag AA_EnableHighDpiScaling is not set before the creation of the QApplication. This seems to be set by default in QT6 but not in QT5.

I am able to get everything working as expected by setting this manually and running QGIS in windows console:

set QT_ENABLE_HIGHDPI_SCALING=1
C:\OSGeo4W\bin\qgis-bin.exe

In addition, it is useful to also set :
QT_SCALE_FACTOR_ROUNDING_POLICY=passthrough
This is necessary as my windows scaling factor is not an integer (250%). Otherwise, the DevicePixelRatio for my High DPI screen is round up to 3 instead of 2.5 which makes the icons look a little too big. QT documentation mention that setting non integer scaling factor can cause issues with some styles, but in my case I have not seen any problem so far.

@jbp35 jbp35 added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Aug 12, 2022
@nicogodet
Copy link
Member

See #40274
Duplicates ?

@jbp35
Copy link
Contributor Author

jbp35 commented Aug 12, 2022

See #40274 Duplicates ?

I have indeed the same issue on my 4K laptop screen. However, #40274 does not cover scaling issue on external monitor which is the most annoying part for me as it is my primary display.

@jbp35 jbp35 changed the title Incorrect UI scaling on DPI laptop screen with an external monitor Incorrect UI scaling with high DPI laptop screen Aug 20, 2022
@nyalldawson
Copy link
Collaborator

Should be all fixed in QGIS 3.32 -- please open new tickets for any specific individual hidpi issues remaining after this release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

No branches or pull requests

3 participants