src/hbwidgets/widgets/hbcombobox_p.cpp
changeset 1 f7ac710697a9
parent 0 16d8024aca5e
child 2 06ff229162e9
--- a/src/hbwidgets/widgets/hbcombobox_p.cpp	Mon Apr 19 14:02:13 2010 +0300
+++ b/src/hbwidgets/widgets/hbcombobox_p.cpp	Mon May 03 12:48:33 2010 +0300
@@ -45,6 +45,8 @@
 #define HB_DROPD0WN_ITEM_TYPE "HB_DROPDOWN"
 #endif
 
+#include <hbtapgesture.h>
+
 HbComboBoxPrivate::HbComboBoxPrivate( ):
     HbWidgetPrivate (  ),
     mLineEdit ( 0 ),
@@ -90,6 +92,7 @@
 {
     Q_Q( HbComboBox );
 
+
     mTextItem = q->style()->createPrimitive( HbStyle::P_ComboBox_text, q );
     HbStyle::setItemName( mTextItem, "combobox_labelfield" );
 
@@ -103,10 +106,12 @@
                                             HbStyle::P_ComboBoxButton_toucharea, q );
     static_cast<HbTouchArea*>(mButtonTouchAreaItem)->installEventFilter( q );
     q->setHandlesChildEvents(true);
+
+    static_cast<HbTouchArea*>(mButtonTouchAreaItem)->grabGesture( Qt::TapGesture );
 }
 
 void HbComboBoxPrivate::touchAreaPressEvent( )
-{
+{    
     Q_Q( HbComboBox );
     if (q->count() > 0) {
         HbWidgetFeedback::triggered(q, Hb::InstantPressed);
@@ -134,6 +139,7 @@
     Q_Q( HbComboBox );
     if ( mModel && mModel->rowCount( ) ) {
         addDropDownToScene();
+        mDropDown->setVisible( true );
         if( !mDropDown->mList ) {
             mDropDown->createList( );
             mDropDown->mList->setModel( mModel );            
@@ -156,8 +162,7 @@
         #ifdef HB_EFFECTS
                HbEffect::start(mDropDown, HB_DROPD0WN_ITEM_TYPE, "appear");
         #endif
-        positionDropDown( );
-        mDropDown->setVisible( true );
+        positionDropDown( );        
     }
 }
 
@@ -184,6 +189,7 @@
             mDropDown->createList();            
             q->connect( mDropDown->mList, SIGNAL( activated( QModelIndex ) ), q,
                         SLOT( _q_textChanged( QModelIndex ) ) );
+            
         }
         mDropDown->mList->setModel( aModel );
         if ( aIndex.isValid( ) ) {
@@ -544,6 +550,7 @@
         if( scene1 )
         {
             scene1->installEventFilter( mDropDown );
+            //scene1->grabGesture( Qt::TapGesture );
         }
         mIsDropwnToSceneAdded = true;
     }
@@ -575,7 +582,7 @@
 }
 
 void HbComboBoxPrivate::currentIndexChanged( const QModelIndex &index )
-{
+{    
     Q_Q( HbComboBox );
     emit q->currentIndexChanged( index.row( ) );    
     emit q->currentIndexChanged( q->itemText ( mCurrentIndex.row( ) ) );