From 21bd75ae5b2bdaf1831a1bb38859a50243e1d398 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Fri, 23 Oct 2020 14:00:27 +0200 Subject: [PATCH] Qt6 incompatibility fixed --- src/controls/QskSkinnable.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/controls/QskSkinnable.cpp b/src/controls/QskSkinnable.cpp index c21f0a32..ca2a8578 100644 --- a/src/controls/QskSkinnable.cpp +++ b/src/controls/QskSkinnable.cpp @@ -100,6 +100,17 @@ static inline bool qskCompareResolvedStates( } } +static inline QVariant qskTypedNullValue( const QVariant& value ) +{ +#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 ) + const auto vType = static_cast< QMetaType >( value.userType() ); +#else + const auto vType = value.userType(); +#endif + + return QVariant( vType, nullptr ); +} + class QskSkinnable::PrivateData { public: @@ -788,11 +799,11 @@ void QskSkinnable::startTransition( QskAspect::Aspect aspect, if ( !from.isValid() ) { - from = QVariant( to.userType(), nullptr ); + from = qskTypedNullValue( to ); } else if ( !to.isValid() ) { - to = QVariant( from.userType(), nullptr ); + to = qskTypedNullValue( from ); } else if ( from.userType() != to.userType() ) {