Commit 7656be36 authored by Alvin Wong's avatar Alvin Wong Committed by Ashwin Dhakaita

Add ext_qt patch for Windows to support fractional DPI scaling

This adds a series of patches related to QTBUG-53022 [1] for Windows to
allow enabling support for fractional DPI scaling.

These series of patches adds the option
`QGuiApplication::setHighDpiScaleFactorRoundingPolicy` to control how
the DPI scale factor is rounded (or not), which can also be overridden
by the environment variable `QT_SCALE_FACTOR_ROUNDING_POLICY`. The
options include:

- Round: Round up for .5 and above.
- Ceil: Always round up.
- Floor: Always round down.
- RoundPreferFloor: Round up for .75 and above.
- PassThrough: Don't round.

Currently the default option is explicitly set to `Round` to obtain the
old behaviour (where 1.5x is rounded to 2x).

Ref:
- https://bugreports.qt.io/browse/QTBUG-53022
- https://codereview.qt-project.org/157173
- https://codereview.qt-project.org/157174
- https://codereview.qt-project.org/161334
- https://codereview.qt-project.org/163219
- https://codereview.qt-project.org/176381
- https://codereview.qt-project.org/209886
parent f5d847e3
...@@ -65,7 +65,7 @@ if (WIN32) ...@@ -65,7 +65,7 @@ if (WIN32)
# COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0033-Move-QT_FONT_DPI-to-cross-platform-code.patch # COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0033-Move-QT_FONT_DPI-to-cross-platform-code.patch
# COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0034-Update-QT_SCREEN_SCALE_FACTORS.patch # COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0034-Update-QT_SCREEN_SCALE_FACTORS.patch
# COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0035-Deprecate-QT_AUTO_SCREEN_SCALE_FACTOR.patch # COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0035-Deprecate-QT_AUTO_SCREEN_SCALE_FACTOR.patch
# COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0036-Add-high-DPI-scale-factor-rounding-policy-C-API.patch # COMMAND ${PATCH_COMMAND} -p1 -d qtbase -i ${CMAKE_CURRENT_SOURCE_DIR}/0036-Add-high-DPI-scale-factor-rounding-policy-C-API.patch
) )
ExternalProject_Add( ExternalProject_Add(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment