Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Enable automatic scaling for high DPI displays
  • Loading branch information
jbp35 authored and nyalldawson committed May 11, 2023
1 parent 5805888 commit 0ec8839
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app/main.cpp
Expand Up @@ -917,6 +917,14 @@ int main( int argc, char *argv[] )
).toUtf8().constData();
exit( 1 ); //exit for now until a version of qgis is capable of running non interactive
}

// Set up for high DPI displays
// The following values are set by default in Qt 6
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif

// GUI customization is enabled according to settings (loaded when instance is created)
// we force disabled here if --nocustomization argument is used
Expand Down

0 comments on commit 0ec8839

Please sign in to comment.