Qtopia Home - Classes - Hierachy - Annotated - Functions - Qt Embedded |

# Accessory Class Reference

The Accessory class allows applet plugins to add themselves to the Q menu. More...

`#include <qtopia/accessory.h>`

List of all member functions.

## Public Members

- Accessory ( const QIconSet & icon, const QString & text, QWidget * parent )
- Accessory ( const QIconSet & icon, const QString & text, QPopupMenu * submenu, QWidget * parent )
- virtual ~Accessory ()
- QIconSet iconSet () const
- QString text () const
- void setIconSet ( const QIconSet & icon )
- void setText ( const QString & text )
- QPopupMenu * popup () const

## Signals

- void activated ()
- void activated ( int )

## Detailed Description

The Accessory class allows applet plugins to add themselves to the Q menu.

Accessories can either add a single menu entry, or add a sub-menu.

Accessories are particularly useful when using real estate on the taskbar would be wasteful.

First availability: Qtopia 1.6

See also TaskbarAppletInterface and Qtopia Classes.

## Member Function Documentation

### Accessory::Accessory ( const QIconSet & icon, const QString & text, QWidget * parent )

Constructs an Accessory object with parent parent.

This constructor places a new menu entry in the Q menu, with the name text and using the iconset icon.

The activated() signal will be emitted when the user selects this item.

### Accessory::Accessory ( const QIconSet & icon, const QString & text, QPopupMenu * submenu, QWidget * parent )

Constructs an Accessory object with parent parent.

This constructor places a new menu entry in the Q menu, with the name text and using the iconset icon.

The submenu, if non-zero, must have no parent object. The activated(int) signal will be emitted when the user selects an item from the submenu.

### Accessory::~Accessory ()`[virtual]`

Destructs Accessory.

### void Accessory::activated ()`[signal]`

This signal is emitted when the menu item is activated.

### void Accessory::activated ( int )`[signal]`

This signal is emitted when a menu item in the submenu is activated.

### QIconSet Accessory::iconSet () const

Returns the QIconSet displayed in the menu.

See also setIconSet().

### QPopupMenu * Accessory::popup () const

Returns a pointer to the sub-menu, or 0 if a sub-menu does not exist.

### void Accessory::setIconSet ( const QIconSet & icon )

Sets icon as the icon shown in the menu.

See also iconSet().

### void Accessory::setText ( const QString & text )

Sets text as the text shown in the menu.

See also text().

### QString Accessory::text () const

Returns the text displayed in the menu.

See also setText().

This file is part of the Qtopia platform, copyright © 1995-2004 Trolltech, all rights reserved.