This repository has been archived by the owner on Jun 8, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return appropriate value for Qt automatic scaling
Previously, QtUbuntu did not return the appropriate values for QtQuick2 scaling. This meant that developers would need to add some boilerplate to their main.cpp or a shell script which set the QT_SCALE_FACTOR environment variable by dividing the GRID_UNIT_PIXELS value on the platform. This change makes QtUbuntu return QScreen::pixelDensity(), the value which Qt uses to determine the scale factor by itself. The constant of 96 was chosen since it appears to give amicable results with the apps I've tested and is in line with the X QPA's pixelDensity() equation. Now, apps which specify sizes in pixels (by just putting an integer in their width or height of widgets) will receive an integer scale factor. For example, an item with a width of 100 pixels becomes 200 pixels wide when run. Fixes ubports/ubuntu-touch#841
- Loading branch information