diff --git a/src/frontends/qt4/FindAndReplace.cpp b/src/frontends/qt4/FindAndReplace.cpp index 3419b09ad3..e91c3af639 100644 --- a/src/frontends/qt4/FindAndReplace.cpp +++ b/src/frontends/qt4/FindAndReplace.cpp @@ -89,7 +89,7 @@ bool FindAndReplaceWidget::eventFilter(QObject *obj, QEvent *event) QKeyEvent *e = static_cast (event); if (e->key() == Qt::Key_Escape && e->modifiers() == Qt::NoModifier) { - on_closePB_clicked(); + hideDialog(); return true; } else if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) { @@ -112,7 +112,7 @@ bool FindAndReplaceWidget::eventFilter(QObject *obj, QEvent *event) QKeyEvent *e = static_cast (event); if (e->key() == Qt::Key_Escape && e->modifiers() == Qt::NoModifier) { - on_closePB_clicked(); + hideDialog(); return true; } else if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) { @@ -519,7 +519,7 @@ void FindAndReplaceWidget::insertRegexp(QAction * action) } -void FindAndReplaceWidget::on_closePB_clicked() +void FindAndReplaceWidget::hideDialog() { dispatch(FuncRequest(LFUN_DIALOG_TOGGLE, "findreplaceadv")); } diff --git a/src/frontends/qt4/FindAndReplace.h b/src/frontends/qt4/FindAndReplace.h index b4bc3e1a84..b9c82042e8 100644 --- a/src/frontends/qt4/FindAndReplace.h +++ b/src/frontends/qt4/FindAndReplace.h @@ -64,13 +64,14 @@ private: void virtual showEvent(QShowEvent *ev); void virtual hideEvent(QHideEvent *ev); + void hideDialog(); + protected Q_SLOTS: void on_findNextPB_clicked(); void on_findPrevPB_clicked(); void on_replaceNextPB_clicked(); void on_replacePrevPB_clicked(); void on_replaceallPB_clicked(); - void on_closePB_clicked(); void insertRegexp(QAction *); };