diff -r 2a11b5b00470 -r fd64c38c277d phonebookui/pbkcommonui/src/cntcontactcardheadingitem.cpp --- a/phonebookui/pbkcommonui/src/cntcontactcardheadingitem.cpp Fri May 14 15:42:23 2010 +0300 +++ b/phonebookui/pbkcommonui/src/cntcontactcardheadingitem.cpp Thu May 27 12:45:19 2010 +0300 @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -30,6 +29,7 @@ #include #include #include +#include CntContactCardHeadingItem::CntContactCardHeadingItem(QGraphicsItem *parent) : HbWidget(parent), @@ -324,18 +324,6 @@ { primaryText = hbTrId("txt_phob_list_unnamed"); } - - /* - // prefix, first and middle - QStringList firstNameList; - firstNameList << name.prefix() << name.first() << name.middle(); - firstLineText = firstNameList.join(" ").trimmed(); - - // last and suffix - QStringList lastNameList; - lastNameList << name.last() << name.suffix(); - mSecondLineText = lastNameList.join(" ").trimmed(); - */ } // nick label @@ -383,21 +371,48 @@ emit passLongPressed(point); } +void CntContactCardHeadingItem::processShortPress(const QPointF &point) +{ + emit passShortPressed(point); +} + void CntContactCardHeadingItem::gestureEvent(QGestureEvent* event) { - QGesture *tapAndHold = event->gesture(Qt::TapAndHoldGesture); - if (tapAndHold && tapAndHold->state() == Qt::GestureFinished) { - processLongPress(static_cast(tapAndHold)->position()); + + if (HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) + { + switch (tap->state()) + { + case Qt::GestureFinished: + if (tap->tapStyleHint() == HbTapGesture::Tap && mIcon->rect().contains(mapFromScene(tap->position()))) + { + processShortPress(tap->position()); + } + break; + case Qt::GestureUpdated: + if (tap->tapStyleHint() == HbTapGesture::TapAndHold && mIcon->rect().contains(mapFromScene(tap->position()))) + { + processLongPress(tap->position()); + } + break; + default: + break; + } + event->accept(); + } + else + { + event->ignore(); } } void CntContactCardHeadingItem::initGesture() { - grabGesture(Qt::TapAndHoldGesture); + grabGesture(Qt::TapGesture); } QVariant CntContactCardHeadingItem::itemChange(GraphicsItemChange change, const QVariant &value) -{ +{ if (change == QGraphicsItem::ItemSceneHasChanged) { HbMainWindow *window = mainWindow();