mmsharing/livecommsui/lcui/src/lcview.cpp
changeset 29 36d7ded3ca23
parent 26 5554410e16f5
child 34 01f0bb65bcf1
equal deleted inserted replaced
26:5554410e16f5 29:36d7ded3ca23
   665 // -----------------------------------------------------------------------------
   665 // -----------------------------------------------------------------------------
   666 //
   666 //
   667 void LcView::gestureEvent(QGestureEvent *event)
   667 void LcView::gestureEvent(QGestureEvent *event)
   668 {
   668 {
   669     LC_QDEBUG( "livecomms [UI] -> LcView::gestureEvent()" )
   669     LC_QDEBUG( "livecomms [UI] -> LcView::gestureEvent()" )
   670     if(HbTapGesture *tap = static_cast<HbTapGesture *>(event->gesture(Qt::TapGesture))) {        
   670     if( event ){
   671         if ((tap->state() == Qt::GestureUpdated) &&
   671         // unsafe typecast but no other way to access tapstylehint from orbit
   672             (tap->tapStyleHint() == HbTapGesture::TapAndHold)) {            
   672         HbTapGesture *tap = static_cast<HbTapGesture *>(event->gesture(Qt::TapGesture));
       
   673         Qt::GestureState tapState = tap->state();
       
   674         HbTapGesture::TapStyleHint hint = tap->tapStyleHint();
       
   675         if ( tapState == Qt::GestureUpdated && hint == HbTapGesture::TapAndHold ) {            
   673             gestureLongPress(translatePointForOrientation(tap->position()));
   676             gestureLongPress(translatePointForOrientation(tap->position()));
   674         } 
   677         } else if ( tapState == Qt::GestureFinished  && hint == HbTapGesture::Tap ) {
   675         
       
   676         else if ( (tap->state() == Qt::GestureFinished ) &&
       
   677                 ( tap->tapStyleHint() == HbTapGesture::Tap)) {
       
   678         
       
   679             gestureShortPress();
   678             gestureShortPress();
   680         }        
   679         }        
   681     }
   680     }
   682     LC_QDEBUG( "livecomms [UI] <- LcView::gestureEvent()" )
   681     LC_QDEBUG( "livecomms [UI] <- LcView::gestureEvent()" )
   683 }
   682 }
   753 {
   752 {
   754     LC_QDEBUG( "livecomms [UI] -> LcView::createContextMenu()" )
   753     LC_QDEBUG( "livecomms [UI] -> LcView::createContextMenu()" )
   755 
   754 
   756     // mItemContextMenu is destroyed upon close 
   755     // mItemContextMenu is destroyed upon close 
   757     mItemContextMenu = new HbMenu();
   756     mItemContextMenu = new HbMenu();
   758     mItemContextMenu->setDismissPolicy(HbDialog::TapOutside);
   757     mItemContextMenu->setDismissPolicy(HbMenu::TapAnywhere);
   759     mItemContextMenu->setTimeout(HbDialog::ContextMenuTimeout);
   758     mItemContextMenu->setTimeout(HbMenu::ContextMenuTimeout);
   760     mItemContextMenu->setAttribute(Qt::WA_DeleteOnClose);
   759     mItemContextMenu->setAttribute(Qt::WA_DeleteOnClose);
   761     
   760     
   762     LC_QDEBUG( "livecomms [UI] <- LcView::createContextMenu()" )
   761     LC_QDEBUG( "livecomms [UI] <- LcView::createContextMenu()" )
   763 }
   762 }
   764     
   763