- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | Friends

# QMenu Class Reference

Search for all occurrences

## Detailed Description

Definition at line 68 of file qmenu.h.

`#include <qmenu.h>`

Inheritance diagram for QMenu:
[legend]

List of all members.

## Signals
void | aboutToShow ()
void | aboutToHide ()
void | triggered (QAction *action)
void | hovered (QAction *action)
## Public Member Functions
| QMenu (QWidget *parent=0)
| QMenu (const QString &title, QWidget *parent=0)
| ~QMenu ()
QAction * | addAction (const QString &text)
QAction * | addAction (const QIcon &icon, const QString &text)
QAction * | addAction (const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut=0)
QAction * | addAction (const QIcon &icon, const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut=0)
QAction * | addMenu (QMenu *menu)
QMenu * | addMenu (const QString &title)
QMenu * | addMenu (const QIcon &icon, const QString &title)
QAction * | addSeparator ()
QAction * | insertMenu (QAction *before, QMenu *menu)
QAction * | insertSeparator (QAction *before)
bool | isEmpty () const
void | clear ()
void | setTearOffEnabled (bool)
bool | isTearOffEnabled () const
bool | isTearOffMenuVisible () const
void | hideTearOffMenu ()
void | setDefaultAction (QAction *)
QAction * | defaultAction () const
void | setActiveAction (QAction *act)
QAction * | activeAction () const
void | popup (const QPoint &pos, QAction *at=0)
QAction * | exec ()
QAction * | exec (const QPoint &pos, QAction *at=0)
QSize | sizeHint () const
QRect | actionGeometry (QAction *) const
QAction * | actionAt (const QPoint &) const
QAction * | menuAction () const
QString | title () const
void | setTitle (const QString &title)
QIcon | icon () const
void | setIcon (const QIcon &icon)
void | setNoReplayFor (QWidget *widget)
bool | separatorsCollapsible () const
void | setSeparatorsCollapsible (bool collapse)
## Static Public Member Functions
static QAction * | exec (QList< QAction * > actions, const QPoint &pos, QAction *at=0)
static QAction * | exec (QList< QAction * > actions, const QPoint &pos, QAction *at, QWidget *parent)
## Protected Member Functions
int | columnCount () const
void | changeEvent (QEvent *)
void | keyPressEvent (QKeyEvent *)
void | mouseReleaseEvent (QMouseEvent *)
void | mousePressEvent (QMouseEvent *)
void | mouseMoveEvent (QMouseEvent *)
void | wheelEvent (QWheelEvent *)
void | enterEvent (QEvent *)
void | leaveEvent (QEvent *)
void | hideEvent (QHideEvent *)
void | paintEvent (QPaintEvent *)
void | actionEvent (QActionEvent *)
void | timerEvent (QTimerEvent *)
bool | event (QEvent *)
bool | focusNextPrevChild (bool next)
void | initStyleOption (QStyleOptionMenuItem *option, const QAction *action) const
## Properties
bool | tearOffEnabled
QString | title
QIcon | icon
bool | separatorsCollapsible
## Friends
class | QMenuBar
class | QMenuBarPrivate
class | QTornOffMenu
class | Q3PopupMenu
class | QComboBox
class | QAction
class | QToolButtonPrivate

## Constructor & Destructor Documentation

QMenu | ( | QWidget * | parent = `0` | ) | `[explicit]`

QMenu | ( | const QString & | title,
|  | QWidget * | parent = `0`
| ) |  | `[explicit]`

~QMenu | ( |  | ) |

## Member Function Documentation

QAction* addAction | ( | const QString & | text | ) |

Search for all occurrences

QAction* addAction | ( | const QIcon & | icon,
|  | const QString & | text
| ) |  |

Search for all occurrences

QAction* addAction | ( | const QString & | text,
|  | const QObject * | receiver,
|  | const char * | member,
|  | const QKeySequence & | shortcut = `0`
| ) |  |

Search for all occurrences

QAction* addAction | ( | const QIcon & | icon,
|  | const QString & | text,
|  | const QObject * | receiver,
|  | const char * | member,
|  | const QKeySequence & | shortcut = `0`
| ) |  |

Search for all occurrences

QAction* addMenu | ( | QMenu * | menu | ) |

Search for all occurrences

QMenu* addMenu | ( | const QString & | title | ) |

Search for all occurrences

QMenu* addMenu | ( | const QIcon & | icon,
|  | const QString & | title
| ) |  |

Search for all occurrences

QAction* addSeparator | ( |  | ) |

Search for all occurrences

QAction* insertMenu | ( | QAction * | before,
|  | QMenu * | menu
| ) |  |

Search for all occurrences

QAction* insertSeparator | ( | QAction * | before | ) |

Search for all occurrences

bool isEmpty | ( |  | ) | const

Search for all occurrences

void clear | ( |  | ) |

Search for all occurrences

void setTearOffEnabled | ( | bool |  | ) |

Search for all occurrences

bool isTearOffEnabled | ( |  | ) | const

Search for all occurrences

bool isTearOffMenuVisible | ( |  | ) | const

Search for all occurrences

void hideTearOffMenu | ( |  | ) |

Search for all occurrences

void setDefaultAction | ( | QAction * |  | ) |

Search for all occurrences

QAction* defaultAction | ( |  | ) | const

Search for all occurrences

void setActiveAction | ( | QAction * | act | ) |

Search for all occurrences

QAction* activeAction | ( |  | ) | const

Search for all occurrences

void popup | ( | const QPoint & | pos,
|  | QAction * | at = `0`
| ) |  |

Search for all occurrences

QAction* exec | ( |  | ) |

Search for all occurrences

QAction* exec | ( | const QPoint & | pos,
|  | QAction * | at = `0`
| ) |  |

Search for all occurrences

static QAction* exec | ( | QList< QAction * > | actions,
|  | const QPoint & | pos,
|  | QAction * | at = `0`
| ) |  | `[static]`

Search for all occurrences

static QAction* exec | ( | QList< QAction * > | actions,
|  | const QPoint & | pos,
|  | QAction * | at,
|  | QWidget * | parent
| ) |  | `[static]`

Search for all occurrences

QSize sizeHint | ( |  | ) | const `[virtual]`

Search for all occurrences

Reimplemented from QWidget.

QRect actionGeometry | ( | QAction * |  | ) | const

Search for all occurrences

QAction* actionAt | ( | const QPoint & |  | ) | const

Search for all occurrences

QAction* menuAction | ( |  | ) | const

Search for all occurrences

QString title | ( |  | ) | const

Search for all occurrences

void setTitle | ( | const QString & | title | ) |

Search for all occurrences

QIcon icon | ( |  | ) | const

Search for all occurrences

void setIcon | ( | const QIcon & | icon | ) |

Search for all occurrences

void setNoReplayFor | ( | QWidget * | widget | ) |

Search for all occurrences

bool separatorsCollapsible | ( |  | ) | const

Search for all occurrences

void setSeparatorsCollapsible | ( | bool | collapse | ) |

Search for all occurrences

void aboutToShow | ( |  | ) | `[signal]`

Search for all occurrences

void aboutToHide | ( |  | ) | `[signal]`

Search for all occurrences

void triggered | ( | QAction * | action | ) | `[signal]`

Search for all occurrences

void hovered | ( | QAction * | action | ) | `[signal]`

Search for all occurrences

int columnCount | ( |  | ) | const `[protected]`

Search for all occurrences

void changeEvent | ( | QEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

void keyPressEvent | ( | QKeyEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

void mouseReleaseEvent | ( | QMouseEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

void mousePressEvent | ( | QMouseEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

void mouseMoveEvent | ( | QMouseEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

void wheelEvent | ( | QWheelEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

void enterEvent | ( | QEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

void leaveEvent | ( | QEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

void hideEvent | ( | QHideEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

void paintEvent | ( | QPaintEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

void actionEvent | ( | QActionEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

void timerEvent | ( | QTimerEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QObject.

bool event | ( | QEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

bool focusNextPrevChild | ( | bool | next | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QWidget.

void initStyleOption | ( | QStyleOptionMenuItem * | option,
|  | const QAction * | action
| ) |  | const `[protected]`

Search for all occurrences

## Friends And Related Function Documentation

friend class QMenuBar `[friend]`

Search for all occurrences

Definition at line 189 of file qmenu.h.

friend class QMenuBarPrivate `[friend]`

Search for all occurrences

Definition at line 407 of file qmenu.h.

friend class QTornOffMenu `[friend]`

Search for all occurrences

Definition at line 408 of file qmenu.h.

friend class Q3PopupMenu `[friend]`

Search for all occurrences

Definition at line 409 of file qmenu.h.

friend class QComboBox `[friend]`

Search for all occurrences

Definition at line 410 of file qmenu.h.

friend class QAction `[friend]`

Search for all occurrences

Definition at line 411 of file qmenu.h.

friend class QToolButtonPrivate `[friend]`

Search for all occurrences

Definition at line 412 of file qmenu.h.

## Property Documentation

bool tearOffEnabled `[read, write]`

Search for all occurrences

Definition at line 74 of file qmenu.h.

QString title `[read, write]`

Search for all occurrences

Definition at line 75 of file qmenu.h.

QIcon icon `[read, write]`

Search for all occurrences

Definition at line 76 of file qmenu.h.

bool separatorsCollapsible `[read, write]`

Search for all occurrences

Definition at line 77 of file qmenu.h.

The documentation for this class was generated from the following file:

- QtGui/qmenu.h

QMenu QMenu QMenu QMenu QMenu QMenu QMenu QMenu QMenu QMenu
QMenu QMenu QMenu QMenu QMenu QMenu QMenu QMenu QMenu QMenu