- Qt 6.5
- Qt Widgets
- C++ Classes
- QMenu
- Qt 6.5.0 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.

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

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

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

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