Skip to content

Commit

Permalink
Fixed High DPI Displays font and window scaling
Browse files Browse the repository at this point in the history
The QApplication app was being created after the two QApplication::setAttribute for scaling where being called - so they never where applied to the window!
  • Loading branch information
alanspencer committed Oct 17, 2018
1 parent 9ae981f commit dda4019
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
*/
int main(int argc, char **argv)
{
QApplication app(argc, argv);

//This has the app draw at HiDPI scaling on HiDPI displays, usually two pixels for every one logical pixel
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

Expand All @@ -43,8 +45,6 @@ int main(int argc, char **argv)
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif

QApplication app(argc, argv);

//Style program with our dark style
QApplication::setStyle(new DarkStyleTheme);

Expand Down

0 comments on commit dda4019

Please sign in to comment.