diff -r e6ad4ef83b23 -r b7da29130b0e src/hbwidgets/widgets/hbcombodropdown_p.cpp --- a/src/hbwidgets/widgets/hbcombodropdown_p.cpp Thu Sep 02 20:44:51 2010 +0300 +++ b/src/hbwidgets/widgets/hbcombodropdown_p.cpp Fri Sep 17 08:32:10 2010 +0300 @@ -61,7 +61,6 @@ void HbComboDropDown::createList( ) { mList = new HbListView( this ); - mList->setLongPressEnabled( false ); HbComboListViewItem *protoType = new HbComboListViewItem( this ); mList->setItemPrototype( protoType ); HbStyle::setItemName( mList, "list" ); @@ -89,44 +88,6 @@ if ( isVisible( ) ) { switch( event->type( ) ) { - case QEvent::GraphicsSceneMousePress: - case QEvent::GraphicsSceneMouseDoubleClick: - { - if( !vkbOpened ) { - //if vkb is not opened and dropdown is not clicked then dismiss drop down - if( !( this->isUnderMouse( ) ) ) { - HbWidgetFeedback::triggered( this, Hb::InstantPopupClosed ); - setVisible( false ); - comboPrivate->q_ptr->setProperty("state","normal"); - backgroundPressed = true; - accepted = true; - } - } else { - //if vkb is opened then dismiss drop down only if click happened outside drop down and - //vkb area - if( comboPrivate->mEditable ) { - HbEditorInterface editorInterface( comboPrivate->q_ptr ); - HbVkbHost *host = editorInterface.vkbHost( ); - if( host ) { - //get the scene rect of vkb - QGraphicsWidget *vkbWidget = host->activeKeypad( )->asGraphicsWidget( ); - QRectF tmp = host->applicationArea( ); - QRectF vkbArea = vkbWidget->mapToScene( tmp ).boundingRect( ); - QGraphicsSceneMouseEvent *mouseEvent = - static_cast< QGraphicsSceneMouseEvent * >( event ); - if( !( this->isUnderMouse( ) ) && - !vkbArea.contains( mouseEvent->scenePos( ) ) ) { - HbWidgetFeedback::triggered( this, Hb::InstantPopupClosed ); - setVisible( false ); - comboPrivate->q_ptr->setProperty( "state", "normal" ); - backgroundPressed = true; - accepted = true; - } - } - } - } - } - break; case QEvent::Gesture: { if( !this->isUnderMouse( ) ) { @@ -135,10 +96,46 @@ //dropdown area if( QGestureEvent *gestureEvent = static_cast( event ) ) { HbTapGesture *tapGesture = qobject_cast(gestureEvent->gesture(Qt::TapGesture)); - if( !qobject_cast( - gestureEvent->gesture( Qt::PanGesture ) ) && - !(tapGesture && tapGesture->state() != Qt::GestureStarted)) { - accepted = true; + if( tapGesture && tapGesture->state() == Qt::GestureStarted ) { + if( !vkbOpened ) { + //if vkb is not opened and dropdown is not clicked then dismiss drop down + if( !( this->isUnderMouse( ) ) ) { + HbWidgetFeedback::triggered( this, Hb::InstantPopupClosed ); + setVisible( false ); + comboPrivate->q_ptr->setProperty("state","normal"); + backgroundPressed = true; + accepted = true; + } + } else { + //if vkb is opened then dismiss drop down only if click happened outside drop down and + //vkb area + if( comboPrivate->mEditable ) { + HbEditorInterface editorInterface( comboPrivate->q_ptr ); + HbVkbHost *host = editorInterface.vkbHost( ); + if( host ) { + //get the scene rect of vkb + QGraphicsWidget *vkbWidget = host->activeKeypad( )->asGraphicsWidget( ); + QRectF tmp = host->applicationArea( ); + QRectF vkbArea = vkbWidget->mapToScene( tmp ).boundingRect( ); + //QGraphicsSceneMouseEvent *mouseEvent = + // static_cast< QGraphicsSceneMouseEvent * >( event ); + if( !( this->isUnderMouse( ) ) && + !vkbArea.contains( /*mouseEvent->scenePos( )*/ tapGesture->sceneStartPos() ) ) { + HbWidgetFeedback::triggered( this, Hb::InstantPopupClosed ); + setVisible( false ); + comboPrivate->q_ptr->setProperty( "state", "normal" ); + backgroundPressed = true; + accepted = true; + } + } + } + } + } else { + if( !qobject_cast( + gestureEvent->gesture( Qt::PanGesture ) ) && + !(tapGesture && tapGesture->state() != Qt::GestureStarted)) { + accepted = true; + } } } }