用 HTML+javascript 开发 C++ Qt 应用程序 GUI 界面? [英] Develop C++ Qt application GUI interfaces in HTML+javascript?

查看:35
本文介绍了用 HTML+javascript 开发 C++ Qt 应用程序 GUI 界面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个 Qt 应用程序,我们最终希望在某种程度上推动网络发展.为了更平滑的过渡,我们考虑在 HTML/javascript 中使用 QtWebKit 开发用户界面.稍后我们想在 Web 应用程序中重用这些 UI 部分,当我们在那里时.

We are working on a Qt application, that we eventually want to move the the web up to some extent. For smoother transition we consider developing the user interfaces using QtWebKit in HTML/javascript. Later we want to reuse these UI pieces in the web application, when we are there.

这听起来像是一个有意义的想法吗?在 HTML/Javascript 和 QtGui 中开发用户界面会复杂多少?这是一种常见做法,还是不常见?是否有任何我们应该注意的陷阱?

Does it sound like a meaningful idea? How much more complicated will it be to develop the user interfaces in HTML/Javascript vs QtGui? Is it a common practice, or no?Are there any pitfalls that we should be aware of?

推荐答案

这显然是一种常见的做法,但我强烈建议不要这样做.桌面应用程序不是 Web 浏览器.以您想要的方式设计您的逻辑,并构建您的 Qt 界面,使其与您的日志分离.如果您想构建网页版,请从头开始重新构建 UI,使其成为基于浏览器的客户端.

This is apparently a common practice, but I very strongly reccomend against it. A desktop application is not a web browser. Design your logic how you want, and build your Qt interface so that it's decoupled from your log. When you want to build a web version, rebuild the UI from scratch to be a browser based client.

这篇关于用 HTML+javascript 开发 C++ Qt 应用程序 GUI 界面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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