36 @hbwidgets |
36 @hbwidgets |
37 \class HbListWidgetItem |
37 \class HbListWidgetItem |
38 \brief HbListWidgetItem represents a list item. It is part of convenience list API together with HbListWidget. |
38 \brief HbListWidgetItem represents a list item. It is part of convenience list API together with HbListWidget. |
39 |
39 |
40 As this is a convenience API it is supposed to be easy to use. For that reason complicated list items are not possible |
40 As this is a convenience API it is supposed to be easy to use. For that reason complicated list items are not possible |
41 to be created. |
41 to be created. HbListWidgetItem supports at maximum two text items and two icon items. |
42 |
42 Either primary text or primary icon must always be provided. Icons are shown only in default size. |
43 A list item consists of three columns. |
43 |
44 |
44 A view item created from this item consists of three columns at maximum. |
45 - First column has only one row and it may contain one icon or a text label. |
45 - First column contains primary icon |
46 |
46 - Middle column has one or two rows to show text(s) |
47 - Middle column can have two rows and both rows can contain text. |
47 - Last column contains secondary icon |
48 |
48 - Any column can be empty |
49 - The last column has only one row and it may contain one icon or a text label. |
|
50 |
|
51 - Any column may be left empty. |
|
52 |
49 |
53 The following code snippet presents how to create an list item with icons in the left |
50 The following code snippet presents how to create an list item with icons in the left |
54 and right columns and two rows of text in the middle column. |
51 and right columns and two rows of text in the middle column. |
55 |
52 |
56 \snippet{unittest_hblistwidgetitem.cpp,1} |
53 \snippet{unittest_hblistwidgetitem.cpp,1} |
115 } |
112 } |
116 |
113 |
117 /*! |
114 /*! |
118 Sets the item's data for the given role to the specified value. |
115 Sets the item's data for the given role to the specified value. |
119 Can be used to store application-specific data in an item. |
116 Can be used to store application-specific data in an item. |
120 This function cannot be used to set anything visible data. |
117 |
121 */ |
118 Specialised functions in section 'see also' are recommended setting user data. |
|
119 |
|
120 \sa setText() |
|
121 \sa setSecondaryText() |
|
122 \sa setIcon() |
|
123 \sa setSecondaryIcon() |
|
124 */ |
122 void HbListWidgetItem::setData(const QVariant &value, int role) |
125 void HbListWidgetItem::setData(const QVariant &value, int role) |
123 { |
126 { |
124 d->setData(value,role); |
127 d->setData(value,role); |
125 if (d->mModel) |
128 if (d->mModel) |
126 d->mModel->itemChanged(this); |
129 d->mModel->itemChanged(this); |