diff options
Diffstat (limited to 'client/widgets/lineedit.cc')
| -rw-r--r-- | client/widgets/lineedit.cc | 16 | 
1 files changed, 16 insertions, 0 deletions
| diff --git a/client/widgets/lineedit.cc b/client/widgets/lineedit.cc index 49b3704..7c2558b 100644 --- a/client/widgets/lineedit.cc +++ b/client/widgets/lineedit.cc @@ -48,6 +48,8 @@ LineEdit::LineEdit(QDomNode &node, MacroWindow *macrowindow)    connect(this, SIGNAL(textChanged(QString)), this, SLOT(changed()));    connect(this, SIGNAL(textEdited(QString)), this, SLOT(user_changed())); + +  installEventFilter(this); // Detect keyboard input.  }  void LineEdit::changed() @@ -127,3 +129,17 @@ void LineEdit::setVisibility(bool visible)  {    setVisible(visible);  } + + +#include <QCoreApplication> +bool LineEdit::eventFilter(QObject *, QEvent *event) +{ +  if (event->type() == QEvent::KeyPress) { +    QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); +    if(keyEvent->key() == Qt::Key_Return) { +      QKeyEvent tabevent(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier);  +      QCoreApplication::sendEvent(this, &tabevent); +    } +  } +  return false; +} | 
