Fix minor code issues

This commit is contained in:
Jonas Kvinge
2019-09-15 20:27:32 +02:00
parent 83e10aac27
commit 2d67279180
147 changed files with 644 additions and 329 deletions

View File

@@ -27,11 +27,10 @@
#include "renametablineedit.h"
RenameTabLineEdit::RenameTabLineEdit(QWidget *parent) :
QLineEdit(parent)
{
}
QLineEdit(parent) {}
void RenameTabLineEdit::keyPressEvent (QKeyEvent *e) {
if (e->key() == Qt::Key_Escape) {
e->accept();
emit EditingCanceled();
@@ -39,11 +38,16 @@ void RenameTabLineEdit::keyPressEvent (QKeyEvent *e) {
else {
QLineEdit::keyPressEvent(e);
}
}
void RenameTabLineEdit::focusOutEvent(QFocusEvent *e) {
Q_UNUSED(e);
//if the user hasn't explicitly accepted, discard the value
emit EditingCanceled();
//we don't call the default event since it will trigger editingFished()
}