QMenuData Class Reference


The QMenuData class is a base class for QMenuBar and QPopupMenu. (details) (complete member list)

#include <qmenudta.h>

Inherited by QMenuBar and QPopupMenu.

Public Members

Protected Members


Detailed Description

The QMenuData class is a base class for QMenuBar and QPopupMenu.

QMenuData has an internal list of menu items. A menu item is a text or a pixmap in a menu. The menu item sends out an activated() signal when it is selected, and a highlighted() signal when it receives the user input focus.

Menu items can be accessed through identifiers.


Member Function Documentation

QMenuData::QMenuData ()

Constructs an empty list.

QMenuData::~QMenuData ()

Removes all menu items and disconnects any signals that have been connected.

void QMenuData::changeItem (const char *string, int id)

Changes the text of the menu item id.

void QMenuData::changeItem (const QPixmap &pixmap, int id)

Changes the pixmap of the menu item id.

bool QMenuData::connectItem (int id, const QObject *receiver, const char *member)

Connects a menu item to a receiver and a slot or signal.

The receiver will be notified when the menu item is activated.

int QMenuData::count () const

Returns the number of items in the menu.

bool QMenuData::disconnectItem (int id, const QObject *receiver, const char *member)

Disconnects a receiver/member from a menu item.

All connections are removed when the menu data object is destroyed.

void QMenuData::insertItem (const char *string, int id=-1, int index=-1)

Inserts a menu item with a text.

void QMenuData::insertItem (const char *string, QPopupMenu *popup, int id=-1, int index=-1)

Inserts a menu item with a text and a sub menu.

void QMenuData::insertItem (const QPixmap &pixmap, int id=-1, int index=-1)

Inserts a menu item with a pixmap.

void QMenuData::insertItem (const QPixmap &pixmap, QPopupMenu *popup, int id=-1, int index=-1)

Inserts a menu item with a pixmap and a sub menu.

bool QMenuData::isItemChecked (int id) const

Returns TRUE if the menu item has been checked.

bool QMenuData::isItemDisabled (int id) const

Returns TRUE if the item is disabled.

void QMenuData::removeItem (int id)

Removes the menu item which has the identifier id.

void QMenuData::setItemChecked (int id, bool check)

Checks a menu item if check is TRUE, or unchecks it if check is FALSE.

void QMenuData::setItemEnabled (int id, bool enable)

Enables the menu item if enable is TRUE, or disables the item if enable is FALSE.


This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.

It was generated from the following files:


Generated at 04:27, 1995/05/20 by the webmaster at Troll Tech