summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views/cardview.cpp
authorzautrix <zautrix>2004-10-29 10:42:31 (UTC)
committer zautrix <zautrix>2004-10-29 10:42:31 (UTC)
commitd96b4fd7188145c49120dd159b0ac00c987f4972 (patch) (side-by-side diff)
treeba8f3910a72938aa44aa82a477bbd84f5414a214 /kaddressbook/views/cardview.cpp
parente152dd9c19c69e6efff6c593b2bf081bc426c7d5 (diff)
downloadkdepimpi-d96b4fd7188145c49120dd159b0ac00c987f4972.zip
kdepimpi-d96b4fd7188145c49120dd159b0ac00c987f4972.tar.gz
kdepimpi-d96b4fd7188145c49120dd159b0ac00c987f4972.tar.bz2
made cardview handling singleclick and return pressed
Diffstat (limited to 'kaddressbook/views/cardview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/views/cardview.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/kaddressbook/views/cardview.cpp b/kaddressbook/views/cardview.cpp
index 65f793c..6351c11 100644
--- a/kaddressbook/views/cardview.cpp
+++ b/kaddressbook/views/cardview.cpp
@@ -647,24 +647,25 @@ CardView::CardView(QWidget *parent, const char *name)
d->mHeaderFont = f;
d->mBFm = new QFontMetrics(f);
d->mTip = ( new CardViewTip( viewport() ) ),
d->mTip->hide();
d->mTimer = ( new QTimer(this, "mouseTimer") ),
viewport()->setMouseTracking( true );
viewport()->setFocusProxy(this);
viewport()->setFocusPolicy(WheelFocus);
viewport()->setBackgroundMode(PaletteBase);
connect( d->mTimer, SIGNAL(timeout()), this, SLOT(tryShowFullText()) );
+ connect( this, SIGNAL(executed(CardViewItem *)), this, SIGNAL( doubleClicked(CardViewItem *)) );
//US setBackgroundMode(PaletteBackground, PaletteBase);
setBackgroundMode(PaletteBackground);
// no reason for a vertical scrollbar
setVScrollBarMode(AlwaysOff);
}
CardView::~CardView()
{
delete d->mFm;
delete d->mBFm;
@@ -1257,26 +1258,26 @@ void CardView::contentsMouseDoubleClickEvent(QMouseEvent *e)
QScrollView::contentsMouseDoubleClickEvent(e);
CardViewItem *item = itemAt(e->pos());
if (item)
{
d->mCurrentItem = item;
}
if (item && !KGlobalSettings::singleClick())
{
emit executed(item);
- }
- emit doubleClicked(item);
+ } else
+ emit doubleClicked(item);
}
void CardView::contentsMouseMoveEvent( QMouseEvent *e )
{
// resizing
if ( d->mResizeAnchor )
{
int x = e->x();
if ( x != d->mRubberBandAnchor )
drawRubberBands( x );
return;
}
@@ -1443,27 +1444,29 @@ void CardView::keyPressEvent( QKeyEvent *e )
aItem = itemAt( QPoint( theCol, d->mItemSpacing + 1 ) );
if ( aItem )
setCurrentItem( aItem );
}
break;
case Key_Space:
setSelected( d->mCurrentItem, !d->mCurrentItem->isSelected() );
emit selectionChanged();
break;
case Key_Return:
- case Key_Enter:
- emit returnPressed( d->mCurrentItem );
- emit executed( d->mCurrentItem );
+ case Key_Enter:
+ {
+ emit returnPressed( d->mCurrentItem );
+ emit executed( d->mCurrentItem );
+ }
break;
default:
if ( (e->state() & ControlButton) && e->key() == Key_A )
{
// select all
selectAll( true );
break;
}
// if we have a string, do autosearch
else if ( ! e->text().isEmpty() && e->text()[0].isPrint() )
{