src/hbwidgets/itemviews/hbtumbleviewitem.cpp
changeset 34 ed14f46c0e55
parent 7 923ff622b8b9
equal deleted inserted replaced
31:7516d6d86cf5 34:ed14f46c0e55
    21 ** If you have questions regarding the use of this file, please contact
    21 ** If you have questions regarding the use of this file, please contact
    22 ** Nokia at developer.feedback@nokia.com.
    22 ** Nokia at developer.feedback@nokia.com.
    23 **
    23 **
    24 ****************************************************************************/
    24 ****************************************************************************/
    25 #include "hbtumbleviewitem.h"
    25 #include "hbtumbleviewitem.h"
    26 #include "hbtapgesture_p.h"
    26 #include "hbtapgesture.h"
    27 
    27 
    28 #include "hblistviewitem_p.h"
    28 #include "hblistviewitem_p.h"
    29 #include "hbnamespace_p.h"
    29 #include "hbnamespace_p.h"
    30 #include <hbstyleoptionlistviewitem_p.h>
    30 #include <hbstyleoption_p.h>
    31 
    31 
    32 #include <QGestureEvent>
    32 #include <QGestureEvent>
    33 #include <QCoreApplication>
    33 #include <QCoreApplication>
    34 
    34 
       
    35 /*!
       
    36     @proto
       
    37     \class HbTumbleViewitem
       
    38     \brief The HbTumbleViewItem class represents a single row in HbTumbleView.
       
    39 
       
    40     HbTumbleViewItem class provides an item that is used by the HbTumbleView class to
       
    41     visualize content within single model index. HbTumbleViewItem supports 
       
    42     QStringList that is stored into Qt::DisplayRole role within the index. 
       
    43 
       
    44     This class acts as a default item prototype inside HbTumbleView.
       
    45 */
       
    46 
       
    47 /*!
       
    48     Constructs a TumbleViewItem with \a parent.
       
    49 */
    35 HbTumbleViewItem::HbTumbleViewItem(QGraphicsItem *parent) :
    50 HbTumbleViewItem::HbTumbleViewItem(QGraphicsItem *parent) :
    36     HbListViewItem(parent)
    51     HbListViewItem(parent)
    37 {
    52 {
    38     HB_SDD(HbAbstractViewItem);
    53     HB_SDD(HbAbstractViewItem);
    39     sd->mItemType = QString("tumbleviewitem");
    54     sd->mItemType = QString("tumbleviewitem");
    40     setFocusPolicy(Qt::NoFocus);
    55     setFocusPolicy(Qt::NoFocus);
    41 }
    56 }
    42 
    57 
       
    58 /*!
       
    59     Destructor
       
    60 */
    43 HbTumbleViewItem::~HbTumbleViewItem()
    61 HbTumbleViewItem::~HbTumbleViewItem()
    44 {
    62 {
    45 }
    63 }
    46 
    64 
    47 /*!
    65 /*!
    50 int HbTumbleViewItem::type() const
    68 int HbTumbleViewItem::type() const
    51 {
    69 {
    52     return Type;
    70     return Type;
    53 }
    71 }
    54 
    72 
    55 
       
    56 /*!
    73 /*!
    57     \reimp
    74     \reimp
    58 */
    75 */
    59 HbAbstractViewItem *HbTumbleViewItem::createItem()
    76 HbAbstractViewItem *HbTumbleViewItem::createItem()
    60 {
    77 {
    61     HbTumbleViewItem* item = new HbTumbleViewItem(*this);
    78     HbTumbleViewItem* item = new HbTumbleViewItem(*this);
    62     item->setFocusPolicy(Qt::NoFocus);
    79     item->setFocusPolicy(Qt::NoFocus);
    63     connect(item,SIGNAL(released(QPointF)),item->itemView(),SLOT(_q_itemSelected(QPointF)));
    80     connect(item,SIGNAL(released(QPointF)),item->itemView(),SLOT(_q_itemSelected(QPointF)));
    64     return item;
    81     return item;
    65 }
    82 }
       
    83 
    66 /*!
    84 /*!
    67     \reimp
    85     \reimp
    68 */
    86 */
    69 void HbTumbleViewItem::updateChildItems()
    87 void HbTumbleViewItem::updateChildItems()
    70 {
    88 {
    98         HbWidget::gestureEvent(event);
   116         HbWidget::gestureEvent(event);
    99    
   117    
   100     }
   118     }
   101 }
   119 }
   102 
   120 
   103 
       
   104 QSizeF HbTumbleViewItem::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
   121 QSizeF HbTumbleViewItem::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
   105 {
   122 {
   106     HB_SDD(const HbAbstractViewItem);
   123     HB_SDD(const HbAbstractViewItem);
   107     static qreal height=0;
   124     static qreal height=0;
   108 
   125 
   133         return QSizeF(sh.width(),height);
   150         return QSizeF(sh.width(),height);
   134     }
   151     }
   135     return sh;
   152     return sh;
   136 }
   153 }
   137 
   154 
   138 
       
   139 #include "moc_hbtumbleviewitem.cpp"
   155 #include "moc_hbtumbleviewitem.cpp"
   140 
   156