From 79a219862f45a11c948bab574afa961a73b72b73 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 19 Jul 2021 16:03:41 +0200 Subject: Document that hiding/disabling a menu is best done via the menuAction Task-number: QTBUG-95072 Pick-to: 6.2 Change-Id: I83afe13b129a35b39c62abe553061cc4a390fd65 Reviewed-by: Paul Wicking --- src/widgets/widgets/qmenu.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 9612e11c01..c418f6dc7d 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -1678,7 +1678,9 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action) QWidgetAction fires the triggered() signal, the menu will close. \warning To make QMenu visible on the screen, exec() or popup() should be - used instead of show(). + used instead of show() or setVisible(). To hide or disable the menu in the + menubar, or in another menu to which it was added as a submenu, use the + respective properties of menuAction() instead. \section1 QMenu on \macos with Qt Build Against Cocoa -- cgit v1.2.3