diff --git a/src/common/QskObjectCounter.cpp b/src/common/QskObjectCounter.cpp index b6f8b585d..9527026f6 100644 --- a/src/common/QskObjectCounter.cpp +++ b/src/common/QskObjectCounter.cpp @@ -7,11 +7,11 @@ #include #include +#include +#include QSK_QT_PRIVATE_BEGIN #include -#include -#include QSK_QT_PRIVATE_END #define QSK_OBJECT_INFO 0 @@ -20,10 +20,19 @@ QSK_QT_PRIVATE_END #include #endif +#if QT_VERSION < QT_VERSION_CHECK( 6, 4, 0 ) + +QSK_QT_PRIVATE_BEGIN +#include +QSK_QT_PRIVATE_END + +#endif + static inline bool qskIsItem( const QObject* object ) { - QObjectPrivate* o_p = QObjectPrivate::get( const_cast< QObject* >( object ) ); - +#if QT_VERSION >= QT_VERSION_CHECK( 6, 4, 0 ) + return object->isQuickItemType(); +#else /* The addObject hook is called from the constructor of QObject, where we don't have the derived class constructed yet. @@ -31,7 +40,9 @@ static inline bool qskIsItem( const QObject* object ) RTTI being enabled. TODO ... */ + auto o_p = QObjectPrivate::get( const_cast< QObject* >( object ) ); return dynamic_cast< QQuickItemPrivate* >( o_p ) != nullptr; +#endif } namespace diff --git a/src/common/QskPlatform.cpp b/src/common/QskPlatform.cpp index c42bbaf33..018ef40a0 100644 --- a/src/common/QskPlatform.cpp +++ b/src/common/QskPlatform.cpp @@ -23,6 +23,11 @@ const QPlatformIntegration* qskPlatformIntegration() return QGuiApplicationPrivate::platformIntegration(); } +const QPlatformTheme* qskPlatformTheme() +{ + return QGuiApplicationPrivate::platformTheme(); +} + bool qskMaybeDesktopPlatform() { #if QT_CONFIG(cursor) diff --git a/src/common/QskPlatform.h b/src/common/QskPlatform.h index d2301e3b8..26be24a04 100644 --- a/src/common/QskPlatform.h +++ b/src/common/QskPlatform.h @@ -10,14 +10,17 @@ class QScreen; class QPlatformIntegration; +class QPlatformTheme; class QRect; QSK_EXPORT qreal qskGlobalScaleFactor(); QSK_EXPORT bool qskMaybeDesktopPlatform(); -QSK_EXPORT const QPlatformIntegration* qskPlatformIntegration(); QSK_EXPORT QRect qskPlatformScreenGeometry( const QScreen* ); +QSK_EXPORT const QPlatformIntegration* qskPlatformIntegration(); +QSK_EXPORT const QPlatformTheme* qskPlatformTheme(); + /* One dp is a virtual pixel unit that's roughly equal to one pixel on a medium-density screen ( 160 dpi ). diff --git a/src/controls/QskEvent.cpp b/src/controls/QskEvent.cpp index a3152e92b..b0063dbad 100644 --- a/src/controls/QskEvent.cpp +++ b/src/controls/QskEvent.cpp @@ -9,11 +9,7 @@ #include #if QT_VERSION >= QT_VERSION_CHECK( 6, 4, 0 ) - - QSK_QT_PRIVATE_BEGIN - #include - QSK_QT_PRIVATE_END - + #include "QskPlatform.h" #include #endif @@ -127,7 +123,7 @@ bool qskIsStandardKeyInput( const QKeyEvent* event, QKeySequence::StandardKey ke constexpr auto mask = ~( Qt::KeypadModifier | Qt::GroupSwitchModifier ); // We should route this call through the skin. TODO - const auto theme = QGuiApplicationPrivate::platformTheme(); + const auto theme = qskPlatformTheme(); const auto bindings = theme->keyBindings( ( event->modifiers() | event->key() ) & mask ); return bindings.contains( QKeySequence(searchkey) ); @@ -138,8 +134,7 @@ bool qskIsButtonPressKey( const QKeyEvent* event ) { #if QT_VERSION >= QT_VERSION_CHECK( 6, 4, 0 ) - const auto hint = QGuiApplicationPrivate::platformTheme()->themeHint( - QPlatformTheme::ButtonPressKeys ); + const auto hint = qskPlatformTheme()->themeHint( QPlatformTheme::ButtonPressKeys ); const auto keys = hint.value< QList< Qt::Key > >(); return keys.contains( static_cast< Qt::Key >( event->key() ) ); diff --git a/src/controls/QskQuick.cpp b/src/controls/QskQuick.cpp index d08f5fbc9..fceff5e9d 100644 --- a/src/controls/QskQuick.cpp +++ b/src/controls/QskQuick.cpp @@ -7,10 +7,10 @@ #include "QskControl.h" #include "QskFunctions.h" #include "QskLayoutElement.h" +#include "QskPlatform.h" #include QSK_QT_PRIVATE_BEGIN -#include #include QSK_QT_PRIVATE_END @@ -277,7 +277,7 @@ void qskUpdateInputMethod( const QQuickItem* item, Qt::InputMethodQueries querie when using it. So let's go with QGuiApplicationPrivate. */ - auto inputContext = QGuiApplicationPrivate::platformIntegration()->inputContext(); + auto inputContext = qskPlatformIntegration()->inputContext(); if ( inputContext == nullptr ) { context = nullptr; @@ -317,7 +317,7 @@ void qskInputMethodSetVisible( const QQuickItem* item, bool on ) static QPlatformInputContext* context = nullptr; static int methodId = -1; - auto inputContext = QGuiApplicationPrivate::platformIntegration()->inputContext(); + auto inputContext = qskPlatformIntegration()->inputContext(); if ( inputContext == nullptr ) { context = nullptr; diff --git a/src/controls/QskQuickItem.cpp b/src/controls/QskQuickItem.cpp index 195d0f2ef..21a117645 100644 --- a/src/controls/QskQuickItem.cpp +++ b/src/controls/QskQuickItem.cpp @@ -26,7 +26,9 @@ QSK_QT_PRIVATE_BEGIN #endif #endif +#if defined( QT_DEBUG ) #include +#endif QSK_QT_PRIVATE_END diff --git a/src/controls/QskScrollArea.cpp b/src/controls/QskScrollArea.cpp index b5438f161..520ff0112 100644 --- a/src/controls/QskScrollArea.cpp +++ b/src/controls/QskScrollArea.cpp @@ -11,10 +11,8 @@ #include "QskSGNode.h" QSK_QT_PRIVATE_BEGIN -#include #include #include -#include QSK_QT_PRIVATE_END static inline bool qskNeedsScrollBars( diff --git a/src/controls/QskSkin.cpp b/src/controls/QskSkin.cpp index a350f83cf..4203604d4 100644 --- a/src/controls/QskSkin.cpp +++ b/src/controls/QskSkin.cpp @@ -16,10 +16,7 @@ #include "QskMargins.h" -QSK_QT_PRIVATE_BEGIN -#include -QSK_QT_PRIVATE_END - +#include #include #include @@ -344,7 +341,7 @@ bool QskSkin::hasGraphicProvider() const QString QskSkin::dialogButtonText( int action ) const { - const auto theme = QGuiApplicationPrivate::platformTheme(); + const auto theme = qskPlatformTheme(); auto text = theme->standardButtonText( action ); text = QPlatformTheme::removeMnemonics( text ); @@ -357,7 +354,7 @@ const int* QskSkin::dialogButtonLayout( Qt::Orientation orientation ) const // auto policy = QPlatformDialogHelper::UnknownLayout; auto policy = QPlatformDialogHelper::WinLayout; - if ( const auto theme = QGuiApplicationPrivate::platformTheme() ) + if ( const auto theme = qskPlatformTheme() ) { const QVariant v = theme->themeHint( QPlatformTheme::DialogButtonBoxLayout ); policy = static_cast< QPlatformDialogHelper::ButtonLayout >( v.toInt() ); diff --git a/src/controls/QskSkinlet.cpp b/src/controls/QskSkinlet.cpp index d3446d946..028492e2b 100644 --- a/src/controls/QskSkinlet.cpp +++ b/src/controls/QskSkinlet.cpp @@ -32,13 +32,9 @@ #include #include -QSK_QT_PRIVATE_BEGIN -#include -QSK_QT_PRIVATE_END - static inline QRectF qskSceneAlignedRect( const QQuickItem* item, const QRectF& rect ) { - const auto transform = QQuickItemPrivate::get( item )->itemToWindowTransform(); + const auto transform = item->itemTransform( nullptr, nullptr ); if ( transform.type() > QTransform::TxTranslate ) return rect; diff --git a/src/graphic/QskGraphic.cpp b/src/graphic/QskGraphic.cpp index e74540389..b11b7e317 100644 --- a/src/graphic/QskGraphic.cpp +++ b/src/graphic/QskGraphic.cpp @@ -19,7 +19,6 @@ QSK_QT_PRIVATE_BEGIN #include -#include QSK_QT_PRIVATE_END static inline qreal qskDevicePixelRatio() diff --git a/src/inputpanel/QskInputContext.cpp b/src/inputpanel/QskInputContext.cpp index 2edb0e482..299199d64 100644 --- a/src/inputpanel/QskInputContext.cpp +++ b/src/inputpanel/QskInputContext.cpp @@ -13,14 +13,12 @@ #include "QskQuick.h" #include "QskTextPredictor.h" #include "QskWindow.h" +#include "QskPlatform.h" #include #include #include - -QSK_QT_PRIVATE_BEGIN -#include -QSK_QT_PRIVATE_END +#include #include #include @@ -183,7 +181,7 @@ static QPointer< QskInputContext > qskInputContext; static void qskSendToPlatformContext( QEvent::Type type ) { - const auto integration = QGuiApplicationPrivate::platformIntegration(); + const auto integration = qskPlatformIntegration(); if ( const auto inputContext = integration->inputContext() ) { diff --git a/src/nodes/QskGradientMaterial.cpp b/src/nodes/QskGradientMaterial.cpp index 9d9e3b66d..c36e9292d 100644 --- a/src/nodes/QskGradientMaterial.cpp +++ b/src/nodes/QskGradientMaterial.cpp @@ -11,11 +11,6 @@ #include -QSK_QT_PRIVATE_BEGIN -#include -#include -QSK_QT_PRIVATE_END - #include // RHI shaders are supported by Qt 5.15 and Qt 6.x diff --git a/src/nodes/QskPlainTextRenderer.cpp b/src/nodes/QskPlainTextRenderer.cpp index 92b80bd17..5c39cd378 100644 --- a/src/nodes/QskPlainTextRenderer.cpp +++ b/src/nodes/QskPlainTextRenderer.cpp @@ -12,8 +12,6 @@ #include QSK_QT_PRIVATE_BEGIN -#include -#include #include QSK_QT_PRIVATE_END