Invoke CaptureContext function calls onto UI thread, from python thread

* Any work that might use Qt needs to happen on the UI thread, so when
  running a python script on the python thread we need to invoke across.
  We wrap the main ICaptureContext interface to block invoke onto the UI
  for any function calls that aren't just returning internal data.
This commit is contained in:
baldurk
2017-06-09 17:00:28 +01:00
parent 21836c240d
commit 1cc2c22195
4 changed files with 331 additions and 6 deletions
+3
View File
@@ -36,6 +36,8 @@ namespace Ui
class PythonShell;
}
struct CaptureContextInvoker;
class PythonShell : public QFrame, public IPythonShell
{
Q_OBJECT
@@ -66,6 +68,7 @@ private slots:
private:
Ui::PythonShell *ui;
ICaptureContext &m_Ctx;
CaptureContextInvoker *m_ThreadCtx = NULL;
ScintillaEdit *scriptEditor;