App/Core: Only set DPI rounding options if default not "Unset"

Instead of making the OS specific decision whether to set DPI rounding
options or not in several places, leave the OS specific check to
StyleHelper::defaultHighDpiScaleFactorRoundingPolicy() and test for
"Unset".

Change-Id: I37ab4a0c643d1b1597e5f45496510f2f36f1a386
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Alessandro Portale
2023-10-05 10:05:37 +02:00
parent dbfaa6a842
commit 718de1bf78
2 changed files with 5 additions and 2 deletions

View File

@@ -135,7 +135,8 @@ GeneralSettingsWidget::GeneralSettingsWidget()
form.addRow({Tr::tr("Toolbar style:"), m_toolbarStyleBox, st});
form.addRow({Tr::tr("Language:"), m_languageBox, st});
if (!Utils::HostOsInfo::isMacHost()) {
if (StyleHelper::defaultHighDpiScaleFactorRoundingPolicy()
!= Qt::HighDpiScaleFactorRoundingPolicy::Unset) {
using Policy = Qt::HighDpiScaleFactorRoundingPolicy;
m_policyComboBox = new QComboBox;
m_policyComboBox->addItem(Tr::tr("Round up for .5 and above"), int(Policy::Round));