用 Qt (4) 编写的应用程序在 64 位 Windows 7 上运行时没有本机菜单.这适用于 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 会很复杂,因为原生 Mac 菜单支持是通过 #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
更多推荐
是否可以在 64 位 Windows 7 上使用 Qt4 获得本机菜单?
发布评论