完全使用 QtScript 创建 GUI 应用程序,您有何看法?

发布于 2024-07-12 11:08:19 字数 197 浏览 7 评论 0原文

自从宣布 QT 许可证变更以来,我开始研究 QT 框架。 它看起来不错,但我不喜欢必须使用 C++。 我知道不同的语言有不同的绑定,但 QtScript 对我来说似乎最有趣。

是否可以使用 QtScript 来编写完整的 GUI 应用程序代码(当然需要 UI 设计人员的帮助),或者它仅用于编写现有应用程序部分的脚本。

Since QT license change is announced I started to take a look at the QT framework. It looks nice, but I don't like having to use C++. I know there are different bindings for various languages, but QtScript seems most interesting to me.

Is it possible to use QtScript to code complete GUI application (with help from UI designer, of course), or it is only meant for scripting parts of existing applications.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

三月梨花 2024-07-19 11:08:19

是的,完全有可能这样做。 但是,由于 Qt(直到 4.5)默认情况下不提供 Qt 脚本绑定,因此您需要生成它并可能将其包含在您的应用程序中。 但这只是一次性步骤,请参阅 http://labs.trolltech.com/ page/Projects/QtScript/Generator 获取绑定。

这是一个示例: http://labs .trolltech.com/blogs/2009/01/06/simple-qtscript-based-bar-chart/。 应用程序逻辑完全在 QtScript 中。 您只需要使用解释器启动(请参阅上面的绑定生成器)。

Yes, it is perfectly possible to do so. However, since Qt (until 4.5) does not ship the Qt Script bindings by default, you need to generate it and probably include it with your application. But this is one-time step only, refer to http://labs.trolltech.com/page/Projects/QtScript/Generator to get the binding.

Here is an example: http://labs.trolltech.com/blogs/2009/01/06/simple-qtscript-based-bar-chart/. The application logic is completely in QtScript. You just need to launch with the interpreter (see the binding generator above).

香橙ぽ 2024-07-19 11:08:19

QtScript 旨在让您将应用程序的部分内容导出到脚本引擎,从而获得更大的灵活性。 您始终还必须编写一些 C++ 代码来支持 QtScript 部分。 我会根据您的喜好坚持使用您已经检查过的替代方案,例如 PyQt 或 QtRuby。

QtScript is designed to let you export parts of your application to the scripting engine to allow you for more flexibility. You will always have to also write some C++ code to support the QtScript part. I would stick with the alternatives you have already checked out like PyQt or QtRuby depending on your preference.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文