Ruby、Qt 和第三方小部件
我正在学习 Ruby,为此,我正在用它编写一个应用程序。我的背景是 C++/Qt。所以我开始编写 Ruby/Qt 应用程序。
但除了 qwt 之外,我还想使用一些以前编写的小部件(C++)。
这可能吗?如果是的话我该怎么办?
PS:看来 Korundum 绑定中的 QtRuby 确实包含 Qwt 绑定。我已经从 RubyForge 下载了绑定源,并且正在尝试构建它。 CMake 运行,但即使我在命令行中包含 Qwt 位置,它也会跳过构建它。
vitorpy@myhost:~/qtruby/qt4-qtruby-2.1.0> cmake -DCMAKE_INSTALL_PREFIX=/opt/kde4 -DENABLE_SMOKE=on -DENABLE_QTRUBY=on -DENABLE_QWT_SMOKE=on -DENABLE_QWT_RUBY=on -DQwt5_INCLUDE_DIR=/usr/local/qwt-5.2.1/include -DQwt5_Qt4_LIBRARY=/usr/local/qwt-5.2.1/lib/libqwt.so
它会生成:
-- Build Ruby bindings: QtRuby;QtScript;QtTest;QtUiTools;QtWebKit
-- Skip Ruby bindings: Akonadi;KHTML;KIO;KTextEditor;Korundum;KrossRuby;Nepomuk;Okular;Phonon;Plasma;QScintilla;Qwt;Solid;Soprano
其他资源: 链接我在 RubyForge 论坛上的帖子。
I'm learning Ruby and, for this, I'm writing an application in it. My background is in C++/Qt. So I've started writing a Ruby/Qt app.
But there's a few previously written widgets (C++) I would like to use, besides qwt.
Is this possible? If it is, how should I do it?
PS: It seems QtRuby from Korundum bindings do includes Qwt bindings. I've downloaded the bindings source from RubyForge and I'm trying to build it. CMake runs but even if I include the Qwt location in the command line, it skips building it.
vitorpy@myhost:~/qtruby/qt4-qtruby-2.1.0> cmake -DCMAKE_INSTALL_PREFIX=/opt/kde4 -DENABLE_SMOKE=on -DENABLE_QTRUBY=on -DENABLE_QWT_SMOKE=on -DENABLE_QWT_RUBY=on -DQwt5_INCLUDE_DIR=/usr/local/qwt-5.2.1/include -DQwt5_Qt4_LIBRARY=/usr/local/qwt-5.2.1/lib/libqwt.so
And it generates:
-- Build Ruby bindings: QtRuby;QtScript;QtTest;QtUiTools;QtWebKit
-- Skip Ruby bindings: Akonadi;KHTML;KIO;KTextEditor;Korundum;KrossRuby;Nepomuk;Okular;Phonon;Plasma;QScintilla;Qwt;Solid;Soprano
Other resources:
Link for my post on the RubyForge forum.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你用的是Ubuntu吗?
如果是这样,为什么要麻烦您构建 QtRuby 和 Qwt 的 Ruby 绑定,已经有可用的预构建包:
它可能会为您节省很多麻烦和挫败感。
Are you using Ubuntu?
If it is the case, why giving you the trouble to build QtRuby and Qwt's Ruby bindings, there is already existing pre-built packages available :
It may save you a lot of trouble and frustration.