diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-06-17 12:21:20 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-06-18 14:42:24 +0000 |
commit | c0eafb9d75b6e24c03cde848b6482d0fcad9ee31 (patch) | |
tree | a7b7cf882659704848dd7061d067c8cb11929e54 /src/widgets/widgets/qmenu.cpp | |
parent | a851868e63311622bb83d2e08388b34c4d6d869e (diff) |
QMenu/QToolBar: Add overloads of addAction() using Qt 5 signals and slots.
Add documentation dummies and templates, add tests verifying
compilation.
Change-Id: Ide336b28bc069cfd17848ce3a17fd428e36ed65b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/widgets/qmenu.cpp')
-rw-r--r-- | src/widgets/widgets/qmenu.cpp | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 4403deda8e..bb2ffb63b8 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -1571,6 +1571,100 @@ QAction *QMenu::addAction(const QString &text, const QObject *receiver, const ch return action; } +/*!\fn 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 QAction *QMenu::addAction(const QString &text, Functor functor, 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 functor. 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 QAction *QMenu::addAction(const QString &text, const QObject *context, Functor functor, 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 functor. The function adds the newly created + action to the menu's list of actions and returns it. + + If \a context is destroyed, the functor will not be called. + + QMenu takes ownership of the returned QAction. +*/ + +/*!\fn 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. + + QMenu takes ownership of the returned QAction. +*/ + +/*!\fn QAction *QMenu::addAction(const QIcon &icon, const QString &text, Functor functor, 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 functor. 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 QAction *QMenu::addAction(const QIcon &icon, const QString &text, const QObject *context, Functor functor, 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 functor. The function adds the newly created + action to the menu's list of actions and returns it. + + If \a context is destroyed, the functor will not be called. + + QMenu takes ownership of the returned QAction. +*/ + /*! \overload |