equal
deleted
inserted
replaced
51 setVerticalScrollBarPolicy( HbScrollArea::ScrollBarAlwaysOff ); |
51 setVerticalScrollBarPolicy( HbScrollArea::ScrollBarAlwaysOff ); |
52 |
52 |
53 // mItemParent is used to hold the unused QGraphicsItem's in the pool. It's visibility is set to false |
53 // mItemParent is used to hold the unused QGraphicsItem's in the pool. It's visibility is set to false |
54 // so the visibility of the items doesn't need to be modified. |
54 // so the visibility of the items doesn't need to be modified. |
55 mItemPoolParent->setVisible( false ); |
55 mItemPoolParent->setVisible( false ); |
56 |
|
57 Radio::connect( this, SIGNAL(scrollPositionChanged(QPointF)), |
|
58 this, SLOT(scrollPositionChanged(QPointF))); |
|
59 } |
56 } |
60 |
57 |
61 /*! |
58 /*! |
62 * |
59 * |
63 */ |
60 */ |
215 |
212 |
216 HbScrollArea::mouseReleaseEvent( event ); |
213 HbScrollArea::mouseReleaseEvent( event ); |
217 } |
214 } |
218 |
215 |
219 /*! |
216 /*! |
220 * Private slot |
|
221 */ |
|
222 void RadioStripBase::scrollPositionChanged( QPointF newPosition ) |
|
223 { |
|
224 adjustItems(); |
|
225 scrollPosChanged( newPosition ); |
|
226 } |
|
227 |
|
228 /*! |
|
229 * |
217 * |
230 */ |
218 */ |
231 void RadioStripBase::moveAllItemsToPool() |
219 void RadioStripBase::moveAllItemsToPool() |
232 { |
220 { |
233 // set parent of all items to pool |
221 // set parent of all items to pool |
278 item->setPos( QPointF( currPos, 0 ) ); |
266 item->setPos( QPointF( currPos, 0 ) ); |
279 currPos += itemSize - mOverlap; |
267 currPos += itemSize - mOverlap; |
280 } |
268 } |
281 } |
269 } |
282 |
270 |
283 QRectF contentsRect(0,0,0,0); |
271 mStripContainer->setPreferredSize( mContentsLength, mItemSize.height() ); |
284 contentsRect.setBottom( mItemSize.height() ); |
|
285 contentsRect.setRight( mContentsLength ); |
|
286 |
|
287 mStripContainer->setGeometry( contentsRect ); |
|
288 |
272 |
289 if ( mCurrentIndex >= 0 ) |
273 if ( mCurrentIndex >= 0 ) |
290 { |
274 { |
291 setIndex( mCurrentIndex, false ); |
275 setIndex( mCurrentIndex, false ); |
292 } |
276 } |
495 item->setPos( QPointF( indexToOffset( i ), 0 ) ); |
479 item->setPos( QPointF( indexToOffset( i ), 0 ) ); |
496 } |
480 } |
497 } |
481 } |
498 } |
482 } |
499 } |
483 } |
|
484 |
|
485 /*! |
|
486 * \reimp |
|
487 */ |
|
488 bool RadioStripBase::scrollByAmount( const QPointF& delta ) |
|
489 { |
|
490 bool ret = HbScrollArea::scrollByAmount( delta ); |
|
491 |
|
492 adjustItems(); |
|
493 scrollPosChanged(); |
|
494 |
|
495 return ret; |
|
496 } |