| Home · All Classes · Main Classes · Deprecated |
MGridItem is a combiner class for displaying thumbnail, title and subTitle, used by MList, MGrid and MPopupList. More...


Public Slots | |
| void | setImage (const QString &id) |
| void | setPixmap (const QPixmap &pixmap) |
| void | setTitle (const QString &text) |
| void | setSubtitle (const QString &text) |
| void | setImageVisible (bool) |
| void | setTitleVisible (bool) |
| void | setSubtitleVisible (bool) |
Signals | |
| void | pixmapChanged () |
Public Member Functions | |
| MGridItem (QGraphicsItem *parent=0) | |
| virtual | ~MGridItem () |
| QString | image () const |
| QPixmap | pixmap () const |
| QString | title () const |
| QString | subtitle () const |
| bool | isImageVisible () const |
| bool | isTitleVisible () const |
| bool | isSubtitleVisible () const |
| void | setSelected (bool selected) |
Properties | |
| QString | image |
| QPixmap | pixmap |
| QString | title |
| QString | subtitle |
| bool | imageVisible |
| bool | titleVisible |
| bool | subtitleVisible |
MGridItem is a combiner class for displaying thumbnail, title and subTitle, used by MList, MGrid and MPopupList.
Using this class it is possible to display one image and two text label. You can set image by id in theme system or QPixmap
There are 4 different look of MGridItem MImage, set imageVisible = true, titleVisible = false, subtitleVisible = false MLabel, set imageVisible = false, titleVisible = true, subtitleVisible = false MImage+MLabel, set imageVisible = true, titleVisible = true, subtitleVisible = false MImage+2 MLabel, set imageVisible = true, titleVisible = true, subtitleVisible = true
You can change the image alignment to LeftAlign/RightAlign by modify CSS
Definition at line 51 of file corelib/widgets/mgriditem.h.
| MGridItem::MGridItem | ( | QGraphicsItem * | parent = 0 |
) |
Constructs a GridItem with a parent.
| parent | Parent object. |
Definition at line 37 of file mgriditem.cpp.
:
MWidgetController(new MGridItemPrivate(), new MGridItemModel(), parent)
{
setFlag(QGraphicsItem::ItemIsSelectable);
}
| MGridItem::~MGridItem | ( | ) | [virtual] |
| QString MGridItem::image | ( | ) | const |
Get the image name.
| bool MGridItem::isImageVisible | ( | ) | const |
Returns true if the image is visible.
Definition at line 74 of file mgriditem.cpp.
{
return model()->imageVisible();
}

| bool MGridItem::isSubtitleVisible | ( | ) | const |
Returns true if the subtitle is visible.
Definition at line 84 of file mgriditem.cpp.
{
return model()->subtitleVisible();
}

| bool MGridItem::isTitleVisible | ( | ) | const |
Returns true if the title is visible.
Definition at line 79 of file mgriditem.cpp.
{
return model()->titleVisible();
}

| QPixmap MGridItem::pixmap | ( | ) | const |
Get the thumbnail pixmap.
| void MGridItem::pixmapChanged | ( | ) | [signal] |
This signal is emitted when the pixmap is changed.
| void MGridItem::setImage | ( | const QString & | id | ) | [slot] |
Sets image id.
| id | the image id in theme system |
Definition at line 99 of file mgriditem.cpp.
{
model()->setImage(id);
}

| void MGridItem::setImageVisible | ( | bool | visible | ) | [slot] |
Set the visibility of the image.
Definition at line 127 of file mgriditem.cpp.
{
model()->setImageVisible(visible);
}

| void MGridItem::setPixmap | ( | const QPixmap & | pixmap | ) | [slot] |
Sets thumbnail pixmap.
| pixmap | QPixmap |
Definition at line 104 of file mgriditem.cpp.
{
Q_D(MGridItem);
d->pixmap = pixmap;
if (!model()->image().isEmpty()) {
// will make view update
model()->setImage("");
} else {
emit pixmapChanged();
}
}

| void MGridItem::setSelected | ( | bool | selected | ) |
set GridItem be selected Override the base function in QGraphicsItem
Definition at line 89 of file mgriditem.cpp.
{
if (selected)
style().setModeSelected();
else
style().setModeDefault();
MWidgetController::setSelected(selected);
}

| void MGridItem::setSubtitle | ( | const QString & | text | ) | [slot] |
Set subtitle text.
| text | text. |
Definition at line 122 of file mgriditem.cpp.
{
model()->setSubtitle(text);
}

| void MGridItem::setSubtitleVisible | ( | bool | visible | ) | [slot] |
Set the visibility of the subtitle.
Definition at line 137 of file mgriditem.cpp.
{
model()->setSubtitleVisible(visible);
}

| void MGridItem::setTitle | ( | const QString & | text | ) | [slot] |
Set title text.
| text | text. |
Definition at line 117 of file mgriditem.cpp.
{
model()->setTitle(text);
}

| void MGridItem::setTitleVisible | ( | bool | visible | ) | [slot] |
Set the visibility of the title.
Definition at line 132 of file mgriditem.cpp.
{
model()->setTitleVisible(visible);
}

| QString MGridItem::subtitle | ( | ) | const |
Get the subtitle.
| QString MGridItem::title | ( | ) | const |
Get the title.
MGridItem::image [read, write] |
Definition at line 62 of file corelib/widgets/mgriditem.h.
MGridItem::imageVisible [read, write] |
See MGridItemModel::imageVisible.
Definition at line 86 of file corelib/widgets/mgriditem.h.
MGridItem::pixmap [read, write] |
pixmap which will be displayed
Definition at line 68 of file corelib/widgets/mgriditem.h.
MGridItem::subtitle [read, write] |
Definition at line 80 of file corelib/widgets/mgriditem.h.
MGridItem::subtitleVisible [read, write] |
See MGridItemModel::subtitleVisible.
Definition at line 98 of file corelib/widgets/mgriditem.h.
MGridItem::title [read, write] |
Definition at line 74 of file corelib/widgets/mgriditem.h.
MGridItem::titleVisible [read, write] |
See MGridItemModel::titleVisible.
Definition at line 92 of file corelib/widgets/mgriditem.h.
| Copyright © 2010 Nokia Corporation | Generated on Thu Nov 4 2010 18:14:25 (PDT) Doxygen 1.7.1 |
MeeGo Touch |