Diffstat (limited to 'kaddressbook/views/contactlistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/views/contactlistview.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/kaddressbook/views/contactlistview.cpp b/kaddressbook/views/contactlistview.cpp index e75810e..09d9c03 100644 --- a/kaddressbook/views/contactlistview.cpp +++ b/kaddressbook/views/contactlistview.cpp @@ -29,6 +29,7 @@ #include <qpainter.h> #include <qbrush.h> #include <qevent.h> +#include <qapplication.h> #include <klocale.h> #include <kglobalsettings.h> @@ -248,6 +249,8 @@ ContactListView::ContactListView(KAddressBookTableView *view, pabWidget( view ), oldColumn( 0 ) { + mFlagBlockKeyPressed = false; + mFlagKeyPressed = false; mABackground = true; mSingleLine = false; mToolTips = true; @@ -395,6 +398,32 @@ void ContactListView::setBackgroundPixmap(const QString &filename) } } + +void ContactListView::keyPressEvent ( QKeyEvent * e ) +{ + if ( mFlagBlockKeyPressed ) + return; + qApp->processEvents(); + if ( e->isAutoRepeat() && !mFlagKeyPressed ) { + e->accept(); + return; + } + if (! e->isAutoRepeat() ) + mFlagKeyPressed = true; + KListView::keyPressEvent ( e ); +} +void ContactListView::keyReleaseEvent ( QKeyEvent * e ) +{ + if ( mFlagBlockKeyPressed ) + return; + if ( !e->isAutoRepeat() ) { + mFlagBlockKeyPressed = true; + qApp->processEvents(); + mFlagBlockKeyPressed = false; + mFlagKeyPressed = false; + } + KListView::keyReleaseEvent ( e ); +} #ifndef KAB_EMBEDDED #include "contactlistview.moc" #endif //KAB_EMBEDDED |