Skip to content
Permalink
Browse files
Use settings entry
  • Loading branch information
domi4484 committed Jul 8, 2021
1 parent 2705e01 commit ded3d0db5274865cabbace1f4974500e7f9d232a
@@ -740,7 +740,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
mMapTipsDelaySpinBox->setValue( mSettings->value( QStringLiteral( "qgis/mapTipsDelay" ), 850 ).toInt() );
mMapTipsDelaySpinBox->setClearValue( 850 );

mRespectScreenDpiCheckBox->setChecked( mSettings->value( QStringLiteral( "qgis/respect_screen_dpi" ), QStringLiteral( "false" ), QgsSettings::Section::Gui ) == QStringLiteral( "true" ) );
mRespectScreenDpiCheckBox->setChecked( QgsSettingsRegistryCore::settingsRespectScreenDPI.value() );

//
// Raster properties
@@ -1608,7 +1608,7 @@ void QgsOptions::saveOptions()

mSettings->setValue( QStringLiteral( "/qgis/defaultLegendGraphicResolution" ), mLegendGraphicResolutionSpinBox->value() );
mSettings->setValue( QStringLiteral( "/qgis/mapTipsDelay" ), mMapTipsDelaySpinBox->value() );
mSettings->setValue( QStringLiteral( "qgis/respect_screen_dpi" ), mRespectScreenDpiCheckBox->isChecked() ? QStringLiteral( "true" ) : QStringLiteral( "false" ), QgsSettings::Section::Gui );
QgsSettingsRegistryCore::settingsRespectScreenDPI.setValue( mRespectScreenDpiCheckBox->isChecked() );

mSettings->setEnumValue( QStringLiteral( "/qgis/copyFeatureFormat" ), ( QgsClipboard::CopyFormat )mComboCopyFeatureFormat->currentData().toInt() );
QgisApp::instance()->setMapTipsDelay( mMapTipsDelaySpinBox->value() );
@@ -95,6 +95,7 @@ QgsSettingsRegistryCore::QgsSettingsRegistryCore()
addSettingsEntry( &settingsDigitizingOffsetCapStyle );
addSettingsEntry( &settingsDigitizingOffsetShowAdvanced );
addSettingsEntry( &settingsDigitizingTracingMaxFeatureCount );
addSettingsEntry( &settingsRespectScreenDPI );
}

QgsSettingsRegistryCore::~QgsSettingsRegistryCore()
@@ -170,6 +170,9 @@ class CORE_EXPORT QgsSettingsRegistryCore : public QgsSettingsRegistry

//! Settings entry digitizing tracing max feature count
static const inline QgsSettingsEntryInteger settingsDigitizingTracingMaxFeatureCount = QgsSettingsEntryInteger( QStringLiteral( "/qgis/digitizing/tracing_max_feature_count" ), QgsSettings::NoSection, 10000 );

//! Settings entry respect screen dpi
static const inline QgsSettingsEntryBool settingsRespectScreenDPI = QgsSettingsEntryBool( QStringLiteral( "qgis/respect_screen_dpi" ), QgsSettings::Gui, false );
#endif

};
@@ -91,6 +91,7 @@ email : sherman at mrcc.com
#include "qgscoordinatereferencesystemregistry.h"
#include "qgslabelingresults.h"
#include "qgsmaplayerutils.h"
#include "qgssettingsregistrycore.h"

/**
* \ingroup gui
@@ -984,7 +985,7 @@ void QgsMapCanvas::updateDevicePixelFromScreen()
{
mSettings.setDevicePixelRatio( devicePixelRatio() );
// TODO: QGIS 4 -> always respect screen dpi
if ( QgsSettings().value( QStringLiteral( "qgis/respect_screen_dpi" ), QStringLiteral( "false" ), QgsSettings::Section::Gui ) == QLatin1String( "true" ) )
if ( QgsSettingsRegistryCore::settingsRespectScreenDPI.value() )
{
mSettings.setOutputDpi( screen()->physicalDotsPerInch() );
}

0 comments on commit ded3d0d

Please sign in to comment.