标签: c++ qt qmenu
我有一个包含子菜单的右键菜单。例如,它看起来像这样
man animal --> cat dog
此post建议使用action->associatedWidgets();返回当前操作链接到的小部件列表。
action->associatedWidgets();
我想要什么:
我希望每次点击animal或cat时,我的菜单都会返回dog。此外,单击子菜单。
animal
cat
dog
是否可以在不迭代小部件列表的情况下执行此操作?