Home · All Classes · Main Classes · Deprecated
Public Types | Public Member Functions | Protected Member Functions | Properties

MBasicListItem Class Reference

MBasicListItem implementation of a simple widget which can be used with MList. More...

Inherits MListItem.

List of all members.

Public Types

enum  ItemStyle { SingleTitle, TitleWithSubtitle, IconWithTitle, IconWithTitleAndSubtitle }

Public Member Functions

 MBasicListItem (MBasicListItem::ItemStyle style=SingleTitle, QGraphicsItem *parent=NULL)
virtual ~MBasicListItem ()
void initLayout ()
void setItemStyle (ItemStyle itemStyle)
ItemStyle itemStyle () const
void setImageWidget (MImageWidget *imageWidget)
MImageWidgetimageWidget ()
void setTitle (const QString &title)
QString title ()
void setSubtitle (const QString &subtitle)
QString subtitle ()

Protected Member Functions

MLabeltitleLabelWidget ()
MLabelsubtitleLabelWidget ()
virtual QGraphicsLayoutcreateLayout ()
virtual void clearLayout ()

Properties

QString title
QString subtitle
MImageWidget imageWidget

Detailed Description

MBasicListItem implementation of a simple widget which can be used with MList.

Overview

MBasicListItem can show several lines of text and an icon. Exact layout depends on the style and can be set in:

Text and icon can be set using following functions:

Overview

MBasicListItem appearance can be customized in 2 ways.

Title, subtitle and icon are using styles provided by common layout.

Another way is to inherit MBasicListItem and override:


Member Enumeration Documentation

Specifies layout of MBasicListItem.

Enumerator:
SingleTitle 

Defines style which contains only one title.

TitleWithSubtitle 

Defines style which contains title and subtitle.

IconWithTitle 

Defines style which contains only one title and an icon.

IconWithTitleAndSubtitle 

Defines style which contains title, subtitle and an icon.


Constructor & Destructor Documentation

MBasicListItem::MBasicListItem ( MBasicListItem::ItemStyle  style = SingleTitle,
QGraphicsItem parent = NULL 
)

MBasicListItem constructor.

Parameters:
style The style of item to be initialized with, defaults to MBasicListItem::SingleTitle.
parent The item parent.
See also:
MBasicListItem::ItemStyle
MBasicListItem::setItemStyle()
MBasicListItem::~MBasicListItem (  )  [virtual]

MBasicListItem destructor.


Member Function Documentation

void MBasicListItem::clearLayout (  )  [protected, virtual]

Clears layout created by createLayout() function.

QGraphicsLayout * MBasicListItem::createLayout (  )  [protected, virtual]

Returns layout which will be assigned to MBasicListItem. Can be called several times, so it should clear layout which was already created.

See also:
MBasicListItem::titleLabelWidget()
MBasicListItem::subtitleLabelWidget()
MBasicListItem::imageWidget()
MImageWidget* MBasicListItem::imageWidget (  ) 

Creates or returns already created pointer to an item icon widget.

See also:
MBasicListItem::setImageWidget()
void MBasicListItem::initLayout (  ) 
Deprecated:
The method is no longer required to be called after constructing the item. There shouldn't be any need for this function.
MBasicListItem::ItemStyle MBasicListItem::itemStyle (  )  const

Returns current item style.

See also:
MBasicListItem::setItemStyle()
void MBasicListItem::setImageWidget ( MImageWidget imageWidget  ) 

Sets item icon widget. Ownership is transfered to the item.

See also:
MBasicListItem::imageWidget()
void MBasicListItem::setItemStyle ( ItemStyle  itemStyle  ) 
void MBasicListItem::setSubtitle ( const QString subtitle  ) 

Sets the item subtitle text.

See also:
MBasicListItem::subtitle()
void MBasicListItem::setTitle ( const QString title  ) 

Sets the item title text.

See also:
MBasicListItem::title()
QString MBasicListItem::subtitle (  ) 

Returns the item subtitle text.

See also:
MBasicListItem::setSubtitle()
MLabel * MBasicListItem::subtitleLabelWidget (  )  [protected]

Creates or returns already created subtitle widget.

See also:
MBasicListItem::setSubtitle()
MBasicListItem::subtitle()
QString MBasicListItem::title (  ) 

Returns the item title text.

See also:
MBasicListItem::setTitle()
MLabel * MBasicListItem::titleLabelWidget (  )  [protected]

Creates or returns already created title widget.

See also:
MBasicListItem::setTitle()
MBasicListItem::title()

Property Documentation

MBasicListItem::imageWidget [read, write]

Contains pointer to MImageWidget.

MBasicListItem::subtitle [read, write]

Contains subtitle text.

QString MBasicListItem::title [read, write]

Copyright © 2010 Nokia Corporation
MeeGo Touch