diff options
author | Jonas Schnelli <jonas.schnelli@include7.ch> | 2014-11-10 16:41:57 +0100 |
---|---|---|
committer | Jonas Schnelli <jonas.schnelli@include7.ch> | 2014-11-13 12:57:24 +0100 |
commit | 4a8fc152a957e54e6dd910de4382678f5c405198 (patch) | |
tree | f53a5bce4ceb32071adcadf0bdba172d0c369b96 /src/qt/rpcconsole.cpp | |
parent | 5406f61373fe93326ab1f546e4da9f4528236cc7 (diff) |
[Qt] the RPC Console should be a QWidget to make window more independent
- fix issue #5254
Diffstat (limited to 'src/qt/rpcconsole.cpp')
-rw-r--r-- | src/qt/rpcconsole.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 2d2d448b49..2defdf8bb4 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -200,7 +200,7 @@ void RPCExecutor::request(const QString &command) } RPCConsole::RPCConsole(QWidget *parent) : - QDialog(parent), + QWidget(parent), ui(new Ui::RPCConsole), clientModel(0), historyPtr(0), @@ -278,7 +278,7 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent *event) } } } - return QDialog::eventFilter(obj, event); + return QWidget::eventFilter(obj, event); } void RPCConsole::setClientModel(ClientModel *model) @@ -366,11 +366,12 @@ void RPCConsole::clear() tr("Type <b>help</b> for an overview of available commands.")), true); } -void RPCConsole::reject() +void RPCConsole::keyPressEvent(QKeyEvent *event) { - // Ignore escape keypress if this is not a seperate window - if(windowType() != Qt::Widget) - QDialog::reject(); + if(windowType() != Qt::Widget && event->key() == Qt::Key_Escape) + { + close(); + } } void RPCConsole::message(int category, const QString &message, bool html) |