From 1efbd02ddac1d8a4009e653ddc53cc94e4242d9e Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Wed, 28 Oct 2020 09:05:31 +0100 Subject: [PATCH] Qt6 incompatibility fixed --- qmlexport/QskQml.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/qmlexport/QskQml.cpp b/qmlexport/QskQml.cpp index 3498c1a5..b424f7a8 100644 --- a/qmlexport/QskQml.cpp +++ b/qmlexport/QskQml.cpp @@ -317,8 +317,16 @@ void QskQml::registerTypes() { auto source = it.value(); auto target = QskGradientStop(); - QMetaType::convert( &source, qMetaTypeId< decltype( source ) >(), - &target, qMetaTypeId< decltype( target ) >() ); + + const int sourceTypeId = qMetaTypeId< decltype( source ) >(); + const int targetTypeId = qMetaTypeId< decltype( target ) >(); + +#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 ) + QMetaType::convert( QMetaType( sourceTypeId ), &source, + QMetaType( targetTypeId ), &target ); +#else + QMetaType::convert( &source, sourceTypeId, &target, targetTypeId ); +#endif stops.append( target ); } }