6#include "QskPlatform.h"
7#include "QskInternalMacros.h"
9#include <qguiapplication.h>
10#include <qquickwindow.h>
14#include <private/qguiapplication_p.h>
15#include <private/qhighdpiscaling_p.h>
18#include <qpa/qplatformintegration.h>
19#include <qpa/qplatformscreen.h>
21qreal qskGlobalScaleFactor()
24 const QScreen* noScreen =
nullptr;
25 return QHighDpiScaling::factor( noScreen );
28const QPlatformIntegration* qskPlatformIntegration()
30 return QGuiApplicationPrivate::platformIntegration();
33const QPlatformTheme* qskPlatformTheme()
35 return QGuiApplicationPrivate::platformTheme();
38bool qskMaybeDesktopPlatform()
41 if (
const auto platform = QGuiApplicationPrivate::platformIntegration() )
42 return platform->hasCapability( QPlatformIntegration::MultipleWindows );
48QRect qskPlatformScreenGeometry(
const QScreen* screen )
50 if ( screen ==
nullptr )
53 return screen->handle()->geometry();
56static inline qreal qskWindowDpi(
const QWindow* window )
58 QScreen* screen =
nullptr;
60 screen = window->screen();
62 if ( screen ==
nullptr )
63 screen = QGuiApplication::primaryScreen();
65 return QHighDpiScaling::logicalDpi( screen ).first;
68qreal qskInchesToPixels(
const QQuickWindow* window, qreal inches )
70 return qskWindowDpi( window ) * inches;
73qreal qskMMToPixels(
const QQuickWindow* window, qreal mm )
75 return qskWindowDpi( window ) * mm / 25.4;