homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuview.cpp
changeset 36 cdae8c6c3876
parent 35 f9ce957a272c
child 39 4e8ebe173323
equal deleted inserted replaced
35:f9ce957a272c 36:cdae8c6c3876
   285  \param row The row which is to get on the top of item view.
   285  \param row The row which is to get on the top of item view.
   286  \param hint Ignored.
   286  \param hint Ignored.
   287   */
   287   */
   288 void HsMenuView::scrollToRow(int row, QAbstractItemView::ScrollHint hint)
   288 void HsMenuView::scrollToRow(int row, QAbstractItemView::ScrollHint hint)
   289 {
   289 {
   290     // TODO: remove hint from the interface
       
   291     Q_UNUSED(hint);
       
   292     HSMENUTEST_FUNC_ENTRY("HsMenuView::scrollToRow");
   290     HSMENUTEST_FUNC_ENTRY("HsMenuView::scrollToRow");
   293     scrollTo(mModel->index(row), HbAbstractItemView::PositionAtTop);
   291     scrollTo(mModel->index(row), convertScrollHint(hint));
   294     HSMENUTEST_FUNC_EXIT("HsMenuView::scrollToRow");
   292     HSMENUTEST_FUNC_EXIT("HsMenuView::scrollToRow");
       
   293 }
       
   294 
       
   295 /*!
       
   296      Converts scroll hints.
       
   297      \param Qt hint Where the target item should be positioned in visible area
       
   298      after scroll.
       
   299      \return Qrbit version of hint
       
   300  */
       
   301 HbAbstractItemView::ScrollHint HsMenuView::convertScrollHint(
       
   302         QAbstractItemView::ScrollHint hint)
       
   303 {
       
   304     switch (hint) {
       
   305     case QAbstractItemView::EnsureVisible:
       
   306         return HbAbstractItemView::EnsureVisible;
       
   307     case QAbstractItemView::PositionAtTop:
       
   308         return HbAbstractItemView::PositionAtTop;
       
   309     case QAbstractItemView::PositionAtBottom:
       
   310         return HbAbstractItemView::PositionAtBottom;
       
   311     default:
       
   312         return HbAbstractItemView::PositionAtCenter;
       
   313     }
   295 }
   314 }
   296 
   315 
   297 /*!
   316 /*!
   298  Connects \a activated and \a longPressed signals coming from list
   317  Connects \a activated and \a longPressed signals coming from list
   299  view to trigger corresponding signal of this object.
   318  view to trigger corresponding signal of this object.