- Qt 6.4
- Qt Widgets
- C++ Classes
- QMenu
- Qt 6.4.3 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, const QObject *receiver, const char *member, const QKeySequence &shortcut)
`(deprecated)` QAction * | addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut)
`(deprecated)` QAction * | addAction(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 QIcon &icon, const QString &text, Functor functor, const QKeySequence &shortcut)
`(deprecated)` QAction * | addAction(const QIcon &icon, const QString &text, const QObject *context, Functor functor, const QKeySequence &shortcut)

## Member Function Documentation

### 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.

### 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.

### `[since 5.6]` 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.

This function was introduced in Qt 5.6.

### `[since 5.6]` 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.

This function was introduced in Qt 5.6.

### `[since 5.6]` 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.

This function was introduced in Qt 5.6.

### `[since 5.6]` 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.

This function was introduced in Qt 5.6.