Compare commits

...

2 Commits

Author SHA1 Message Date
07369cf3ec Merge branch 'master' of https://git.shstk.ru/SHS/qad 2026-03-25 18:47:27 +03:00
92cc2ad9a2 add qCallQueuedL() 2026-03-25 18:47:21 +03:00

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);
}