diff -r 923ff622b8b9 -r 4633027730f5 src/hbwidgets/sliders/hbslidertickmarkslabel.cpp --- a/src/hbwidgets/sliders/hbslidertickmarkslabel.cpp Tue Jul 06 14:36:53 2010 +0300 +++ b/src/hbwidgets/sliders/hbslidertickmarkslabel.cpp Wed Aug 18 10:05:37 2010 +0300 @@ -46,24 +46,20 @@ public: HbSliderTickmarksLabelPrivate(); void createTickLabels( ); - HbStyleOptionSlider sliderOption; QList tickmarkmajorIconItemsLabel; QList tickmarkminorIconItemsLabel; HbSlider *slider; Hb::SliderTickPositions tickPosition; bool createText; - }; - HbSliderTickmarksLabelPrivate::HbSliderTickmarksLabelPrivate() :HbWidgetPrivate(){ - tickmarkmajorIconItemsLabel.clear(); - tickmarkminorIconItemsLabel.clear(); - slider = 0; - tickPosition = Hb::NoSliderTicks; - createText = true; - - +HbSliderTickmarksLabelPrivate::HbSliderTickmarksLabelPrivate() : + HbWidgetPrivate(), + slider(0), + tickPosition(Hb::NoSliderTicks), + createText(true) +{ } @@ -88,7 +84,7 @@ } int majorLabelListLength = tickmarkmajorIconItemsLabel.length(); for (int i=majorLabelListLength;istyle()->createPrimitive(HbStyle::P_SliderTickMark_majorlabel, q); + QGraphicsItem *textItem = HbStylePrivate::createPrimitive(HbStylePrivate::P_SliderTickMark_majorlabel, q); textItemCreated = true; Q_ASSERT(textItem->isWidget()); tickmarkmajorIconItemsLabel.append(static_cast(textItem));//add newly defind primitive @@ -115,7 +111,7 @@ int minorIconLabelListLength = tickmarkminorIconItemsLabel.length(); for (int i=minorIconLabelListLength;istyle()->createPrimitive(HbStyle::P_SliderTickMark_minorlabel, q); + QGraphicsItem *textItem = HbStylePrivate::createPrimitive(HbStylePrivate::P_SliderTickMark_minorlabel, q); textItemCreated = true; Q_ASSERT(textItem->isWidget()); tickmarkminorIconItemsLabel.append(static_cast(textItem));//add newly defind primitive @@ -141,7 +137,6 @@ void HbSliderTickmarksLabel::resizeEvent(QGraphicsSceneResizeEvent *event) { Q_UNUSED (event); - repolish ( ); updateTickLabels(); HbWidget::resizeEvent(event); } @@ -160,7 +155,7 @@ initStyleOption(&opt); opt.orientation = d->slider->orientation(); opt.text = (d->slider->majorTickLabels( )).at(i); - style()->updatePrimitive(textItem,HbStyle::P_SliderTickMark_majorlabel,&opt); + HbStylePrivate::updatePrimitive(textItem,HbStylePrivate::P_SliderTickMark_majorlabel,&opt); } int minimum = d->slider->minimum(); int maximum = d->slider->maximum(); @@ -169,7 +164,7 @@ qreal span = 0; bool rtlLayout = (((d->slider->orientation( ) != Qt::Vertical) &&(HbApplication::layoutDirection() == Qt::LeftToRight))?false:true); - HbSliderPrivate *sliderPrivate = dynamic_cast(HbSliderPrivate::d_ptr(d->slider)); + HbSliderPrivate *sliderPrivate = HbSliderPrivate::d_ptr(d->slider); QSizeF handleSize(0.0,0.0); if( sliderPrivate) { handleSize = sliderPrivate->getHandleSize( ); @@ -238,7 +233,7 @@ initStyleOption(&opt); opt.orientation = d->slider->orientation(); opt.text = (d->slider->minorTickLabels( )).at(minorIndex); - style()->updatePrimitive(textItem,HbStyle::P_SliderTickMark_minorlabel,&opt); + HbStylePrivate::updatePrimitive(textItem,HbStylePrivate::P_SliderTickMark_minorlabel,&opt); minorIndex++; int pos = QStyle::sliderPositionFromValue( minimum, maximum, minimum+minorTickInterval*i,static_cast( span ), rtlLayout ); @@ -290,12 +285,12 @@ /*! constructor */ -HbSliderTickmarksLabel::HbSliderTickmarksLabel( QGraphicsItem *parent ) +HbSliderTickmarksLabel::HbSliderTickmarksLabel(HbSlider *parent) : HbWidget( *new HbSliderTickmarksLabelPrivate, parent ) { Q_D( HbSliderTickmarksLabel ); d->q_ptr = this; - d->slider=dynamic_cast( parentItem() ); + d->slider = parent; d->createTickLabels(); #if QT_VERSION >= 0x040600 setFlag(QGraphicsItem::ItemSendsGeometryChanges,true);