是否可以在 64 位 Windows 7 上使用 Qt4 获得本机菜单?

编程入门 行业动态 更新时间:2024-10-23 01:48:05
本文介绍了是否可以在 64 位 Windows 7 上使用 Qt4 获得本机菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

用 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 获得本机菜单?

本文发布于:2023-10-09 18:29:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1476442.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:本机   菜单   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!