Compare commits
3 Commits
dd4695780d
...
26a656a9a0
| Author | SHA1 | Date | |
|---|---|---|---|
| 26a656a9a0 | |||
| 6153c1d8dd | |||
| 744d689eee |
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user