在Windows 7(64位)上运行时,用Qt(4)编写的应用程序没有本机菜单.对于VLC,Lyx等知名应用程序而言,这是正确的.
Applications written in Qt (4) do not have native menus when run on Windows 7, 64-bit. This is true for well-known applications as VLC, Lyx, etc.
Qt菜单的行为不像本机菜单,这可能很烦人.例如,请看下面的屏幕截图.
Qt menus do not behave as native menus, which can be annoying. As an example, consider the screenshot below.
如果鼠标沿着红色路径快速移动,则子菜单将立即关闭.对于Windows(和Mac)上的本机菜单,会有一个延迟.这可能使菜单导航变得困难,因为它们的行为将不符合用户的期望.
If the mouse is rapidly moved along the red path, the sub menu will close immediately. For native menus in Windows (and on Macs) there is a delay. This can make it difficult to navigate in the menus, as they will not behave as the user expects.
是否可以在Windows中获取本机菜单?
Is it possible to get native menus in Windows instead?
推荐答案在Qt5中,有一个用于菜单的QPA API-用于创建本地Mac菜单.它可能很快就会在Android上使用,并且完全有可能在Windows上实现.向后移植到Qt4会很复杂,因为通过#ifdefs
In Qt5 there's a QPA API for the menus - it is used to create the native Mac menus. It will probably be used on Android soon, and a Windows implementation would be entirely possible. Back-porting to Qt4 would be complex, since the native Mac-menus support was achieved via #ifdefs
更多推荐
是否可以在Windows 7(64位)上使用Qt4获得本机菜单?
发布评论