add qCallQueuedL()

This commit is contained in:
2026-03-25 18:47:21 +03:00
parent b4e77d136a
commit 92cc2ad9a2

View File

@@ -347,10 +347,13 @@ T qDeserialize(const QByteArray & data, int version = -1) {
/// qCallQueued(this, &MyClass::myFuncWithIntAndString, 0xAB, "string");
template<typename O, typename F, typename... Args>
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<typename O, typename L>
void qCallQueuedL(O * o, L func) {
QMetaObject::invokeMethod(o, [func] { func(); }, Qt::QueuedConnection);
}