qskPlatformIntegration/qskMaybeDesktopPlatform added

This commit is contained in:
Uwe Rathmann 2021-12-26 12:12:18 +01:00
parent 1930810070
commit 0d43fbcc27
2 changed files with 15 additions and 4 deletions

View File

@ -180,10 +180,18 @@ qreal qskGlobalScaleFactor()
return QHighDpiScaling::factor( noScreen ); return QHighDpiScaling::factor( noScreen );
} }
bool qskHasPlatformWindowManagement() const QPlatformIntegration* qskPlatformIntegration()
{ {
if ( auto platform = QGuiApplicationPrivate::platformIntegration() ) return QGuiApplicationPrivate::platformIntegration();
return platform->hasCapability( QPlatformIntegration::WindowManagement ); }
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; return false;
} }

View File

@ -15,10 +15,13 @@ class QScreen;
class QFont; class QFont;
class QFontMetricsF; class QFontMetricsF;
class QString; class QString;
class QPlatformIntegration;
QSK_EXPORT qreal qskDpiScaled( qreal value ); QSK_EXPORT qreal qskDpiScaled( qreal value );
QSK_EXPORT qreal qskGlobalScaleFactor(); QSK_EXPORT qreal qskGlobalScaleFactor();
QSK_EXPORT bool qskHasPlatformWindowManagement();
QSK_EXPORT bool qskMaybeDesktopPlatform();
QSK_EXPORT const QPlatformIntegration* qskPlatformIntegration();
QSK_EXPORT QRect qskPlatformScreenGeometry( const QScreen* ); QSK_EXPORT QRect qskPlatformScreenGeometry( const QScreen* );
QSK_EXPORT QRect qskAlignedRect( const QRect& outerRect, QSK_EXPORT QRect qskAlignedRect( const QRect& outerRect,