Home

QtPieItem Class Reference

The QtPieItem class is the base class for QtPieMenu. More...

 #include <QtPieItem>

Inherits QWidget.

Inherited by QtPieMenu.

Public Functions

Additional Inherited Members


Detailed Description

The QtPieItem class is the base class for QtPieMenu.

It has a very simple interface, providing the base implementation of functions common for QtPieMenu and QtPieAction.

The text of an item is set with setText() and retrieved with text(). Similarly, setIcon() and icon() set and get the icon set associated with the item.

QtPieMenu uses weight() to determine how much space an item should claim on a pie. The weights of the items are compared so that an item with a weight of 2 claims twice as much space as one of weight 1. Use setWeight() to set the weight of an item.

type() returns the type of the item. This is used by QtPieMenu to determine wheter an item triggers a simple action or whether it pops up a submenu.


Member Function Documentation

QtPieItem::QtPieItem ( const QString & title = QString::null, unsigned int weight = 1, QWidget * parent = 0 )

Constructs a QtPieItem. The title and weight arguments are stored as member data. The parent argument is passed to QWidget's constructor.

QtPieItem::QtPieItem ( const QIcon & icon, const QString & text = QString(), unsigned int weight = 1, QWidget * parent = 0 )

Constructs a QtPieItem. The icon, text and weight arguments are stored as member data. The parent argument is passed to QWidget's constructor.

QtPieItem::~QtPieItem ()   [virtual]

Destructs a QtPieItem.

QIcon QtPieItem::icon () const

Returns a reference to the icon for this item.

See also setIcon().

bool QtPieItem::isEnabled () const

Returns true if this menu is enabled, otherwise returns false.

void QtPieItem::setEnabled ( bool enabled = true )

Enables this item if enabled is true, otherwise disables this item.

See also isEnabled().

void QtPieItem::setIcon ( const QIcon & icon )

Sets the item's icon to icon.

See also icon().

void QtPieItem::setText ( const QString & text )

Sets the item's text to text.

See also text().

void QtPieItem::setWeight ( int weight )

Sets the item's weight to weight.

See also weight().

QString QtPieItem::text () const

Returns the title of this QtPieItem.

See also setText().

int QtPieItem::type () const   [virtual]

Returns the type of node as a QtPieItem::Type. Valid values are Invalid, Action and SubMenu.

int QtPieItem::weight () const

Returns the weight of the item.

See also setWeight().


Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Solutions