src/hbwidgets/sliders/hbprogresssliderhandle_p.cpp
changeset 6 c3690ec91ef8
parent 2 06ff229162e9
child 21 4633027730f5
child 34 ed14f46c0e55
--- a/src/hbwidgets/sliders/hbprogresssliderhandle_p.cpp	Fri Jun 11 13:58:22 2010 +0300
+++ b/src/hbwidgets/sliders/hbprogresssliderhandle_p.cpp	Wed Jun 23 18:33:25 2010 +0300
@@ -131,18 +131,21 @@
 
     mMousePressPos = event->scenePos();
     mItemPosAtPress = pos();
-    if(q->textVisible()) {
+   
+    HbWidgetFeedback::triggered(q->parentGraphicsWidget(), Hb::InstantPressed, Hb::ModifierSliderHandle);
+
+    event->accept();
+    q->emitSliderPressed();   
+
+     if(q->textVisible()) {
         HbToolTip::showText(q->toolTipText(),this, QRectF(mItemPosAtPress,QSize(0,0)),q->textAlignment());
     }
     else {
         HbExtendedLocale locale;
-        HbToolTip::showText(locale.toString(q->progressValue()),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment());
+        HbProgressSlider *slider = (HbProgressSlider*)q->parentGraphicsWidget();
+        HbToolTip::showText(locale.toString(slider->sliderValue()),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment());
     }
 
-    HbWidgetFeedback::triggered(q->parentGraphicsWidget(), Hb::InstantPressed, Hb::ModifierSliderHandle);
-
-    event->accept();
-    q->emitSliderPressed();    
 }
 
 void HbProgressSliderHandle::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) 
@@ -217,16 +220,18 @@
         #endif
     }
 
+    event->accept();
+
+    q->emitSliderMoved(pointToValue(mItemCurPos));  
+    
     if(q->textVisible()) {
         HbToolTip::showText(q->toolTipText(),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment());
     }
     else {
         HbExtendedLocale locale;
-        HbToolTip::showText(locale.toString(q->progressValue()),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment());
+        HbProgressSlider *slider = (HbProgressSlider*)q->parentGraphicsWidget();
+        HbToolTip::showText(locale.toString(slider->sliderValue()),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment());
     }
-    event->accept();
-
-    q->emitSliderMoved(pointToValue(mItemCurPos));
 }
 
 int HbProgressSliderHandle::pointToValue(QPointF point) const