author | zautrix <zautrix> | 2005-03-30 23:17:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-30 23:17:42 (UTC) |
commit | 529c0fb8a8bf15e7bd375ddeb355c5802baf4c93 (patch) (side-by-side diff) | |
tree | 72ebca6de7e54f2cf89d3d6df61d3b40aa66a444 /kaddressbook/views/cardview.cpp | |
parent | 28ac86e2efbc10f210dbd2d5ac0053f4e6198d57 (diff) | |
download | kdepimpi-529c0fb8a8bf15e7bd375ddeb355c5802baf4c93.zip kdepimpi-529c0fb8a8bf15e7bd375ddeb355c5802baf4c93.tar.gz kdepimpi-529c0fb8a8bf15e7bd375ddeb355c5802baf4c93.tar.bz2 |
key fix
Diffstat (limited to 'kaddressbook/views/cardview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kaddressbook/views/cardview.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/kaddressbook/views/cardview.cpp b/kaddressbook/views/cardview.cpp index 03df444..84d3116 100644 --- a/kaddressbook/views/cardview.cpp +++ b/kaddressbook/views/cardview.cpp @@ -33,6 +33,7 @@ #include <qstyle.h> #include <qcursor.h> #include <qtooltip.h> +#include <qapplication.h> #include "kabprefs.h" #include <kdebug.h> @@ -639,6 +640,8 @@ CardView::CardView(QWidget *parent, const char *name) : QScrollView(parent, name), d(new CardViewPrivate()) { + mFlagKeyPressed = false; + mFlagBlockKeyPressed = false; d->mItemList.setAutoDelete(true); d->mSeparatorList.setAutoDelete(true); @@ -1351,7 +1354,15 @@ void CardView::keyPressEvent( QKeyEvent *e ) e->ignore(); return; } - + if ( mFlagBlockKeyPressed ) + return; + qApp->processEvents(); + if ( e->isAutoRepeat() && !mFlagKeyPressed ) { + e->accept(); + return; + } + if (! e->isAutoRepeat() ) + mFlagKeyPressed = true; uint pos = d->mItemList.findRef( d->mCurrentItem ); CardViewItem *aItem = 0L; // item that gets the focus CardViewItem *old = d->mCurrentItem; @@ -1715,6 +1726,24 @@ void CardView::setMaxFieldLines( int howmany ) d->mMaxFieldLines = howmany ? howmany : INT_MAX; // FIXME update, forcing the items to recalc height!! } + +void CardView::keyReleaseEvent ( QKeyEvent * e ) +{ + if ( mFlagBlockKeyPressed ) + return; + if ( !e->isAutoRepeat() ) { + mFlagBlockKeyPressed = true; + qApp->processEvents(); + mFlagBlockKeyPressed = false; + mFlagKeyPressed = false; + } + QScrollView::keyReleaseEvent ( e ); +} + + + + + //END Cardview #ifndef KAB_EMBEDDED |