author | alwin <alwin> | 2004-02-27 00:50:00 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-02-27 00:50:00 (UTC) |
commit | 8de117d74a9a0672ae6ec809a1a17fdb29226290 (patch) (side-by-side diff) | |
tree | 2eb665bd120937c13fa215c5f45ab6361df9ee85 | |
parent | cb7a0156d641e96dfb6fe1cea6ca3a26e54ce6b2 (diff) | |
download | opie-8de117d74a9a0672ae6ec809a1a17fdb29226290.zip opie-8de117d74a9a0672ae6ec809a1a17fdb29226290.tar.gz opie-8de117d74a9a0672ae6ec809a1a17fdb29226290.tar.bz2 |
viewmail window will close on escape pressed
-rw-r--r-- | noncore/net/mail/viewmailbase.cpp | 10 | ||||
-rw-r--r-- | noncore/net/mail/viewmailbase.h | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/noncore/net/mail/viewmailbase.cpp b/noncore/net/mail/viewmailbase.cpp index 153ba9d..7f1d8a0 100644 --- a/noncore/net/mail/viewmailbase.cpp +++ b/noncore/net/mail/viewmailbase.cpp @@ -78,5 +78,13 @@ void ViewMailBase::slotChangeAttachview(bool state) if (state) attachments->show(); else attachments->hide(); } - +void ViewMailBase::keyPressEvent ( QKeyEvent * e ) +{ + if( e->key()==Qt::Key_Escape ) { + close(); + e->accept(); + return; + } + QWidget::keyPressEvent(e); +} diff --git a/noncore/net/mail/viewmailbase.h b/noncore/net/mail/viewmailbase.h index 6d2a5b2..fdaad2a 100644 --- a/noncore/net/mail/viewmailbase.h +++ b/noncore/net/mail/viewmailbase.h @@ -28,8 +28,9 @@ protected: QPopupMenu *mailmenu; protected slots: void slotChangeAttachview(bool state); + virtual void keyPressEvent ( QKeyEvent * e ); }; |