QtRuby 可以与 Qt 5 一起使用吗? [英] Does QtRuby work with Qt 5?

查看:60
本文介绍了QtRuby 可以与 Qt 5 一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网上能找到的关于 QtRuby 的所有内容都使用 Qt 4,但 Qt 的当前版本是 5.这仅仅是文档没有赶上现实的问题吗,Qt 5 与 QtRuby 一起工作得很好吗?

Everything I can find online about QtRuby uses Qt 4, but the current version of Qt is 5. Is this simply a matter of documentation not catching up with reality, where Qt 5 would work just fine with QtRuby?

如果您断言是这种情况(Qt5 不受支持),那么请用证据支持您的断言.

If you assert that this is the case (that Qt5 is unsupported) then please backup your assertion with evidence.

推荐答案

QtRuby

Qtruby 和 korundum 已经很多年没有维护了.要获得 qtruby 的维护版本,请将 qtbindings 安装为 ruby​​ gem.

QtRuby

Qtruby and korundum are not maintained for years now. To get a maintained version of qtruby, install qtbindings as ruby gem.

Qtbindings 主页:https://github.com/ryanmelt/qtbindings/

Qtbindings home page: https://github.com/ryanmelt/qtbindings/

另见https://github.com/ryanmelt/qtbindings/issues/131 关于支持 Qt5 的讨论.

Also see https://github.com/ryanmelt/qtbindings/issues/131 for a discussion about supporting Qt5.

Ruby-qml 是 Ruby 的 QML/Qt Quick 包装器.它提供了 QML 和 Ruby 之间的绑定,并使您能够使用 Qt5 Ruby 中基于快速的 GUI.

Ruby-qml is a QML / Qt Quick wrapper for Ruby. It provides bindings between QML and Ruby and enables you to use Qt5 Quick-based GUI from Ruby.

与 QtRuby 相比,Ruby-QML 提供的绑定要精简得多.特别是不能直接访问 Qt 类的方法.当来自 QtRuby 时,这首先似乎是一个缺点.

The bindings provided by Ruby-QML are much leaner in comparison to QtRuby. In particular there is no direct access to the Qt classes' methods. That might first seem to be a a disadvantage when coming from QtRuby.

在学习使用 Ruby-QML 时,很快就会发现优势大于局限性:

When learning to use use Ruby-QML, it turns out quickly that the advantages outweigh the limitations:

  • QML 和 JS 极大地补充了 UI 的静态和动态方面的描述和建模
  • QML/JS 的用户社区非常庞大.与在小型 QT/Ruby 社区中相比,查找示例或帮助解决 QML/JS 问题要容易得多.
  • Ruby-qml 上的示例非常完整,可以演示入门所需的结构.
  • JS 可用作 Ruby 和 Qt 之间灵活的粘合逻辑".
  • QML and JS greatly complement to describe and model the static and dynamic aspects of the UI
  • The user community of QML/JS is huge. It is so much easier to find examples or help to solve QML/JS issues, than it was within the tiny QT/Ruby community.
  • The examples on Ruby-qml are pretty much complete to demonstrate the constructs needed to get started.
  • JS may be used as flexible 'glue logic' between Ruby and Qt.

这篇关于QtRuby 可以与 Qt 5 一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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