diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-10-25 14:27:00 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-11-01 23:22:55 +0100 |
commit | 35ddf3498859dc184456346f2b070fe94dabaf26 (patch) | |
tree | f91cb4beca451e1a49303230973592758cf711f5 /src/gui | |
parent | 6ab16d52d282b1a370cda3f0cf0827142250ac29 (diff) |
Add QMenu::menuInAction as a static helper
QAction::menu is deprecated, as it makes QAction (a QtGui class) depend
on QtWidgets. The template hack works, but shouldn't become a permanent
solution and is already deprecated.
To get the QMenu out of a QAction that contains it, add a static helper
to QMenu instead. QAction continues to store the menu pointer so that
we don't have to use a dynamic property or an associative container in
QMenu.
Change-Id: Ieb6a2b1900d2fc2f16dd5a4a8ab7da98604642d3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qaction.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp index 9c0b1613dc..2d8d289c98 100644 --- a/src/gui/kernel/qaction.cpp +++ b/src/gui/kernel/qaction.cpp @@ -1225,7 +1225,7 @@ QAction::MenuRole QAction::menuRole() const /*! \fn QMenu *QAction::menu() const - \deprecated + \deprecated Use QMenu::menuForAction instead. Returns the menu contained by this action. |