Add simple tab-completion in interactive python shell

This commit is contained in:
baldurk
2017-12-25 15:05:30 +00:00
parent 16f64a5ace
commit a7398525b2
4 changed files with 286 additions and 1 deletions
@@ -87,6 +87,8 @@ public:
static PyObject *QWidgetToPy(QWidget *widget) { return QtObjectToPython("QWidget", widget); }
static QWidget *QWidgetFromPy(PyObject *widget);
QStringList completionOptions(QString base);
void setThreadBlocking(bool block) { m_Block = block; }
bool threadBlocking() { return m_Block; }
void abort() { m_Abort = true; }
@@ -116,6 +118,9 @@ private:
// globals are set into and any scripts execute in
PyObject *context_namespace = NULL;
// a rlcompleter.Completer object used for tab-completion
PyObject *m_Completer = NULL;
// this is set during an execute, so we can identify when a callback happens within our execute or
// not
PyThreadState *m_State = NULL;