免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2610 | 回复: 1
打印 上一主题 下一主题

[转载 ]Installing qtbindings (alt Qt-Ruby) on Ubuntu [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-29 17:30 |只看该作者 |倒序浏览
[转载 ]Installing qtbindings (alt Qt-Ruby) on Ubuntu








1. Requirements
Qt 4.6.x
cmake 2.6.3+
gcc 4.x
Ruby

2. Install qtbindings.

Bash代码  
1
  1. .$ gem install qtbindings   
  2. 2.2  
  3. 3.Building native extensions.  This could take a while...   
  4. 4.3  
  5. 5.Successfully installed qtbindings-4.6.3.2  
  6. 6.4  
  7. 7.1 gem installed   
  8. 8.5  
  9. 9.Installing ri documentation for qtbindings-4.6.3.2...   
  10. 10.6  
  11. 11.Installing RDoc documentation for qtbindings-4.6.3.2...  
  12. $ gem install qtbindings
  13. 2
  14. Building native extensions.  This could take a while...
  15. 3
  16. Successfully installed qtbindings-4.6.3.2
  17. 4
  18. 1 gem installed
  19. 5
  20. Installing ri documentation for qtbindings-4.6.3.2...
  21. 6
  22. Installing RDoc documentation for qtbindings-4.6.3.2...
复制代码
3. Test.

Ruby代码
  1. 1.01   
  2. 2.$ irb   
  3. 3.02   
  4. 4.ruby-1.9.2-p180 :001 > require 'Qt'  
  5. 5.03   
  6. 6. => true  
  7. 7.04   
  8. 8.ruby-1.9.2-p180 :002 > a = Qt::Application.new(ARGV)   
  9. 9.05   
  10. 10. => #<qt::application:0x88743dc objectname="irb">   
  11. 11.06   
  12. 12.ruby-1.9.2-p180 :003 > button = Qt::PushButton.new('Hello World!',nil)   
  13. 13.07   
  14. 14. => #<qt::pushbutton:0x8a04db4 objectname="" ,="" x="0," y="0," width="640," height="480">   
  15. 15.08   
  16. 16.ruby-1.9.2-p180 :004 > button.resize(300,30)   
  17. 17.09   
  18. 18. => nil  
  19. 19.10   
  20. 20.ruby-1.9.2-p180 :005 > button.show()   
  21. 21.11   
  22. 22. => nil  
  23. 23.12   
  24. 24.ruby-1.9.2-p180 :006 > a.exec()   
  25. 25.13   
  26. 26.</qt::pushbutton:0x8a04db4></qt::application:0x88743dc>  
  27. 01
  28. $ irb
  29. 02
  30. ruby-1.9.2-p180 :001 > require 'Qt'
  31. 03
  32. => true
  33. 04
  34. ruby-1.9.2-p180 :002 > a = Qt::Application.new(ARGV)
  35. 05
  36. => #<qt::application:0x88743dc objectname="irb">
  37. 06
  38. ruby-1.9.2-p180 :003 > button = Qt::PushButton.new('Hello World!',nil)
  39. 07
  40. => #<qt::pushbutton:0x8a04db4 objectname="" ,="" x="0," y="0," width="640," height="480">
  41. 08
  42. ruby-1.9.2-p180 :004 > button.resize(300,30)
  43. 09
  44. => nil
  45. 10
  46. ruby-1.9.2-p180 :005 > button.show()
  47. 11
  48. => nil
  49. 12
  50. ruby-1.9.2-p180 :006 > a.exec()
  51. 13
  52. </qt::pushbutton:0x8a04db4></qt::application:0x88743dc>
复制代码
5. Resouces.
RubyGems.org: http://rubygems.org/gems/qtbindings
QtBindings Homepage: https://github.com/ryanmelt/qtbindings
Qt Homepage: http://qt.nokia.com/

论坛徽章:
0
2 [报告]
发表于 2011-12-29 17:30 |只看该作者
谢谢分享
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP