-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Icons too small and other scaling problems on high DPI monitor #40274
Comments
I believe this is upstream in QT - the workaround as you mentioned at least is to create a manifest file - see this example from this post. I forget to copy my file and every time I upgrade I have to create it again. Definitely a pain and I'm not too sure on what all is absolutely necessary in the manifest file. also this looks to be a duplicate of #20008 See my complete manifest file here - #36979 and another https://gis.stackexchange.com/questions/132491/qgis-on-uhd-screen - disregard the information regarding adjusting the compatibility settings in the properties, just the manifest file works great. |
Thank you. That manifest workaround appears to be superseded per Dan's April 8, 2017 comment: https://danantonielli.com/adobe-app-scaling-on-high-dpi-displays-fix/#comment-16689. |
Changing the high dpi settings did not work for me. Still using the manifest file. |
Here a batch code to create regedit key and auto generate manifest file. @echo off
chcp 65001
setLocal EnableDelayedExpansion
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide" /v PreferExternalManifest /t REG_DWORD /d 0x00000001 /f
set /p path="Please, enter full path to the .exe file:"
echo "%path%"
>"%path%.manifest" (
echo:^<?xml version=^"1.0^" encoding=^"UTF-8^" standalone=^"yes^"?^>
echo:
echo:^<assembly xmlns=^"urn:schemas-microsoft-com:asm.v1^" manifestVersion=^"1.0^" xmlns:asmv3=^"urn:schemas-microsoft-com:asm.v3^"^>
echo:
echo:^<dependency^>
echo: ^<dependentAssembly^>
echo: ^<assemblyIdentity
echo: type=^"win32^"
echo: name=^"Microsoft.Windows.Common-Controls^"
echo: version=^"6.0.0.0^" processorArchitecture=^"*^"
echo: publicKeyToken=^"6595b64144ccf1df^"
echo: language=^"*^"^>
echo: ^</assemblyIdentity^>
echo: ^</dependentAssembly^>
echo:^</dependency^>
echo:
echo:^<dependency^>
echo: ^<dependentAssembly^>
echo: ^<assemblyIdentity
echo: type=^"win32^"
echo: name=^"Microsoft.VC90.CRT^"
echo: version=^"9.0.21022.8^"
echo: processorArchitecture=^"amd64^"
echo: publicKeyToken=^"1fc8b3b9a1e18e3b^"^>
echo: ^</assemblyIdentity^>
echo: ^</dependentAssembly^>
echo:^</dependency^>
echo:
echo:^<trustInfo xmlns=^"urn:schemas-microsoft-com:asm.v3^"^>
echo: ^<security^>
echo: ^<requestedPrivileges^>
echo: ^<requestedExecutionLevel
echo: level=^"asInvoker^"
echo: uiAccess=^"false^"/^>
echo: ^</requestedPrivileges^>
echo: ^</security^>
echo:^</trustInfo^>
echo:
echo:^<asmv3:application^>
echo: ^<asmv3:windowsSettings xmlns=^"https://schemas.microsoft.com/SMI/2005/WindowsSettings^"^>
echo: ^<ms_windowsSettings:dpiAware xmlns:ms_windowsSettings=^"https://schemas.microsoft.com/SMI/2005/WindowsSettings^"^>false^</ms_windowsSettings:dpiAware^>
echo: ^</asmv3:windowsSettings^>
echo:^</asmv3:application^>
echo:
echo:^</assembly^>
)
echo "Manifest file generated !"
pause >nul |
I am facing the same issue and I think that I have been able to track partially the origin. It appears to me that currently QGIS does not take into account the devicePixelRatio as it can be seen in this comparison of QGIS console output and the standalone DprGadget provided by QT: The UI scaling issue can be fixed by adding the following lines of code to https://github.com/qgis/QGIS/blob/master/src/app/main.cpp after line 918
Note: @nyalldawson this can be of interest as I think that QT6 set these attributes by default. Alternatively, it is also possible to run qgis from a batch file with following commands to test:
However, it is not possible to set UseHighDpiPixmaps from command line so the icons will look blurry. After doing this, UI looks great on my device. However, there seems to be an issue with the scale of the map on the high DPI screen which is 2X too big. I have not been able to figure out where this comes from, but it looks like QgsMapSettings currently use a default devicePixelRatio of 1 which is never been updated. |
Apologies for stepping in late, but I am facing similar problems on my Windows 13'' laptop with full HD1080. I don't know enough about fixing/editing the code base, so I wouldn't know where to change: and test if this solved my problem of having a status bar not behaving as expected (related conversation on: https://gis.stackexchange.com/questions/457210/qgis-gui-layout-and-screen-scaling-in-windows?noredirect=1#comment746623_457210 I hope someone can direct me to some resources to fix the GUI. Thanks. Ps. I could start a new topic, but I think my problem(s) are related to this issue. |
On windows, you just have to copy and paste the following content in a .txt file (changing the path to qgis executable if necessary):
After saving, change the extension from .txt to .bat and execute run the file. |
Thanks jbp35,
Is there a workaround for this, or should I try and see how blurry the icons are after setting the parameters? |
You can give it a try, anyway these settings will only apply when you launch QGIS using the .bat file. |
Thanks, jbp35, but I think I will try to downgrade to my previous version first, and I hope that by doing so I can normally work again before using scripts to workaround a problem introduced by upgrading to the latest version. |
Should be all fixed in QGIS 3.32 -- please open new tickets for any specific individual hidpi issues remaining after this release |
Describe the bug
I have an HP EliteBook with a 4K (high DPI) monitor. When I open QGIS, the icons are tiny (Chrome browser window included in screenshot for context, and it may appear to be much larger than reality due to how Github apparently uses 72 dpi for displaying images):
This is a fresh install, through osgeo4w.
The Help --> About menu comes up badly messed up:
How to Reproduce
Expected behavior
QGIS and its features scale appropriately for high DPI monitors without any intervention on the part of users. I am sure some will post workarounds, and those will help others finding this bug, but workarounds are not bug fixes.
QGIS and OS versions
QGIS version
3.16.1-Hannover
QGIS code revision
b381a90
Compiled against Qt
5.11.2
Running against Qt
5.11.2
Compiled against GDAL/OGR
3.1.4
Running against GDAL/OGR
3.1.4
Compiled against GEOS
3.8.1-CAPI-1.13.3
Running against GEOS
3.8.1-CAPI-1.13.3
Compiled against SQLite
3.29.0
Running against SQLite
3.29.0
PostgreSQL Client Version
11.5
SpatiaLite Version
4.3.0
QWT Version
6.1.3
QScintilla2 Version
2.10.8
Compiled against PROJ
6.3.2
Running against PROJ
Rel. 6.3.2, May 1st, 2020
OS Version
Windows 10 (10.0)
Active python plugins
db_manager;
MetaSearch;
processing
Additional context
Laptop is running Windows 10 20H2. Fully patched. It has a quite recent, clean, bare-metal install of Windows.
Per https://issues.qgis.org/issues/17874, it appears it was believed that this was resolved.
The text was updated successfully, but these errors were encountered: