src/hbwidgets/sliders/hbsliderhandle.cpp
changeset 1 f7ac710697a9
parent 0 16d8024aca5e
child 2 06ff229162e9
equal deleted inserted replaced
0:16d8024aca5e 1:f7ac710697a9
    35 #ifdef HB_EFFECTS
    35 #ifdef HB_EFFECTS
    36 #include "hbeffect.h"
    36 #include "hbeffect.h"
    37 #include "hbeffectinternal_p.h"
    37 #include "hbeffectinternal_p.h"
    38 #define HB_SLIDERHANDLE_TYPE "HB_SLIDERHANDLE"
    38 #define HB_SLIDERHANDLE_TYPE "HB_SLIDERHANDLE"
    39 #endif
    39 #endif
    40 
    40 #ifdef HB_GESTURE_FW
       
    41 #include <hbtapgesture.h>
       
    42 #include <hbpangesture.h>
       
    43 #endif
    41 /*!
    44 /*!
    42     This is internal class for HbSlider
    45     This is internal class for HbSlider
    43     this created slider handle
    46     this created slider handle
    44     It also has event handling for handle press/move and release
    47     It also has event handling for handle press/move and release
    45 
    48 
    64     // create touch area for handle
    67     // create touch area for handle
    65     touchItem = slider->style()->createPrimitive(HbStyle::P_SliderElement_touchhandle, this); 
    68     touchItem = slider->style()->createPrimitive(HbStyle::P_SliderElement_touchhandle, this); 
    66     HbStyle::setItemName(touchItem , "toucharea");
    69     HbStyle::setItemName(touchItem , "toucharea");
    67 
    70 
    68     setZValue(slider->zValue() + 1);
    71     setZValue(slider->zValue() + 1);
    69     
    72 #ifdef HB_GESTURE_FW    
    70 
    73     grabGesture(Qt::TapGesture);
       
    74     grabGesture(Qt::PanGesture);
       
    75     if(touchItem) {
       
    76         if(QGraphicsObject *touchArea = touchItem->toGraphicsObject()) {
       
    77             Q_UNUSED(touchArea);
       
    78                touchArea->grabGesture(Qt::PanGesture);
       
    79                touchArea->grabGesture(Qt::TapGesture);
       
    80         }
       
    81     }
       
    82 #endif 
    71 #ifdef HB_EFFECTS
    83 #ifdef HB_EFFECTS
    72     // horizontal thumb press
    84     // horizontal thumb press
    73    // HbEffectInternal::add(HB_SLIDERHANDLE_TYPE,"sliderhandle_h_press", "h_thumbpress");
    85    // HbEffectInternal::add(HB_SLIDERHANDLE_TYPE,"sliderhandle_h_press", "h_thumbpress");
    74     //horizonal thumb release
    86     //horizonal thumb release
    75     //HbEffectInternal::add(HB_SLIDERHANDLE_TYPE,"sliderhandle_h_releasel", "h_thumbrelease");
    87     //HbEffectInternal::add(HB_SLIDERHANDLE_TYPE,"sliderhandle_h_releasel", "h_thumbrelease");
   304 
   316 
   305 /*!
   317 /*!
   306   reimp
   318   reimp
   307 
   319 
   308 */
   320 */
       
   321 void HbSliderHandle::gestureEvent(QGestureEvent *event)
       
   322 {
       
   323     Q_UNUSED(event);
       
   324     // HbWidgetBase::gestureEvent() ignores, overriding to accept
       
   325 }
       
   326 
       
   327 /*!
       
   328   reimp
       
   329 
       
   330 */
   309 void HbSliderHandle::updatePrimitives()
   331 void HbSliderHandle::updatePrimitives()
   310 {
   332 {
   311     HbStyleOptionSlider opt;
   333     HbStyleOptionSlider opt;
   312     sliderControl->initStyleOption(&opt);
   334     sliderControl->initStyleOption(&opt);
   313     if( scene()){
   335     if( scene()){