diff options
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qmenu.cpp | 42 | ||||
-rw-r--r-- | src/widgets/widgets/qmenu.h | 4 | ||||
-rw-r--r-- | src/widgets/widgets/qtoolbar.cpp | 38 | ||||
-rw-r--r-- | src/widgets/widgets/qtoolbar.h | 8 |
4 files changed, 17 insertions, 75 deletions
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index c79e88f094..bf1102434c 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -1800,21 +1800,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 @@ -1839,25 +1824,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. */ @@ -1886,8 +1857,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. diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h index 628f818b5e..84ab9e027a 100644 --- a/src/widgets/widgets/qmenu.h +++ b/src/widgets/widgets/qmenu.h @@ -82,14 +82,10 @@ public: QAction *addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char* member, const QKeySequence &shortcut = 0); #ifdef Q_CLANG_QDOC - template<typename PointerToMemberFunction> - QAction *addAction(const QString &text, const QObject *receiver, PointerToMemberFunction method, const QKeySequence &shortcut = 0); template<typename Functor> QAction *addAction(const QString &text, Functor functor, const QKeySequence &shortcut = 0); template<typename Functor> QAction *addAction(const QString &text, const QObject *context, Functor functor, const QKeySequence &shortcut = 0); - template<typename PointerToMemberFunction> - QAction *addAction(const QIcon &icon, const QString &text, const QObject *receiver, PointerToMemberFunction method, const QKeySequence &shortcut = 0); template<typename Functor> QAction *addAction(const QIcon &icon, const QString &text, Functor functor, const QKeySequence &shortcut = 0); template<typename Functor> diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp index 4af71c126e..1cd30e4d0d 100644 --- a/src/widgets/widgets/qtoolbar.cpp +++ b/src/widgets/widgets/qtoolbar.cpp @@ -799,18 +799,6 @@ QAction *QToolBar::addAction(const QIcon &icon, const QString &text, return action; } -/*!\fn template<typename PointerToMemberFunction> QAction *QToolBar::addAction(const QString &text, const QObject *receiver, PointerToMemberFunction method) - - \since 5.6 - - \overload - - Creates a new action with the given \a text. This action is added to - the end of the toolbar. The action's - \l{QAction::triggered()}{triggered()} signal is connected to the - \a method of the \a receiver. -*/ - /*!\fn template<typename Functor> QAction *QToolBar::addAction(const QString &text, Functor functor) \since 5.6 @@ -829,24 +817,13 @@ QAction *QToolBar::addAction(const QIcon &icon, const QString &text, \overload - Creates a new action with the given \a text. This action is added to - the end of the toolbar. The action's + Creates a new action with the given \a text. This action is added + to the end of the toolbar. The action's \l{QAction::triggered()}{triggered()} signal is connected to the - \a functor. - - If \a context is destroyed, the functor will not be called. -*/ - -/*!\fn template<typename PointerToMemberFunction> QAction *QToolBar::addAction(const QIcon &icon, const QString &text, const QObject *receiver, PointerToMemberFunction method) - - \since 5.6 + \a functor. The \a functor can be a pointer to a member function + in the \a context object. - \overload - - Creates a new action with the given \a icon and \a text. This - action is added to the end of the toolbar. The action's - \l{QAction::triggered()}{triggered()} signal is connected to the - \a method of the \a receiver. + If the \a context object is destroyed, the \a functor will not be called. */ /*!\fn template<typename Functor> QAction *QToolBar::addAction(const QIcon &icon, const QString &text, Functor functor) @@ -870,9 +847,10 @@ QAction *QToolBar::addAction(const QIcon &icon, const QString &text, Creates a new action with the given \a icon and \a text. This action is added to the end of the toolbar. The action's \l{QAction::triggered()}{triggered()} signal is connected to the - \a functor. + \a functor. The \a functor can be a pointer to a member function + of the \a context object. - If \a context is destroyed, the functor will not be called. + If the \a context object is destroyed, the \a functor will not be called. */ /*! diff --git a/src/widgets/widgets/qtoolbar.h b/src/widgets/widgets/qtoolbar.h index 4ae83190d1..0c434e8d1d 100644 --- a/src/widgets/widgets/qtoolbar.h +++ b/src/widgets/widgets/qtoolbar.h @@ -99,15 +99,11 @@ public: QAction *addAction(const QString &text, const QObject *receiver, const char* member); QAction *addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char* member); -#ifdef Q_QDOC - template<typename PointerToMemberFunction> - QAction *addAction(const QString &text, const QObject *receiver, PointerToMemberFunction method); +#ifdef Q_CLANG_QDOC template<typename Functor> QAction *addAction(const QString &text, Functor functor); template<typename Functor> QAction *addAction(const QString &text, const QObject *context, Functor functor); - template<typename PointerToMemberFunction> - QAction *addAction(const QIcon &icon, const QString &text, const QObject *receiver, PointerToMemberFunction method); template<typename Functor> QAction *addAction(const QIcon &icon, const QString &text, Functor functor); template<typename Functor> @@ -149,7 +145,7 @@ public: connect(result, &QAction::triggered, slot); return result; } -#endif // !Q_QDOC +#endif // !Q_CLANG_QDOC QAction *addSeparator(); QAction *insertSeparator(QAction *before); |