Skip to content

Commit

Permalink
Qt 6.7 incompatibilities fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
uwerat committed Dec 27, 2023
1 parent 69090a6 commit 67f0df4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
19 changes: 10 additions & 9 deletions src/common/QskMetaFunction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 >;

Expand All @@ -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 );
Expand All @@ -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 >;

Expand All @@ -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,
Expand All @@ -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 >;

Expand All @@ -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 );
Expand Down
14 changes: 12 additions & 2 deletions src/nodes/QskPlainTextRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down

0 comments on commit 67f0df4

Please sign in to comment.