Simulate QMenu hover on a QAction?

Matic Kukovec kukovecmatic at
Tue Jul 27 08:32:49 BST 2021

Hello Maurizio,

I just rechecked, and yes, I'm not using a QAction, but a QWidgetAction on which I first set a default widget with setDefaultWidget,
which is a groupbox with a few labels with text/images, then add a menu with setMenu.
Could this be the issue? This is how it looks like:
Only when the item action with the arrow at the end is clicked, only then the sub-menu appears. Is it possible to make it appear when just  hovering over the QWidgetAction?


From: Maurizio Berti <maurizio.berti at>
Sent: Tuesday, July 27, 2021 5:53 AM
To: Matic Kukovec <kukovecmatic at>
Cc: pyqt at <pyqt at>
Subject: Re: Simulate QMenu hover on a QAction?

I'm not sure I'm understanding your question.
If you add a QAction to a QMenu and that action has a menu set with setMenu(), it will behave exactly like adding a submenu, as it fundamentally does the same thing: menu.addMenu Qt actually adds the menuAction for that menu, so it's the same as doing addAction with an action that has a menu.

Il giorno lun 26 lug 2021 alle ore 09:39 Matic Kukovec <kukovecmatic at<mailto:kukovecmatic at>> ha scritto:
Hi guys,

I have a QMenu that has QActions with menus. This works great, but to show a QAction's menu,
it is needed to click on the action for it to appear.

Is it possible to make the QAction's menu appear on mouse hover, the same as for a sub-QMenu in a QMenu?


È difficile avere una convinzione precisa quando si parla delle ragioni del cuore. - "Sostiene Pereira", Antonio Tabucchi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ZovLGHbLW6.gif
Type: image/gif
Size: 222439 bytes
Desc: ZovLGHbLW6.gif
URL: <>

More information about the PyQt mailing list