add qCallQueuedL()
This commit is contained in:
@@ -347,10 +347,13 @@ T qDeserialize(const QByteArray & data, int version = -1) {
|
|||||||
/// qCallQueued(this, &MyClass::myFuncWithIntAndString, 0xAB, "string");
|
/// qCallQueued(this, &MyClass::myFuncWithIntAndString, 0xAB, "string");
|
||||||
template<typename O, typename F, typename... Args>
|
template<typename O, typename F, typename... Args>
|
||||||
void qCallQueued(O * o, F f, Args... args) {
|
void qCallQueued(O * o, F f, Args... args) {
|
||||||
QMetaObject::invokeMethod(
|
QMetaObject::invokeMethod(o, [o, f, args...]() { (o->*f)(args...); }, Qt::QueuedConnection);
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user