- Qt 6.10
- Qt Widgets
- C++ Classes
- QMenu
- Qt 6.10.2 Reference Documentation

# Obsolete Members for QMenu

The following members of class QMenu are deprecated. They are provided to keep old source code working. We strongly advise against using them in new code.

## Public Functions

`(deprecated)` QAction * | addAction(const QString &text, Functor functor, const QKeySequence &shortcut)
`(deprecated)` QAction * | addAction(const QIcon &icon, const QString &text, Functor functor, const QKeySequence &shortcut)
`(deprecated)` QAction * | addAction(const QString &text, const QObject *context, Functor functor, const QKeySequence &shortcut)
`(deprecated)` QAction * | addAction(const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut)
`(deprecated)` QAction * | addAction(const QIcon &icon, const QString &text, const QObject *context, Functor functor, const QKeySequence &shortcut)
`(deprecated)` QAction * | addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut)

## Member Function Documentation

### `[deprecated]` template <typename Functor> QAction *QMenu::addAction(const QString &text, Functor functor, const QKeySequence &shortcut)

This function is deprecated. We strongly advise against using it in new code.

Use QWidget::addAction(text, shortcut, functor) instead.

### `[deprecated]` template <typename Functor> QAction *QMenu::addAction(const QIcon &icon, const QString &text, Functor functor, const QKeySequence &shortcut)

This function is deprecated. We strongly advise against using it in new code.

Use QWidget::addAction(icon, text, shortcut, functor) instead.

### `[deprecated]` template <typename Functor> QAction *QMenu::addAction(const QString &text, const QObject *context, Functor functor, const QKeySequence &shortcut)

This function is deprecated. We strongly advise against using it in new code.

Use QWidget::addAction(text, shortcut, context, functor) instead.

### `[deprecated]` QAction *QMenu::addAction(const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut)

This function is deprecated. We strongly advise against using it in new code.

Use `QWidget::addAction(text, shortcut, receiver, member)` instead.

### `[deprecated]` template <typename Functor> QAction *QMenu::addAction(const QIcon &icon, const QString &text, const QObject *context, Functor functor, const QKeySequence &shortcut)

This function is deprecated. We strongly advise against using it in new code.

Use QWidget::addAction(icon, text, shortcut, context, functor) instead.

### `[deprecated]` QAction *QMenu::addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut)

This function is deprecated. We strongly advise against using it in new code.

Use QWidget::addAction(icon, text, shortcut, receiver, member) instead.