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 { |