For a block invoke to another thread, safe and restore

* In future we could handle async exceptions by storing the exception
  information in a std::function derived object (instead of the separate
  ExceptionHandling that lives on the stack) and query it out in a new
  WaitForInvoke function maybe. Right now we just print the exception
  to the output log and abort the callback.
This commit is contained in:
baldurk
2017-08-03 17:57:23 +01:00
parent 1c93ee9441
commit 87ef595cce
6 changed files with 88 additions and 17 deletions
@@ -89,6 +89,8 @@ public:
}
static QWidget *QWidgetFromPy(PyObject *widget);
void setThreadBlocking(bool block) { m_Block = block; }
bool threadBlocking() { return m_Block; }
void abort() { m_Abort = true; }
bool shouldAbort() { return m_Abort; }
QString currentFile() { return location.file; }
@@ -128,6 +130,8 @@ private:
bool m_Abort = false;
bool m_Block = false;
static PyObject *QtObjectToPython(PyObject *self, const char *typeName, QObject *object);
QTimer *outputTicker;