src/hbwidgets/sliders/hbratingslider.cpp
changeset 21 4633027730f5
parent 7 923ff622b8b9
child 23 e6ad4ef83b23
--- a/src/hbwidgets/sliders/hbratingslider.cpp	Tue Jul 06 14:36:53 2010 +0300
+++ b/src/hbwidgets/sliders/hbratingslider.cpp	Wed Aug 18 10:05:37 2010 +0300
@@ -71,10 +71,10 @@
 void HbRatingSliderPrivate::init()
 {
     Q_Q(HbRatingSlider);
-    mLayoutItem = q->style()->createPrimitive(HbStyle::P_RatingSlider_layout,q);
-    mFrame = q->style()->createPrimitive(HbStyle::P_RatingSlider_frame,mLayoutItem);
-    mTrack = q->style()->createPrimitive(HbStyle::P_RatingSlider_track,mFrame);
-    mTouchArea = q->style()->createPrimitive(HbStyle::P_RatingSlider_toucharea, q);
+    mLayoutItem = HbStylePrivate::createPrimitive(HbStylePrivate::P_RatingSlider_layout,q);
+    mFrame = HbStylePrivate::createPrimitive(HbStylePrivate::P_RatingSlider_frame,mLayoutItem);
+    mTrack = HbStylePrivate::createPrimitive(HbStylePrivate::P_RatingSlider_track,mFrame);
+    mTouchArea = HbStylePrivate::createPrimitive(HbStylePrivate::P_RatingSlider_toucharea, q);
 
     q->updatePrimitives();
 
@@ -300,7 +300,7 @@
     HbStyleOptionRatingSlider option;
     initStyleOption(&option);
     if (d->mTrack) {
-           style()->updatePrimitive(d->mTrack, HbStyle::P_RatingSlider_track, &option);
+           HbStylePrivate::updatePrimitive(d->mTrack, HbStylePrivate::P_RatingSlider_track, &option);
     }
 
 }
@@ -348,7 +348,7 @@
     HbStyleOptionRatingSlider option;
     initStyleOption(&option);
     if (d->mTrack) {
-           style()->updatePrimitive(d->mTrack, HbStyle::P_RatingSlider_track, &option);
+           HbStylePrivate::updatePrimitive(d->mTrack, HbStylePrivate::P_RatingSlider_track, &option);
     }
 }
 
@@ -550,6 +550,10 @@
 void HbRatingSlider::gestureEvent(QGestureEvent *event)
 {
     Q_D (HbRatingSlider);
+    if ( (!isEnabled()) || (d->mReadOnly)) {
+        event->ignore();
+        return;
+    }
     if(event->gesture(Qt::TapGesture)) {
             HbTapGesture *tap = qobject_cast<HbTapGesture *>(event->gesture(Qt::TapGesture));
             switch(tap->state()) {
@@ -703,8 +707,8 @@
                         
                       }
                      
-					
-					default:
+                    
+                    default:
                       break;
                 }
     }
@@ -754,11 +758,11 @@
 {
     Q_D(const HbRatingSlider);
     switch (primitive) {
-        case HbStyle::P_RatingSlider_frame:
+        case HbStylePrivate::P_RatingSlider_frame:
             return d->mFrame;
-        case HbStyle::P_RatingSlider_track:
+        case HbStylePrivate::P_RatingSlider_track:
             return d->mTrack;  
-        case HbStyle::P_RatingSlider_layout:
+        case HbStylePrivate::P_RatingSlider_layout:
             return d->mLayoutItem;
          default:
             return 0;
@@ -790,15 +794,15 @@
     HbStyleOptionRatingSlider option;
     initStyleOption(&option);
     if (d->mFrame) {
-            style()->updatePrimitive(d->mFrame, HbStyle::P_RatingSlider_frame, &option);
+            HbStylePrivate::updatePrimitive(d->mFrame, HbStylePrivate::P_RatingSlider_frame, &option);
     }
   
     if (d->mTrack) {
-           style()->updatePrimitive(d->mTrack, HbStyle::P_RatingSlider_track, &option);
+           HbStylePrivate::updatePrimitive(d->mTrack, HbStylePrivate::P_RatingSlider_track, &option);
     }
 
     if (d->mTouchArea) {
-        style()->updatePrimitive(d->mTouchArea, HbStyle::P_CheckBox_toucharea, &option);
+        HbStylePrivate::updatePrimitive(d->mTouchArea, HbStylePrivate::P_CheckBox_toucharea, &option);
     }
     
 }