是否可以在Windows 7(64位)上使用Qt4获得本机菜单? [英] Is is possible to get native menus with Qt4 on Windows 7, 64-bit?

查看:87
本文介绍了是否可以在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获得本机菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆