28 #include <hbcombobox.h> |
28 #include <hbcombobox.h> |
29 #include <hblistview.h> |
29 #include <hblistview.h> |
30 #include <hbtoucharea.h> |
30 #include <hbtoucharea.h> |
31 #include <hbtextitem.h> |
31 #include <hbtextitem.h> |
32 #include <hbstyleoptioncombobox_p.h> |
32 #include <hbstyleoptioncombobox_p.h> |
|
33 #include <hbnamespace_p.h> |
33 #include <QStandardItemModel> |
34 #include <QStandardItemModel> |
|
35 #include <QGraphicsScene> |
34 #include <QDebug> |
36 #include <QDebug> |
35 |
37 |
36 #include <hbtapgesture.h> |
38 #include <hbtapgesture.h> |
37 |
39 |
38 |
40 |
992 } |
994 } |
993 } |
995 } |
994 } |
996 } |
995 } |
997 } |
996 |
998 |
|
999 bool HbComboBox::eventFilter( QObject *obj, QEvent *event ) |
|
1000 { |
|
1001 return HbWidget::eventFilter(obj,event); |
|
1002 } |
|
1003 |
997 /*! |
1004 /*! |
998 reimplementation. |
1005 reimplementation. |
999 */ |
1006 */ |
1000 bool HbComboBox::eventFilter( QObject* obj, QEvent* event ) |
1007 void HbComboBox::gestureEvent(QGestureEvent *event) |
1001 { |
1008 { |
1002 Q_D( HbComboBox ); |
1009 Q_D( HbComboBox ); |
1003 bool accepted = false; |
1010 |
1004 if ( !isEnabled( ) ) { |
1011 if (!isEnabled()) { |
1005 return false ; |
1012 return; |
1006 } |
1013 } |
1007 if( obj == static_cast<HbTouchArea*>( d->mButtonTouchAreaItem ) ) { |
1014 if(event->gesture(Qt::TapGesture)) { |
1008 if( event->type( ) == QEvent::Gesture ) { |
1015 HbTapGesture *tap = |
1009 QGestureEvent *gestureEvent = static_cast<QGestureEvent *>( event ); |
1016 static_cast<HbTapGesture *>(event->gesture(Qt::TapGesture)); |
1010 if( gestureEvent->gesture( Qt::TapGesture ) ) { |
1017 switch(tap->state()) { |
1011 HbTapGesture *tap = |
1018 case Qt::GestureStarted: { |
1012 static_cast<HbTapGesture *>( gestureEvent->gesture( Qt::TapGesture ) ); |
1019 scene()->setProperty(HbPrivate::OverridingGesture.latin1(),Qt::TapGesture); |
1013 switch( tap->state( ) ) { |
1020 if (!tap->property(HbPrivate::ThresholdRect.latin1()).toRect().isValid()) { |
1014 case Qt::GestureStarted: |
1021 tap->setProperty(HbPrivate::ThresholdRect.latin1(), mapRectToScene(boundingRect()).toRect()); |
1015 { |
|
1016 d->touchAreaPressEvent( ); |
|
1017 accepted = true; |
|
1018 break; |
|
1019 } |
|
1020 case Qt::GestureCanceled: |
|
1021 { |
|
1022 d->mIsDown = false; |
|
1023 updatePrimitives( ); |
|
1024 accepted = true; |
|
1025 break; |
|
1026 } |
|
1027 case Qt::GestureFinished: |
|
1028 { |
|
1029 d->touchAreaReleaseEvent( ); |
|
1030 accepted = true; |
|
1031 break; |
|
1032 //TODO :: move else part here |
|
1033 } |
|
1034 default: |
|
1035 break; |
|
1036 } |
1022 } |
1037 } |
1023 |
1038 } |
1024 d->touchAreaPressEvent(); |
1039 } |
1025 break; |
1040 return accepted; |
1026 } |
|
1027 case Qt::GestureCanceled: { |
|
1028 scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); |
|
1029 |
|
1030 d->mIsDown = false; |
|
1031 updatePrimitives(); |
|
1032 setProperty( "state", "normal" ); |
|
1033 break; |
|
1034 } |
|
1035 case Qt::GestureFinished: { |
|
1036 scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); |
|
1037 |
|
1038 d->touchAreaReleaseEvent(); |
|
1039 break; |
|
1040 //TODO :: move else part here |
|
1041 } |
|
1042 default: |
|
1043 break; |
|
1044 } |
|
1045 } |
1041 } |
1046 } |
1042 |
1047 |
1043 /*! |
1048 /*! |
1044 \reimp |
1049 \reimp |
1045 */ |
1050 */ |