forked from qt-creator/qt-creator
Close variable chooser on escape (if it has focus).
Task-number: QTCREATORBUG-4307 Change-Id: Ib85f5fda1310fe6fb0e0824488fb6c79962ae35b Reviewed-on: http://codereview.qt.nokia.com/624 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Robert Löhning <robert.loehning@nokia.com>
This commit is contained in:
@@ -35,6 +35,8 @@
|
||||
#include "variablemanager.h"
|
||||
#include "coreconstants.h"
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
using namespace Core;
|
||||
|
||||
VariableChooser::VariableChooser(QWidget *parent) :
|
||||
@@ -175,3 +177,11 @@ void VariableChooser::insertVariable(const QString &variable)
|
||||
m_plainTextEdit->activateWindow();
|
||||
}
|
||||
}
|
||||
|
||||
void VariableChooser::keyPressEvent(QKeyEvent *ke)
|
||||
{
|
||||
if (ke->key() == Qt::Key_Escape && !ke->modifiers()) {
|
||||
ke->accept();
|
||||
QTimer::singleShot(0, this, SLOT(close()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user