* src/frontends/qt4/QCitationDialog.[Ch]:
- implement KeyPressEvent, catch ESC key and clear params there as well
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16594
a592a061-630c-0410-9148-
cb99ea01b6c8
#include <string>
#include <QCloseEvent>
+#include <QKeyEvent>
using std::vector;
using std::string;
setWindowTitle(toqstr("LyX: " + getTitle()));
- selectedLV->setModel(form_->selected());
+ selectedLV->setModel(form_->selected());
availableLV->setModel(form_->available());
connect(citationStyleCO, SIGNAL(activated(int)),
}
+void QCitationDialog::keyPressEvent(QKeyEvent * event)
+{
+ if (event->key() == Qt::Key_Escape) {
+ form_->clearSelection();
+ form_->clearParams();
+ event->accept();
+ close();
+ } else
+ event->ignore();
+}
+
+
void QCitationDialog::closeEvent(QCloseEvent * e)
{
form_->clearSelection();
#include "ui/QCitationUi.h"
#include <QCloseEvent>
+#include <QKeyEvent>
namespace lyx {
namespace frontend {
protected:
void closeEvent (QCloseEvent * e);
+ void keyPressEvent (QKeyEvent * event);
protected Q_SLOTS: