我应该在桌面应用程序中使用Qt还是QML? [英] Should I use Qt or QML for my desktop application?

查看:107
本文介绍了我应该在桌面应用程序中使用Qt还是QML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道之前已经问过这个问题,但我想如果我解释了自己的情景,我可能会得到更多有用的答案。另外,我是Qt的新手,所以我还有一些其他问题。我最近开始使用Qt进行跨平台UI开发,但在决定QtQuick和Qt Widgets之间时却感到沮丧。我希望构建一个具有流畅动画的桌面应用程序,完全(或大部分)用C ++编写,并且无需安装框架即可部署。



我喜欢QML,因为它与WPF相似,但很快意识到它更适合移动平台。我发现所有textareas都隐藏了标准的'I'光标,我甚至无法用鼠标选择文本。据我所知,文本区域甚至没有背景属性。我还发现,默认情况下,鼓励onClick事件等用Javascript编写,而不是用C ++编写。然而,我发现在QML中创建动画非常容易。



Qt Widgets,另一方面,我读的更适合桌面,但我担心它就像WinForms一样,动画也会很复杂,而且没有简单的方法可以在Qt GUI中实现动画。



我还读到Qt Widgets已编译,但QML在运行时由框架解释。这是真的?我想出了如何将Qt静态链接到我的项目,但我仍然不确定这在QML方面有什么修正。从我的尝试来看,我认为QML仍然在运行时被解释。我也读过它也可能比较慢。



根据您的经验,您认为我应该选择哪种方式?任何帮助表示赞赏。谢谢!

I know this question has been asked before, but I thought if I explained my own scenario I might get more helpful answers. Plus, I'm new to Qt, so I have a few additional questions as well. I recently took up Qt for cross platform UI development, but became frustrated when deciding between QtQuick and Qt Widgets. I'm looking to build a desktop application with smooth animations, written entirely (or mostly) in C++, and deployable without the need to install a framework.

I like QML due to its similarity to WPF, but quickly realized its more geared towards mobile platforms. I found that all textareas hid the standard 'I' cursor, and I couldn't even select text with my mouse. The text areas, as far as I could see, didn't even have a background property. I also found that by default, onClick events and such are encouraged to be written in Javascript, not C++. Yet, I find it very easy to create animations in QML.

Qt Widgets, on the other hand, I read is more geared towards the desktop, but I fear it will be like WinForms and the animations will be complex and jotty, and there is no easy way to implement animations in Qt GUI.

I also read that Qt Widgets is compiled, yet QML is interpreted by the framework at runtime. Is this true? I figured out how to statically link Qt to my projects, but I'm still not sure this fixes anything in the QML regard. From what I've tried, I think QML is still interpreted at runtime. I also read it can be slower, too.

In your experience, which do you think I should go with? Any help is appreciated. Thanks!

推荐答案

如果你只对桌面有所了解并且你对Qt有明确的看法,动画是你正在做的事情的重点,那么请看看Qt的OpenGL支持。它与桌面上的Qt Widgets集成在一起,所以你大部分都在使用它们,但OpenGL支持是额外的,最后我看到了令人印象深刻。我的Qt有点过时,但我怀疑他们已经把它拿出来或许只是停止大喊大叫。
If you're definite about desktop only and you're definite about Qt and animation is the focus of what you're doing then have a look at Qt's OpenGL support. It's integrated with Qt Widgets on the desktop so you'd mostly be using those but the OpenGL support is additional and last I saw quite impressive. My Qt is a little out of date but I doubt they've taken it out perhaps just stopped shouting about it.


这篇关于我应该在桌面应用程序中使用Qt还是QML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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