Skip to content

Commit

Permalink
Exclude QtQuick for now
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Aug 9, 2020
1 parent cea65ba commit 3177e76
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .ci/qt5_14/build.sh
Expand Up @@ -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 \
Expand Down
19 changes: 8 additions & 11 deletions src/quickgui/qgsquickutils.cpp
Expand Up @@ -14,8 +14,7 @@
***************************************************************************/

#include <QApplication>
#include <QWindow>
#include <QScreen>
#include <QDesktopWidget>
#include <QString>

#include "qgis.h"
Expand Down Expand Up @@ -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<double>( width ) / dpiX * 25.4;
double sizeY = static_cast<double>( height ) / dpiY * 25.4;

Expand Down Expand Up @@ -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
}

0 comments on commit 3177e76

Please sign in to comment.