src/hbwidgets/widgets/hbcheckbox.cpp
changeset 1 f7ac710697a9
parent 0 16d8024aca5e
child 2 06ff229162e9
--- a/src/hbwidgets/widgets/hbcheckbox.cpp	Mon Apr 19 14:02:13 2010 +0300
+++ b/src/hbwidgets/widgets/hbcheckbox.cpp	Mon May 03 12:48:33 2010 +0300
@@ -36,6 +36,11 @@
 #include "hbeffectinternal_p.h"
 #endif
 
+#ifdef HB_GESTURE_FW
+#include <hbtapgesture.h>
+#endif
+
+
 /*
     Spacer class.
 */
@@ -121,6 +126,9 @@
     Q_Q(HbCheckBox);
     if(!mTouchArea) {
         mTouchArea = q->style()->createPrimitive(HbStyle::P_CheckBox_toucharea, q);
+        if(QGraphicsObject *ta = qgraphicsitem_cast<QGraphicsObject*>(mTouchArea)) {
+            ta->grabGesture(Qt::TapGesture);
+        }
     }
     if (!mTextItem) {
         mTextItem = q->style()->createPrimitive(HbStyle::P_CheckBox_text, q);
@@ -196,6 +204,9 @@
     // creattion of top and bottom spacer.
     HbStyle::setItemName( new HbCheckBoxSpacer(this), "topSpacer" );
     HbStyle::setItemName( new HbCheckBoxSpacer(this), "bottomSpacer" );
+#ifdef HB_GESTURE_FW
+    grabGesture(Qt::TapGesture);
+#endif
 
 }
 
@@ -294,6 +305,10 @@
 }
 
 /*!
+
+    \deprecated HbCheckBox::primitive(HbStyle::Primitive)
+        is deprecated.
+
     Returns the pointer for \a primitive passed.
     Will return NULL if \a primitive passed is icon because user cannot
     configure the check and unchecked icons. Style needs to be changed if
@@ -429,6 +444,7 @@
     HbCheckBox::checkStateSet();
 }
 
+#ifndef HB_GESTURE_FW
 /*!
     \reimp.
 */
@@ -451,7 +467,14 @@
         HbToolTip::showText(toolTip(), this);
     }   
 }
+#endif
 
+#ifdef HB_GESTURE_FW
+void HbCheckBox::gestureEvent(QGestureEvent *event)
+{
+    HbAbstractButton::gestureEvent( event );
+}
+#endif
 /*!
     \reimp.
 */