From 92cc2ad9a28af6eebb94cb516d2fe7c6af2d3122 Mon Sep 17 00:00:00 2001 From: peri4 Date: Wed, 25 Mar 2026 18:47:21 +0300 Subject: [PATCH] add qCallQueuedL() --- libs/utils/qad_types.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libs/utils/qad_types.h b/libs/utils/qad_types.h index 8749bf8..047640c 100644 --- a/libs/utils/qad_types.h +++ b/libs/utils/qad_types.h @@ -347,10 +347,13 @@ T qDeserialize(const QByteArray & data, int version = -1) { /// qCallQueued(this, &MyClass::myFuncWithIntAndString, 0xAB, "string"); template void qCallQueued(O * o, F f, Args... args) { - QMetaObject::invokeMethod( - o, - [o, f, args...]() { (o->*f)(args...); }, - Qt::QueuedConnection); + QMetaObject::invokeMethod(o, [o, f, args...]() { (o->*f)(args...); }, Qt::QueuedConnection); +} + +/// qCallQueued with lambda +template +void qCallQueuedL(O * o, L func) { + QMetaObject::invokeMethod(o, [func] { func(); }, Qt::QueuedConnection); }