1 #ifndef _POST_TO_MAIN_THREAD_H
2 #define _POST_TO_MAIN_THREAD_H 1
4 #include <QApplication>
8 // http://stackoverflow.com/questions/21646467/how-to-execute-a-functor-in-a-given-thread-in-qt-gcd-style
10 static inline void post_to_main_thread(F &&fun)
13 QObject::connect(&signalSource, &QObject::destroyed, qApp, std::move(fun));
16 #endif // !defined(_POST_TO_MAIN_THREAD_H)