Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RoundMenu在父组件隐藏后子菜单不能正常隐藏 #41

Closed
TwooSix opened this issue Mar 27, 2023 · 5 comments · Fixed by #82
Closed

RoundMenu在父组件隐藏后子菜单不能正常隐藏 #41

TwooSix opened this issue Mar 27, 2023 · 5 comments · Fixed by #82
Labels
bug Something isn't working

Comments

@TwooSix
Copy link
Contributor

TwooSix commented Mar 27, 2023

多次右键两个RoundMenu的时候,子菜单有可能异常显示。
猜测是父菜单隐藏前鼠标滑动到了子菜单上,子菜单打开,父菜单隐藏,但子菜单却没有跟着父菜单隐藏。
动画2

@TwooSix TwooSix added the bug Something isn't working label Mar 27, 2023
@zhiyiYo
Copy link
Owner

zhiyiYo commented Mar 27, 2023

原图是三级菜单吗

@TwooSix
Copy link
Contributor Author

TwooSix commented Mar 27, 2023

原图是三级菜单吗

异常显示的是二级菜单,预处理菜单下的都是Ation,但实际三级菜单也会异常显示。
对了,图中两张图片对应的是两个不同的menu实例。但这似乎没有影响,我后续测试的时候在同一个实例下也能复现bug。
复现方法是:右键打开一级菜单,鼠标滑过子菜单,在它播放弹出动画但未完全打开的时候快速的到其他地方右键再次打开一级菜单。
在两个不同实例的时候更容易复现bug。

@zhiyiYo
Copy link
Owner

zhiyiYo commented Mar 27, 2023

菜单实例的生命周期和窗口一样长吗?如果只在 contextMenuEvent 里面创建菜单还会有这个问题吗

@TwooSix
Copy link
Contributor Author

TwooSix commented Mar 27, 2023

菜单实例的生命周期和窗口一样长吗?如果只在 contextMenuEvent 里面创建菜单还会有这个问题吗

原本是一样长,尝试只在Event里创建的话复现概率会小很多,但还是有小概率出现。
应该不会是我程序的问题吧?我切换到Qmenu的时候一直是没能复现成功🤔

@zhiyiYo
Copy link
Owner

zhiyiYo commented Mar 27, 2023

QMenu 不会有这个问题的,因为我是用 QListWidget 模拟的菜单,所以会有一些细节问题,脑壳疼

@TwooSix TwooSix mentioned this issue Apr 4, 2023
zhiyiYo pushed a commit that referenced this issue Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants