Compare commits

...

3 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
b1852ab1fa fix missing include 2026-03-20 21:29:59 +03:00
2 changed files with 8 additions and 4 deletions

View File

@@ -26,6 +26,7 @@
#include <QSqlError>
#include <QSqlQuery>
#include <QVariant>
#include <functional>
namespace QAD {

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