Thursday, May 26, 2011

Installing qtbindings (alt Qt-Ruby) on Ubuntu

Installed qtbindings (Ruby gem for Qt took kit).

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


2. Install qtbindings.
$ gem install qtbindings
Building native extensions.  This could take a while...
Successfully installed qtbindings-4.6.3.2
1 gem installed
Installing ri documentation for qtbindings-4.6.3.2...
Installing RDoc documentation for qtbindings-4.6.3.2...

3. Test.
$ irb
ruby-1.9.2-p180 :001 > require 'Qt'
 => true 
ruby-1.9.2-p180 :002 > a = Qt::Application.new(ARGV)
 => # 
ruby-1.9.2-p180 :003 > button = Qt::PushButton.new('Hello World!',nil)
 => # 
ruby-1.9.2-p180 :004 > button.resize(300,30)
 => nil 
ruby-1.9.2-p180 :005 > button.show()
 => nil 
ruby-1.9.2-p180 :006 > a.exec()

4. Result.





5. Resouces.
RubyGems.org: http://rubygems.org/gems/qtbindings
QtBindings Homepage: https://github.com/ryanmelt/qtbindings
Qt Homepage: http://qt.nokia.com/

1 comment:

  1. Thank you, thank you, thank you! Your guide saved my sanity.

    ReplyDelete