Skip to content
Snippets Groups Projects
Commit 13870830 authored by stefan's avatar stefan
Browse files

QueryDialog, pressing Ctrl+Enter accepts the dialog

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@1831 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 9787231d
No related branches found
No related tags found
No related merge requests found
......@@ -18,11 +18,14 @@
//------------------------------------------------------------------------------
#include "query_dialog.hh"
#include <ost/mol/query.hh>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QKeyEvent>
#include <iostream>
#include <ost/mol/query.hh>
namespace ost { namespace gui {
......@@ -92,4 +95,11 @@ QString QueryDialog::GetQueryString() const
{
return edit_->toPlainText();
}
void QueryDialog::keyPressEvent(QKeyEvent* event){
if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) {
this->accept();
}
}
}}
......@@ -37,8 +37,13 @@ class DLLEXPORT_OST_GUI QueryDialog : public QDialog {
public:
QueryDialog(QWidget* parent=NULL);
QString GetQueryString() const;
public slots:
void OnTextChanged();
protected:
virtual void keyPressEvent(QKeyEvent* event);
private:
void Colorize();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment