Navigation Menu

Skip to content

Commit

Permalink
Update deprecated method
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Aug 9, 2020
1 parent adf525d commit d3ca808
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/quickgui/qgsquickutils.cpp
Expand Up @@ -334,11 +334,12 @@ void QgsQuickUtils::formatToUSCSDistance( double srcDistance,

QString QgsQuickUtils::dumpScreenInfo() const
{
QRect rec = QApplication::desktop()->screenGeometry();
int dpiX = QApplication::desktop()->physicalDpiX();
int dpiY = QApplication::desktop()->physicalDpiY();
int height = rec.height();
int width = rec.width();
// take the first top level window
QScreen *screen = QGuiApplication::topLevelWindows().at( 0 )->screen();
double dpiX = screen->physicalDotsPerInchX();
double dpiY = screen->physicalDotsPerInchY();
int height = screen->geometry().height();
int width = screen->geometry().width();
double sizeX = static_cast<double>( width ) / dpiX * 25.4;
double sizeY = static_cast<double>( height ) / dpiY * 25.4;

Expand Down

0 comments on commit d3ca808

Please sign in to comment.