Home · All Classes · Main Classes · Deprecated
Public Slots | Signals | Public Member Functions | Properties

MGridItem Class Reference

MGridItem is a combiner class for displaying thumbnail, title and subTitle, used by MList, MGrid and MPopupList. More...

Inheritance diagram for MGridItem:
Inheritance graph
[legend]
Collaboration diagram for MGridItem:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

MGridItem is a combiner class for displaying thumbnail, title and subTitle, used by MList, MGrid and MPopupList.

Overview

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

Deprecated:
Please use MContentItem, MBasicListItem, MAdvancedListItem, MDetailedListItem

Definition at line 51 of file corelib/widgets/mgriditem.h.


Constructor & Destructor Documentation

MGridItem::MGridItem ( QGraphicsItem parent = 0  ) 

Constructs a GridItem with a parent.

Parameters:
parent Parent object.

Definition at line 37 of file mgriditem.cpp.

                                         :
    MWidgetController(new MGridItemPrivate(), new MGridItemModel(), parent)
{
    setFlag(QGraphicsItem::ItemIsSelectable);
}

MGridItem::~MGridItem (  )  [virtual]

Destructor.

Definition at line 49 of file mgriditem.cpp.

{
}


Member Function Documentation

QString MGridItem::image (  )  const

Get the image name.

Returns:
image id in theme system
bool MGridItem::isImageVisible (  )  const

Returns true if the image is visible.

Definition at line 74 of file mgriditem.cpp.

{
    return model()->imageVisible();
}

Here is the call graph for this function:

bool MGridItem::isSubtitleVisible (  )  const

Returns true if the subtitle is visible.

Definition at line 84 of file mgriditem.cpp.

{
    return model()->subtitleVisible();
}

Here is the call graph for this function:

bool MGridItem::isTitleVisible (  )  const

Returns true if the title is visible.

Definition at line 79 of file mgriditem.cpp.

{
    return model()->titleVisible();
}

Here is the call graph for this function:

QPixmap MGridItem::pixmap (  )  const

Get the thumbnail pixmap.

Returns:
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.

Parameters:
id the image id in theme system

Definition at line 99 of file mgriditem.cpp.

{
    model()->setImage(id);
}

Here is the call graph for this function:

void MGridItem::setImageVisible ( bool  visible  )  [slot]

Set the visibility of the image.

Definition at line 127 of file mgriditem.cpp.

{
    model()->setImageVisible(visible);
}

Here is the call graph for this function:

void MGridItem::setPixmap ( const QPixmap pixmap  )  [slot]

Sets thumbnail pixmap.

Parameters:
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();
    }
}

Here is the call graph for this function:

void MGridItem::setSelected ( bool  selected  ) 

set GridItem be selected Override the base function in QGraphicsItem

Definition at line 89 of file mgriditem.cpp.

Here is the call graph for this function:

void MGridItem::setSubtitle ( const QString text  )  [slot]

Set subtitle text.

Parameters:
text text.

Definition at line 122 of file mgriditem.cpp.

{
    model()->setSubtitle(text);
}

Here is the call graph for this function:

void MGridItem::setSubtitleVisible ( bool  visible  )  [slot]

Set the visibility of the subtitle.

Definition at line 137 of file mgriditem.cpp.

{
    model()->setSubtitleVisible(visible);
}

Here is the call graph for this function:

void MGridItem::setTitle ( const QString text  )  [slot]

Set title text.

Parameters:
text text.

Definition at line 117 of file mgriditem.cpp.

{
    model()->setTitle(text);
}

Here is the call graph for this function:

void MGridItem::setTitleVisible ( bool  visible  )  [slot]

Set the visibility of the title.

Definition at line 132 of file mgriditem.cpp.

{
    model()->setTitleVisible(visible);
}

Here is the call graph for this function:

QString MGridItem::subtitle (  )  const

Get the subtitle.

Returns:
subtitle text string.
QString MGridItem::title (  )  const

Get the title.

Returns:
title text string.

Property Documentation

MGridItem::image [read, write]

See MGridItemModel::image.

Definition at line 62 of file corelib/widgets/mgriditem.h.

MGridItem::imageVisible [read, write]
MGridItem::pixmap [read, write]

pixmap which will be displayed

Definition at line 68 of file corelib/widgets/mgriditem.h.

MGridItem::subtitle [read, write]

See MGridItemModel::subtitle.

Definition at line 80 of file corelib/widgets/mgriditem.h.

MGridItem::subtitleVisible [read, write]
MGridItem::title [read, write]

See MGridItemModel::title.

Definition at line 74 of file corelib/widgets/mgriditem.h.

MGridItem::titleVisible [read, write]

Copyright © 2010 Nokia Corporation Generated on Thu Nov 4 2010 18:14:25 (PDT)
Doxygen 1.7.1
MeeGo Touch