Support multi-line input in the python shell

This commit is contained in:
baldurk
2017-11-20 15:11:50 +00:00
parent 31b7662db1
commit 657c343ac8
6 changed files with 48 additions and 10 deletions
@@ -49,3 +49,17 @@ void RDLineEdit::keyPressEvent(QKeyEvent *e)
QLineEdit::keyPressEvent(e);
emit(keyPress(e));
}
bool RDLineEdit::event(QEvent *e)
{
if(m_acceptTabs && e->type() == QEvent::KeyPress)
{
QKeyEvent *ke = (QKeyEvent *)e;
if(ke->key() == Qt::Key_Tab)
{
insert(lit("\t"));
return true;
}
}
return QLineEdit::event(e);
}