zhiyiYo / PyQt-Fluent-Widgets

A fluent design widgets library based on C++ Qt/PyQt/PySide. Make Qt Great Again.
https://qfluentwidgets.com
GNU General Public License v3.0
5.61k stars 541 forks source link

how can create a subMenu of RoundedMenu with multiple parent Menus #662

Closed immiProgrammer closed 10 months ago

immiProgrammer commented 10 months ago

a menu has multiple self.parentMenu and self.menuItem in https://github.com/zhiyiYo/PyQt-Fluent-Widgets/blob/6b37964b70e0f7d1d16fa455b01ff233fcc728e6/qfluentwidgets/components/widgets/menu.py#L328C9-L328C9

zhiyiYo commented 10 months ago

Is there an example? I didn't understand what it meant

immiProgrammer commented 10 months ago

1 subMeun is used in 2 parent menus Menu1.addMenu(submenu) Menu2.addMenu(submenu) when exec Menu1 it has item of 'submenu' but doesn't work when hover it and Menu2 also has 'submenu' item and working fine both parent menus (Menu1 and Menu2) has 'submenu' in self._subMenus list

zhiyiYo commented 10 months ago

Submenu stores a parent pointer. So you should create one more submenu instead of sharing the same one.

immiProgrammer commented 10 months ago

Done