mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-27 22:41:09 +00:00
Fix rest of bug 3068.
* 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
This commit is contained in:
parent
a0f2283209
commit
c2a35af243
@ -27,6 +27,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QKeyEvent>
|
||||
|
||||
using std::vector;
|
||||
using std::string;
|
||||
@ -46,7 +47,7 @@ QCitationDialog::QCitationDialog(Dialog & dialog, QCitation * form)
|
||||
|
||||
setWindowTitle(toqstr("LyX: " + getTitle()));
|
||||
|
||||
selectedLV->setModel(form_->selected());
|
||||
selectedLV->setModel(form_->selected());
|
||||
availableLV->setModel(form_->available());
|
||||
|
||||
connect(citationStyleCO, SIGNAL(activated(int)),
|
||||
@ -75,6 +76,18 @@ QCitationDialog::~QCitationDialog()
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "ui/QCitationUi.h"
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QKeyEvent>
|
||||
|
||||
namespace lyx {
|
||||
namespace frontend {
|
||||
@ -49,6 +50,7 @@ public:
|
||||
|
||||
protected:
|
||||
void closeEvent (QCloseEvent * e);
|
||||
void keyPressEvent (QKeyEvent * event);
|
||||
|
||||
protected Q_SLOTS:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user