diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index 7c89f48d0..e1e9e1322 100644 --- a/UI/obs-app.cpp +++ b/UI/obs-app.cpp @@ -1241,12 +1241,21 @@ void OBSApp::EnableInFocusHotkeys(bool enable) ResetHotkeyState(applicationState() != Qt::ApplicationActive); } +Q_DECLARE_METATYPE(VoidFunc) + +void OBSApp::Exec(VoidFunc func) +{ + func(); +} + bool OBSApp::OBSInit() { ProfileScope("OBSApp::OBSInit"); setAttribute(Qt::AA_UseHighDpiPixmaps); + qRegisterMetaType(); + if (!StartupOBS(locale.c_str(), GetProfilerNameStore())) return false; diff --git a/UI/obs-app.hpp b/UI/obs-app.hpp index 27b6cc3e7..281533147 100644 --- a/UI/obs-app.hpp +++ b/UI/obs-app.hpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -58,6 +59,8 @@ public: const char *disambiguation, int n) const override; }; +typedef std::function VoidFunc; + class OBSApp : public QApplication { Q_OBJECT @@ -166,6 +169,9 @@ public: translatorHooks.pop_front(); } +public slots: + void Exec(VoidFunc func); + signals: void StyleChanged(); };