Qt 应用程序在 Windows 下看起来和感觉是原生的吗? [英] Do Qt apps look and feel native under Windows?

查看:21
本文介绍了Qt 应用程序在 Windows 下看起来和感觉是原生的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我即将将我的一个 Mac 应用程序移植到 Windows.Mac 应用程序的 UI 使用 Apple 的原生 Cocoa/Appkit 框架.UI 是 Obj-C 代码,核心应用功能是可移植的 C++ 代码.

I’m about to port one of my Mac applications to Windows. The Mac app uses Apple’s native Cocoa/Appkit frameworks for the UI. The UI is Obj-C code, and the core app functionality is portable C++ code.

现在我正在寻找一种将应用程序移植到 Windows 并使其外观和感觉对 Windows 用户来说是原生的方法.我的选择是微软的 MFC 和 Qt 框架.虽然我确信 MFC 应用程序具有原生的外观和感觉,但我记得 MFC 编码框架本身的内容很糟糕.我从开发者的角度研究了 Qt,并喜欢它.

Now I’m looking for a way to port the app to Windows and to make it look and feel native to Windows users. My choices are Microsoft’s MFC and the Qt framework. Though I’m sure MFC apps have the native look and feel, what I remember from MFC coding the framework itself is horrible. I took a look into Qt and like it from the developer’s perspective.

但由于我不是 Windows 用户,我不知道 Qt 应用程序是否具有原生的 Windows 外观和感觉.

But as I am not a Windows user I have no idea whether Qt apps have a native Windows look and feel.

因此我的问题是:我能否(无需大量工作)使 Qt 应用程序的行为和外观看起来像是使用本机 Windows 框架编写的?

Thus my question: Can I make (without a lot of work) a Qt app behave and look like it was written with the native Windows frameworks?

推荐答案

您可以轻松更改 Qt 应用程序的样式.在 Windows 和 Mac 上,默认样式实际上是使用原生函数来绘制窗口、控件等.

You can easily change the style of a Qt application. On Windows and Mac the default style is actually using the native functions for drawing windows, controls and the like.

此外,Qt 确实采取了许多措施,因此即使是应用程序的最小方面(您甚至不会想到的事情)也能模拟特定平台的本机行为.因此,您的 Qt 应用程序在移植时也可以替换您当前的 Mac 应用程序.

Additionally Qt does take many measures so that even the smallest aspects of an application (things you wouldn't even think of) emulate the native behaviour of a specific platform. So your Qt application can also replace your current Mac application when ported.

我强烈建议您不要使用 MFC,您会后悔的(尤其是如果您从未使用过原生 Win32 API).在灵活性和易用性方面,它与 Qt 完全相反.

I extremely advise you not to use MFC, you will regret it (especially if you never worked with the native Win32 API). It's the complete opposite of Qt regarding flexibility and ease of use.

这篇关于Qt 应用程序在 Windows 下看起来和感觉是原生的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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