Compare commits

...

3 Commits

Author SHA1 Message Date
26a656a9a0 version 2.31.0 2024-10-15 15:05:41 +03:00
6153c1d8dd move qCallQueued 2024-10-14 18:42:29 +03:00
744d689eee add qCallQueued 2024-10-14 18:36:04 +03:00
2 changed files with 15 additions and 1 deletions

View File

@@ -3,7 +3,7 @@ cmake_policy(SET CMP0017 NEW) # need include() with .cmake
cmake_policy(SET CMP0072 NEW) # FindOpenGL prefers GLVND by default
project(QAD)
set(QAD_MAJOR 2)
set(QAD_MINOR 30)
set(QAD_MINOR 31)
set(QAD_REVISION 0)
set(QAD_SUFFIX )
set(QAD_COMPANY SHS)

View File

@@ -340,4 +340,18 @@ T qDeserialize(const QByteArray & data, int version = -1) {
}
/// much more compact and easy to use alternative to QMetaObject::invokeMethod(... , Qt::QueuedConnection)
/// examples:
/// qCallQueued(this, &MyClass::myFunc);
/// qCallQueued(this, &MyClass::myFuncWithInt, 0xFF);
/// 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);
}
#endif // QAD_TYPES_H