void CustomQLineEdit::keyPressEvent(QKeyEvent *e) { if (e->key() == Qt::Key_Escape) emit editingCanceled(); else QLineEdit::keyPressEvent(e); }
void EscapableLineEdit::keyPressEvent(QKeyEvent* event) { if (event->key() == Qt::Key_Escape) emit editingCanceled(); else QLineEdit::keyPressEvent(event); }
void TextEdit::keyPressEvent(QKeyEvent *event) { if (event->key() == Qt::Key_Escape) { emit editingCanceled(); event->ignore(); return; } QTextEdit::keyPressEvent(event); }