diff options
Diffstat (limited to 'src/widgets/widgets/qmenu.cpp')
-rw-r--r-- | src/widgets/widgets/qmenu.cpp | 42 |
1 files changed, 7 insertions, 35 deletions
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 48253b52b0..9b30ec4619 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -1783,21 +1783,6 @@ QAction *QMenu::addAction(const QString &text, const QObject *receiver, const ch return action; } -/*!\fn template<typename PointerToMemberFunction> QAction *QMenu::addAction(const QString &text, const QObject *receiver, PointerToMemberFunction method, const QKeySequence &shortcut = 0) - - \since 5.6 - - \overload - - This convenience function creates a new action with the text \a - text and an optional shortcut \a shortcut. The action's - \l{QAction::triggered()}{triggered()} signal is connected to the - \a method of the \a receiver. The function adds the newly created - action to the menu's list of actions and returns it. - - QMenu takes ownership of the returned QAction. -*/ - /*!\fn template<typename Functor> QAction *QMenu::addAction(const QString &text, Functor functor, const QKeySequence &shortcut = 0) \since 5.6 @@ -1822,25 +1807,11 @@ QAction *QMenu::addAction(const QString &text, const QObject *receiver, const ch This convenience function creates a new action with the text \a text and an optional shortcut \a shortcut. The action's \l{QAction::triggered()}{triggered()} signal is connected to the - \a functor. The function adds the newly created - action to the menu's list of actions and returns it. + \a functor. The functor can be a pointer to a member function of + the \a context object. The newly created action is added to the + menu's list of actions and a pointer to it is returned. - If \a context is destroyed, the functor will not be called. - - QMenu takes ownership of the returned QAction. -*/ - -/*!\fn template<typename PointerToMemberFunction> QAction *QMenu::addAction(const QIcon &icon, const QString &text, const QObject *receiver, PointerToMemberFunction method, const QKeySequence &shortcut = 0) - - \since 5.6 - - \overload - - This convenience function creates a new action with an \a icon - and some \a text and an optional shortcut \a shortcut. The action's - \l{QAction::triggered()}{triggered()} signal is connected to the - \a method of the \a receiver. The function adds the newly created - action to the menu's list of actions and returns it. + If the \a context object is destroyed, the functor will not be called. QMenu takes ownership of the returned QAction. */ @@ -1869,8 +1840,9 @@ QAction *QMenu::addAction(const QString &text, const QObject *receiver, const ch This convenience function creates a new action with an \a icon and some \a text and an optional shortcut \a shortcut. The action's \l{QAction::triggered()}{triggered()} signal is connected to the - \a functor. The function adds the newly created - action to the menu's list of actions and returns it. + \a functor. The \a functor can be a pointer to a member function + of the \a context object. The newly created action is added to the + menu's list of actions and a pointer to it is returned. If \a context is destroyed, the functor will not be called. |