<div dir="ltr">Nice idea; that does work in PyQt6. Thanks.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 21, 2021 at 2:47 PM Dmitry Shachnev <<a href="mailto:mitya57@ubuntu.com">mitya57@ubuntu.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Apr 21, 2021 at 02:26:59PM -0400, RoadrunnerWMC wrote:<br>
> That'd work in that particular case, but it's still a problem that there's<br>
> (as far as I know) no way to implement the following common pattern in<br>
> PyQt6:<br>
><br>
> recent_menu = QtWidgets.QMenu()<br>
> recent_menu.addAction('foo.py')<br>
> recent_menu.addAction('bar.txt')<br>
> recent_menu.addAction('baz.png')<br>
><br>
> menu = main_window.menuBar().addMenu('&File')<br>
> menu.addAction('Open...')<br>
> menu.addAction('Open Recent').setMenu(recent_menu)<br>
<br>
I think you can use:<br>
<br>
recent_menu = QtWidgets.QMenu('Open Recent')<br>
<br>
and then simply:<br>
<br>
menu.addMenu(recent_menu)<br>
<br>
--<br>
Dmitry Shachnev<br>
</blockquote></div>