1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-22 12:34:19 +00:00

Merge pull request #11322 from Chocobo1/dpi

Use screen real physical DPI on Windows
This commit is contained in:
Mike Tzou 2019-10-04 12:00:22 +08:00 committed by GitHub
commit c7f092b95f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,8 +66,9 @@ qreal Utils::Gui::screenScalingFactor(const QWidget *widget)
return 1; return 1;
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
const int screen = qApp->desktop()->screenNumber(widget); const int screenNumber = qApp->desktop()->screenNumber(widget);
return (QApplication::screens()[screen]->logicalDotsPerInch() / 96); const QScreen *screen = QApplication::screens()[screenNumber];
return (screen->logicalDotsPerInch() / screen->physicalDotsPerInch());
#elif defined(Q_OS_MACOS) #elif defined(Q_OS_MACOS)
return 1; return 1;
#else #else