diff --git a/.ci/qt5_14/build.sh b/.ci/qt5_14/build.sh index 9f75cb9935f..199ea4c0fbe 100755 --- a/.ci/qt5_14/build.sh +++ b/.ci/qt5_14/build.sh @@ -7,7 +7,7 @@ ccache -S cmake -GNinja \ -DUSE_CCACHE=ON \ - -DWITH_QUICK=ON \ + -DWITH_QUICK=OFF \ -DWITH_3D=ON \ -DWITH_STAGED_PLUGINS=ON \ -DWITH_GRASS=OFF \ diff --git a/src/quickgui/qgsquickutils.cpp b/src/quickgui/qgsquickutils.cpp index 8baf11520ab..8830c606327 100644 --- a/src/quickgui/qgsquickutils.cpp +++ b/src/quickgui/qgsquickutils.cpp @@ -14,8 +14,7 @@ ***************************************************************************/ #include -#include -#include +#include #include #include "qgis.h" @@ -335,12 +334,11 @@ void QgsQuickUtils::formatToUSCSDistance( double srcDistance, QString QgsQuickUtils::dumpScreenInfo() const { - // 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(); + QRect rec = QApplication::desktop()->screenGeometry(); + int dpiX = QApplication::desktop()->physicalDpiX(); + int dpiY = QApplication::desktop()->physicalDpiY(); + int height = rec.height(); + int width = rec.width(); double sizeX = static_cast( width ) / dpiX * 25.4; double sizeY = static_cast( height ) / dpiY * 25.4; @@ -393,9 +391,8 @@ qreal QgsQuickUtils::screenDensity() const qreal QgsQuickUtils::calculateScreenDensity() { // calculate screen density for calculation of real pixel sizes from density-independent pixels - QScreen *screen = QGuiApplication::topLevelWindows().at( 0 )->screen(); - double dpiX = screen->physicalDotsPerInchX(); - double dpiY = screen->physicalDotsPerInchY(); + int dpiX = QApplication::desktop()->physicalDpiX(); + int dpiY = QApplication::desktop()->physicalDpiY(); 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 }