#include "QskPlatform.h" #include #include QSK_QT_PRIVATE_BEGIN #include #if QT_VERSION < QT_VERSION_CHECK( 5, 8, 0 ) #ifndef foreach // qhighdpiscaling_p.h needs it #define foreach Q_FOREACH #endif #endif #include QSK_QT_PRIVATE_END #include #include qreal qskDpiScaled( qreal value ) { static qreal factor = 0.0; if ( factor <= 0.0 ) { if ( const auto screen = QGuiApplication::primaryScreen() ) factor = screen->logicalDotsPerInchX(); else factor = 100.0; factor /= 96.0; } return value * factor; } qreal qskGlobalScaleFactor() { // The value of QT_SCALE_FACTOR const QScreen* noScreen = nullptr; return QHighDpiScaling::factor( noScreen ); } const QPlatformIntegration* qskPlatformIntegration() { return QGuiApplicationPrivate::platformIntegration(); } bool qskMaybeDesktopPlatform() { #if QT_CONFIG(cursor) // this is what QC2 is doing for menus ? if ( const auto platform = QGuiApplicationPrivate::platformIntegration() ) return platform->hasCapability( QPlatformIntegration::MultipleWindows ); #endif return false; } QRect qskPlatformScreenGeometry( const QScreen* screen ) { if ( screen == nullptr ) return QRect(); return screen->handle()->geometry(); }