Correctly fake keyPressEvent for tabs and returns

since we need to filter for incorrect comma usage, we need to
recurse instead of passing the keyEvent to the base class.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-07-10 13:19:58 -03:00 committed by Dirk Hohndel
parent 37fa2fda03
commit 29b35ad6d8

View file

@ -182,7 +182,7 @@ void TagWidget::keyPressEvent(QKeyEvent *e)
MainWindow::instance()->information()->nextInputField(e); // by sending the key event to the MainTab widget MainWindow::instance()->information()->nextInputField(e); // by sending the key event to the MainTab widget
} else if (e->key() == Qt::Key_Tab || e->key() == Qt::Key_Return) { // otherwise let's pretend this is a comma instead } else if (e->key() == Qt::Key_Tab || e->key() == Qt::Key_Return) { // otherwise let's pretend this is a comma instead
QKeyEvent fakeEvent(e->type(), Qt::Key_Comma, e->modifiers(), QString(",")); QKeyEvent fakeEvent(e->type(), Qt::Key_Comma, e->modifiers(), QString(","));
GroupedLineEdit::keyPressEvent(&fakeEvent); keyPressEvent(&fakeEvent);
} else { } else {
GroupedLineEdit::keyPressEvent(e); GroupedLineEdit::keyPressEvent(e);
} }