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

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

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

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

发布评论

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

>www.elefans.com

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