| Home · All Classes · Main Classes · Deprecated |
MContentItem is a widget for displaying thumbnail and 2 lines of text. Can be used as a standalone widget in a layout or in MList as list item. More...


MContentItem is a widget for displaying thumbnail and 2 lines of text. Can be used as a standalone widget in a layout or in MList as list item.
MContentItem provides functionality which is similar to button. It can show 2 lines of text and an icon (thumbnail). Tapping on widget will trigger clicked() signal. Widget can be selected via setSelected() and selection status can be queried via isSelected() function.
MContentItem provides the following styles:
MContentItem can be in one of the modes provided by ContentItemMode enumeration. For each mode there is a dedicated graphics which is up to the view to show. The purpose of mode is to indicate logical position of item so that correct background can be used. For more details take a look at MContentItemView.
Definition at line 57 of file corelib/widgets/mcontentitem.h.
ContentItemMode indicates logical position of content item relative other items. Exact look and feel depends on the view.
Definition at line 87 of file corelib/widgets/mcontentitem.h.
{
Default = 0,
TopLeft,
Top,
TopRight,
Left,
Center,
Right,
Single,
BottomLeft,
Bottom,
BottomRight,
SingleRowLeft,
SingleRowCenter,
SingleRowRight,
SingleColumnTop,
SingleColumnCenter,
SingleColumnBottom,
TwoIconsTextLabelVertical
};
ContentItemStyle indicates how text and thumbnail should be shown. There are 8 predefined layouts. Exact look and feel depends on the view.
| IconAndTwoTextLabels | |
| SingleTextLabel | |
| IconAndSingleTextLabel | |
| TwoTextLabels | |
| SingleIcon | |
| IconAndSingleTextLabelVertical | |
| IconAndTwoTextLabelsVertical | |
| TwoIconsTwoWidgets |
Definition at line 69 of file corelib/widgets/mcontentitem.h.
{
IconAndTwoTextLabels = 0,
SingleTextLabel,
IconAndSingleTextLabel,
TwoTextLabels,
SingleIcon,
IconAndSingleTextLabelVertical,
IconAndTwoTextLabelsVertical,
TwoIconsTwoWidgets
};
| MContentItem::MContentItem | ( | MContentItem::ContentItemStyle | itemStyle = MContentItem::IconAndTwoTextLabels, |
|
| QGraphicsItem * | parent = 0 | |||
| ) |
Constructs a MContentItem with a specific style and a parent.
| itemStyle | specifies style of content item | |
| parent | Parent object. |
Definition at line 54 of file corelib/widgets/mcontentitem.cpp.
: MWidgetController(new MContentItemPrivate, new MContentItemModel, parent) { model()->setItemStyle(itemStyle); }

| MContentItem::~MContentItem | ( | ) | [virtual] |
| MWidget * MContentItem::additionalItem | ( | ) | const |
Returns the logical ID of the contentItem's additional image.
Definition at line 212 of file corelib/widgets/mcontentitem.cpp.
{
return model()->additionalItem();
}

| void MContentItem::click | ( | ) | [slot] |
Makes content item to send clicked() signal.
Definition at line 149 of file corelib/widgets/mcontentitem.cpp.
{
emit clicked();
}

| void MContentItem::clicked | ( | ) | [signal] |
This signal is emitted when content item is pressed.
| void MContentItem::connectNotify | ( | const char * | signal | ) | [protected, virtual] |
Handler of notifications of new receivers connected to MContentItem signals.
Definition at line 258 of file corelib/widgets/mcontentitem.cpp.
{
Q_D(MContentItem);
if (QLatin1String(signal) == SIGNAL(longTapped(QPointF))) {
d->updateLongTapConnections();
}
}

| void MContentItem::disconnectNotify | ( | const char * | signal | ) | [protected, virtual] |
Handler of notifications of receivers disconnecting from MContentItem signals.
Definition at line 267 of file corelib/widgets/mcontentitem.cpp.
{
Q_D(MContentItem);
if (QLatin1String(signal) == SIGNAL(longTapped(QPointF))) {
d->updateLongTapConnections();
}
}

| void MContentItem::enableProgressBar | ( | ) | [slot] |
Convenience method which sets a progress bar as the additional item.
Definition at line 217 of file corelib/widgets/mcontentitem.cpp.
{
Q_D(MContentItem);
if(d->progressIndicator == NULL)
{
d->progressIndicator = new MProgressIndicator(this);
d->progressIndicator->setViewType(MProgressIndicator::barType);
d->progressIndicator->setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Expanding);
model()->setAdditionalItem(d->progressIndicator);
}
}

| QImage MContentItem::image | ( | ) | const |
Get the thumbnail image.
| QString MContentItem::imageID | ( | ) | const |
Returns the logical ID of the contentItem's image.
| MContentItem::ContentItemMode MContentItem::itemMode | ( | ) | const |
Returns item's mode.
| MContentItem::ContentItemStyle MContentItem::itemStyle | ( | ) | const |
Returns item's style.
| void MContentItem::longTap | ( | const QPointF & | pos | ) | [slot] |
Makes the content item to send longTapped signal.
| pos | The position of the tap. |
If the MContentItem is used outside MList, the user needs to invoke item->grabGesture(Qt::TapAndHoldGesture) to start receiving longTapped() signal.
Definition at line 154 of file corelib/widgets/mcontentitem.cpp.
{
emit longTapped(pos);
}

| void MContentItem::longTapped | ( | const QPointF & | pos | ) | [signal] |
The signal is emitted when the content item has been tapped and holded.
| QImage MContentItem::optionalImage | ( | ) | const |
Returns optional image (Icon)
| QString MContentItem::optionalImageID | ( | ) | const |
Returns the logical ID of the contentItem's optional image.
| QPixmap MContentItem::optionalPixmap | ( | ) | const |
Returns optional pixmap (Icon)
| QPixmap MContentItem::pixmap | ( | ) | const |
Get the thumbnail pixmap.
| void MContentItem::setAdditionalItem | ( | MWidget * | widget | ) | [slot] |
Sets a MWidget as e.g. progress bar, below the title.
| widget | MWidget In case there is already a subtitle it will be replaced. |
Definition at line 207 of file corelib/widgets/mcontentitem.cpp.
{
model()->setAdditionalItem(widget);
}

| void MContentItem::setImage | ( | const QImage & | pixmap | ) | [slot] |
Sets thumbnail image.
| pixmap | Image |
Definition at line 114 of file corelib/widgets/mcontentitem.cpp.
{
Q_D(MContentItem);
d->image = image;
model()->setItemImage(d->image);
}

Sets the logical ID of the contentItem image to id.
If size is not specified, whatever size the graphics happens to be in the theme will be used.
Definition at line 121 of file corelib/widgets/mcontentitem.cpp.
{
model()->beginTransaction();
model()->setItemImageID(id);
model()->setItemImageSize(size);
model()->commitTransaction();
}

| void MContentItem::setItemMode | ( | ContentItemMode | mode | ) | [slot] |
Sets item's mode. Mode defines how item's background should look. Exact look is defined in style.
Definition at line 144 of file corelib/widgets/mcontentitem.cpp.
{
model()->setItemMode(mode);
}

| void MContentItem::setOptionalImage | ( | const QImage & | image | ) | [slot] |
Sets an optional image (Icon).
| image | QImage |
Definition at line 175 of file corelib/widgets/mcontentitem.cpp.
{
Q_D(MContentItem);
d->optionalImage = image;
model()->setOptionalImage(d->optionalImage);
}

Sets the logical ID of the contentItem's optional image to id.
If size is not specified, whatever size the graphics happens to be in the theme will be used.
Definition at line 182 of file corelib/widgets/mcontentitem.cpp.
{
model()->beginTransaction();
model()->setOptionalImageID(id);
model()->setOptionalImageSize(size);
model()->commitTransaction();
}

| void MContentItem::setOptionalPixmap | ( | const QPixmap & | pixmap | ) | [slot] |
Sets an optional pixmap (Icon).
| pixmap | QPixmap |
Definition at line 168 of file corelib/widgets/mcontentitem.cpp.
{
Q_D(MContentItem);
d->optionalPixmap = pixmap;
model()->setOptionalPixmap(d->optionalPixmap);
}

| void MContentItem::setPixmap | ( | const QPixmap & | pixmap | ) | [slot] |
Sets thumbnail pixmap.
| pixmap | QPixmap |
Definition at line 107 of file corelib/widgets/mcontentitem.cpp.
{
Q_D(MContentItem);
d->pixmap = pixmap;
model()->setItemPixmap(d->pixmap);
}

| void MContentItem::setSmallItem | ( | MWidget * | widget | ) | [slot] |
Sets a MWidget as a widget below the right icon.
| widget | MWidget |
Definition at line 229 of file corelib/widgets/mcontentitem.cpp.
{
Q_D(MContentItem);
if (d->smallText) {
delete d->smallText;
d->smallText = 0;
}
model()->setSmallItem(widget);
}

| void MContentItem::setSmallText | ( | QString | text | ) | [slot] |
Convenience method for setting a text below the right icon.
Definition at line 245 of file corelib/widgets/mcontentitem.cpp.
{
Q_D(MContentItem);
if (d->smallText) {
d->smallText->setText(text);
} else {
d->smallText = new MLabel(text);
d->smallText->setAlignment( Qt::AlignRight );
model()->setSmallItem(d->smallText);
}
}

| void MContentItem::setSubtitle | ( | const QString & | text | ) | [slot] |
Set subtitle text.
This is second line.
| text | text. |
Definition at line 134 of file corelib/widgets/mcontentitem.cpp.
{
if (additionalItem()) {
additionalItem()->setVisible(false);
setAdditionalItem(0);
}
model()->setSubtitle(text);
}

| void MContentItem::setTitle | ( | const QString & | text | ) | [slot] |
Set title text.
This is first line.
| text | text. |
Definition at line 129 of file corelib/widgets/mcontentitem.cpp.
{
model()->setTitle(text);
}

| MWidget * MContentItem::smallItem | ( | ) | const |
Returns a pointer to the small widget.
Definition at line 240 of file corelib/widgets/mcontentitem.cpp.
{
return model()->smallItem();
}

| QString MContentItem::subtitle | ( | ) | const |
Get the subtitle.
| QString MContentItem::title | ( | ) | const |
Get the title.
QImage MContentItem::image [read, write] |
Definition at line 126 of file corelib/widgets/mcontentitem.h.
MContentItem::imageID [read, write] |
image from theme which will be displayed
Definition at line 132 of file corelib/widgets/mcontentitem.h.
MContentItem::itemMode [read, write] |
specifies item mode
Definition at line 118 of file corelib/widgets/mcontentitem.h.
MContentItem::itemStyle [read] |
specifies item style
Definition at line 112 of file corelib/widgets/mcontentitem.h.
MContentItem::optionalImage [read, write] |
image from theme which will be displayed as "optional image"
Definition at line 152 of file corelib/widgets/mcontentitem.h.
QString MContentItem::optionalImageID [read, write] |
Definition at line 158 of file corelib/widgets/mcontentitem.h.
QPixmap MContentItem::optionalPixmap [read, write] |
Definition at line 150 of file corelib/widgets/mcontentitem.h.
MContentItem::pixmap [read, write] |
pixmap which will be displayed
Definition at line 124 of file corelib/widgets/mcontentitem.h.
MContentItem::subtitle [read, write] |
See MContentItemModel::subtitle.
Definition at line 144 of file corelib/widgets/mcontentitem.h.
MContentItem::title [read, write] |
Definition at line 138 of file corelib/widgets/mcontentitem.h.
| Copyright © 2010 Nokia Corporation | Generated on Thu Nov 4 2010 18:14:24 (PDT) Doxygen 1.7.1 |
MeeGo Touch |