rssguard/src/librssguard/gui/baselineedit.cpp
2019-06-10 09:54:18 +02:00

25 lines
534 B
C++

// For license of this file, see <project-root-folder>/LICENSE.md.
#include "gui/baselineedit.h"
#include <QKeyEvent>
BaseLineEdit::BaseLineEdit(QWidget* parent) : QLineEdit(parent) {}
BaseLineEdit::~BaseLineEdit() {}
void BaseLineEdit::submit(const QString& text) {
setText(text);
emit submitted(text);
}
void BaseLineEdit::keyPressEvent(QKeyEvent* event) {
if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
emit submitted(text());
event->accept();
}
QLineEdit::keyPressEvent(event);
}