Qt 5.14 adjustments

This commit is contained in:
Uwe Rathmann 2019-12-14 19:05:40 +01:00
parent deaffd1f53
commit 122181d8a1
2 changed files with 18 additions and 1 deletions

View File

@ -21,8 +21,16 @@ static inline void qskInvokeFunctionQueued( QObject* object,
constexpr QObject* sender = nullptr; constexpr QObject* sender = nullptr;
constexpr int signalId = 0; constexpr int signalId = 0;
#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
Q_UNUSED( types )
Q_UNUSED( argc )
auto event = new QMetaCallEvent(
functionCall, sender, signalId, argv, semaphore );
#else
auto event = new QMetaCallEvent( auto event = new QMetaCallEvent(
functionCall, sender, signalId, argc, types, argv, semaphore ); functionCall, sender, signalId, argc, types, argv, semaphore );
#endif
QCoreApplication::postEvent( object, event ); QCoreApplication::postEvent( object, event );
} }
@ -58,7 +66,11 @@ int QskMetaFunction::FunctionCall::typeInfo() const
int QskMetaFunction::FunctionCall::refCount() const int QskMetaFunction::FunctionCall::refCount() const
{ {
auto that = const_cast< FunctionCall* >( this ); auto that = const_cast< FunctionCall* >( this );
#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
return reinterpret_cast< SlotObject* >( that )->ref.loadRelaxed();
#else
return reinterpret_cast< SlotObject* >( that )->ref.load(); return reinterpret_cast< SlotObject* >( that )->ref.load();
#endif
} }
QskMetaFunction::QskMetaFunction() QskMetaFunction::QskMetaFunction()

View File

@ -49,11 +49,16 @@ namespace
ushort index, int nargs, int* types, void* args[], ushort index, int nargs, int* types, void* args[],
QSemaphore* semaphore = nullptr ) QSemaphore* semaphore = nullptr )
: QMetaCallEvent( offset, index, callFunction, nullptr, -1, : QMetaCallEvent( offset, index, callFunction, nullptr, -1,
nargs, types, args, semaphore ) #if QT_VERSION < QT_VERSION_CHECK( 5, 14, 0 )
nargs, types,
#endif
args, semaphore )
, m_call( call ) , m_call( call )
, m_callFunction( callFunction ) , m_callFunction( callFunction )
, m_index( index ) , m_index( index )
{ {
Q_UNUSED( nargs )
Q_UNUSED( types )
} }
void placeMetaCall( QObject* object ) override void placeMetaCall( QObject* object ) override