Add helper to invoke back onto the UI thread from the replay thread

This commit is contained in:
baldurk
2020-12-03 14:17:42 +00:00
parent a8a40ca3d6
commit 0d1f6e3940
4 changed files with 28 additions and 0 deletions
+6
View File
@@ -85,6 +85,12 @@ struct MiniQtInvoker : ObjectForwarder<IMiniQtHelper>
{
MiniQtInvoker(PythonShell *shell, IMiniQtHelper &obj) : ObjectForwarder(shell, obj) {}
virtual ~MiniQtInvoker() {}
void InvokeOntoUIThread(std::function<void()> callback)
{
// this function is already thread safe since it's invoking, so just call it directly
m_Obj.InvokeOntoUIThread(callback);
}
///////////////////////////////////////////////////////////////////////
// all functions invoke onto the UI thread since they deal with widgets!
///////////////////////////////////////////////////////////////////////