Esempio n. 1
0
void CustomQLineEdit::keyPressEvent(QKeyEvent *e)
{
	if (e->key() == Qt::Key_Escape)
		emit editingCanceled();	
	else
		QLineEdit::keyPressEvent(e);	
}
Esempio n. 2
0
void EscapableLineEdit::keyPressEvent(QKeyEvent* event)
{

	if (event->key() == Qt::Key_Escape)
		emit editingCanceled();
	else
		QLineEdit::keyPressEvent(event);
}
Esempio n. 3
0
void TextEdit::keyPressEvent(QKeyEvent *event)
{
  if (event->key() == Qt::Key_Escape) {
    emit editingCanceled();
    event->ignore();
    return;
  }

  QTextEdit::keyPressEvent(event);
}