6#include "QskPlatform.h"
8#include <qguiapplication.h>
9#include <qquickwindow.h>
13#include <private/qguiapplication_p.h>
14#include <private/qhighdpiscaling_p.h>
17#include <qpa/qplatformintegration.h>
18#include <qpa/qplatformscreen.h>
20qreal qskGlobalScaleFactor()
23 const QScreen* noScreen =
nullptr;
24 return QHighDpiScaling::factor( noScreen );
27const QPlatformIntegration* qskPlatformIntegration()
29 return QGuiApplicationPrivate::platformIntegration();
32const QPlatformTheme* qskPlatformTheme()
34 return QGuiApplicationPrivate::platformTheme();
37bool qskMaybeDesktopPlatform()
40 if (
const auto platform = QGuiApplicationPrivate::platformIntegration() )
41 return platform->hasCapability( QPlatformIntegration::MultipleWindows );
47QRect qskPlatformScreenGeometry(
const QScreen* screen )
49 if ( screen ==
nullptr )
52 return screen->handle()->geometry();
55static inline qreal qskWindowDpi(
const QWindow* window )
57 QScreen* screen =
nullptr;
59 screen = window->screen();
61 if ( screen ==
nullptr )
62 screen = QGuiApplication::primaryScreen();
64 return QHighDpiScaling::logicalDpi( screen ).first;
67qreal qskInchesToPixels(
const QQuickWindow* window, qreal inches )
69 return qskWindowDpi( window ) * inches;
72qreal qskMMToPixels(
const QQuickWindow* window, qreal mm )
74 return qskWindowDpi( window ) * mm / 25.4;