Skip to content

Commit

Permalink
Align code for deprecation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Aug 9, 2020
1 parent 417f83d commit 9cedf32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/quickgui/qgsquickutils.cpp
Expand Up @@ -393,8 +393,9 @@ qreal QgsQuickUtils::screenDensity() const
qreal QgsQuickUtils::calculateScreenDensity()
{
// calculate screen density for calculation of real pixel sizes from density-independent pixels
int dpiX = QApplication::desktop()->physicalDpiX();
int dpiY = QApplication::desktop()->physicalDpiY();
QScreen *screen = QGuiApplication::topLevelWindows().at( 0 )->screen();
double dpiX = screen->physicalDotsPerInchX();
double dpiY = screen->physicalDotsPerInchY();
int dpi = dpiX < dpiY ? dpiX : dpiY; // In case of asymmetrical DPI. Improbable
return dpi / 160.; // 160 DPI is baseline for density-independent pixels in Android
}

0 comments on commit 9cedf32

Please sign in to comment.