From 67f0df44afce35bbed688dd52320ee0ab17f98f6 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Wed, 27 Dec 2023 08:47:57 +0100 Subject: [PATCH] Qt 6.7 incompatibilities fixed --- src/common/QskMetaFunction.hpp | 19 ++++++++++--------- src/nodes/QskPlainTextRenderer.cpp | 14 ++++++++++++-- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/common/QskMetaFunction.hpp b/src/common/QskMetaFunction.hpp index e8905ab55..26af08602 100644 --- a/src/common/QskMetaFunction.hpp +++ b/src/common/QskMetaFunction.hpp @@ -47,11 +47,8 @@ class QskMetaFunction::FunctionCall : public QtPrivate::QSlotObjectBase namespace QskMetaFunctionCall { - using FunctionCall = QskMetaFunction::FunctionCall; - using namespace QtPrivate; - template< typename Function, typename Args, typename R > - class StaticFunctionCall : public FunctionCall + class StaticFunctionCall : public QskMetaFunction::FunctionCall { using MetaCall = StaticFunctionCall< Function, Args, R >; @@ -74,7 +71,7 @@ namespace QskMetaFunctionCall } case Call: { - typedef FunctionPointer< Function > FuncType; + using FuncType = QtPrivate::FunctionPointer< Function >; FuncType::template call< Args, R >( static_cast< MetaCall* >( functionCall )->m_function, object, args ); @@ -100,7 +97,7 @@ namespace QskMetaFunctionCall }; template< typename Function, typename Args, typename R > - class MemberFunctionCall : public FunctionCall + class MemberFunctionCall : public QskMetaFunction::FunctionCall { using MetaCall = MemberFunctionCall< Function, Args, R >; @@ -123,7 +120,7 @@ namespace QskMetaFunctionCall } case Call: { - typedef FunctionPointer< Function > FuncType; + using FuncType = QtPrivate::FunctionPointer< Function >; FuncType::template call< Args, R >( static_cast< MetaCall* >( functionCall )->m_function, @@ -144,7 +141,7 @@ namespace QskMetaFunctionCall }; template< typename Function, int N, typename Args, typename R > - class FunctorFunctionCall : public FunctionCall + class FunctorFunctionCall : public QskMetaFunction::FunctionCall { using MetaCall = FunctorFunctionCall< Function, N, Args, R >; @@ -167,7 +164,11 @@ namespace QskMetaFunctionCall } case Call: { - typedef Functor< Function, N > FuncType; +#if QT_VERSION < QT_VERSION_CHECK( 6, 7, 0 ) + using FuncType = QtPrivate::Functor< Function, N >; +#else + using FuncType = QtPrivate::Callable< Function, Args >; +#endif FuncType::template call< Args, R >( static_cast< MetaCall* >( functionCall )->m_function, object, args ); diff --git a/src/nodes/QskPlainTextRenderer.cpp b/src/nodes/QskPlainTextRenderer.cpp index 7b5d5a435..77d13684e 100644 --- a/src/nodes/QskPlainTextRenderer.cpp +++ b/src/nodes/QskPlainTextRenderer.cpp @@ -127,16 +127,26 @@ static void qskRenderText( if ( glyphNode == nullptr ) { const bool preferNativeGlyphNode = false; // QskTextOptions? - -#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 ) constexpr int renderQuality = -1; // QQuickText::DefaultRenderTypeQuality + +#if QT_VERSION >= QT_VERSION_CHECK( 6, 7, 0 ) + const auto renderType = preferNativeGlyphNode + ? QSGTextNode::QtRendering : QSGTextNode::NativeRendering; + glyphNode = sgContext->createGlyphNode( + renderContext, renderType, renderQuality ); +#elif QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 ) glyphNode = sgContext->createGlyphNode( renderContext, preferNativeGlyphNode, renderQuality ); #else + Q_UNUSED( renderQuality ); glyphNode = sgContext->createGlyphNode( renderContext, preferNativeGlyphNode ); #endif + +#if QT_VERSION < QT_VERSION_CHECK( 6, 7, 0 ) glyphNode->setOwnerElement( item ); +#endif + glyphNode->setFlags( QSGNode::OwnedByParent | GlyphFlag ); }