using nullptr for QSemaphore instead of a different call

This commit is contained in:
Uwe Rathmann 2024-01-29 12:21:46 +01:00
parent e058886fcb
commit 7ab5c50b3d
2 changed files with 10 additions and 14 deletions

View File

@ -7,9 +7,7 @@
#include <qcoreapplication.h>
#include <qobject.h>
#if QT_CONFIG(thread)
#include <qsemaphore.h>
#endif
#include <qthread.h>
QSK_QT_PRIVATE_BEGIN
@ -190,8 +188,6 @@ void QskMetaFunction::invoke( QObject* object,
? Qt::QueuedConnection : Qt::DirectConnection;
}
const auto argc = parameterCount() + 1; // return value + arguments
switch ( invokeType )
{
case Qt::DirectConnection:
@ -215,7 +211,7 @@ void QskMetaFunction::invoke( QObject* object,
m_functionCall, nullptr, 0, argv, &semaphore );
#else
auto event = new QMetaCallEvent(
m_functionCall, nullptr, 0, argc );
m_functionCall, nullptr, 0, argv, nullptr );
#endif
QCoreApplication::postEvent( receiver, event );
@ -231,6 +227,8 @@ void QskMetaFunction::invoke( QObject* object,
if ( receiver.isNull() )
return;
const auto argc = parameterCount() + 1; // return value + arguments
auto event = new QMetaCallEvent( m_functionCall, nullptr, 0, argc );
auto types = event->types();

View File

@ -9,9 +9,7 @@
#include <qmetaobject.h>
#include <qobject.h>
#include <qcoreapplication.h>
#if QT_CONFIG(thread)
#include <qsemaphore.h>
#endif
#include <qthread.h>
QSK_QT_PRIVATE_BEGIN
@ -165,12 +163,6 @@ static void qskInvokeMetaCall(
? Qt::QueuedConnection : Qt::DirectConnection;
}
#if 1
// should be doable without QMetaMethod. TODO ...
const auto method = metaObject->method( offset + index );
#endif
const int argc = method.parameterCount() + 1;
switch ( invokeType )
{
case Qt::DirectConnection:
@ -208,7 +200,7 @@ static void qskInvokeMetaCall(
#else
auto event = new MetaCallEvent( call, metaObject,
offset, index, argc );
offset, index, args, nullptr );
#endif
QCoreApplication::postEvent( receiver, event );
@ -228,6 +220,12 @@ static void qskInvokeMetaCall(
if ( call == QMetaObject::InvokeMetaMethod )
{
#if 1
// should be doable without QMetaMethod. TODO ...
const auto method = metaObject->method( offset + index );
#endif
const int argc = method.parameterCount() + 1;
event = new MetaCallEvent( call, metaObject, offset, index, argc );
/*