Friday, July 8, 2011

Installing qtbindings on Ubuntu (11.04)

I installed qtbindings on my Ubuntu 11.04.

1. Resources
QtBindings Homepage:
Qt Homepage:
My Previous Installation (Ubuntu 10.10):
My Installation on Windows:

2. Requirements
Qt 4.6.x -- already installed (via installation of Qt Creator)
cmake 2.6.3+ -- I used Synaptic to install (2.8.3)
gcc 4.x -- already installed
Ruby -- already installed (Installing Ruby 1.9.2 on Ubuntu (11.04))

3. Installation
WARNING: This takes really long time. It took over 5 min for me.
$ sudo gem install qtbindings
Building native extensions.  This could take a while...  # get some coffee
Successfully installed qtbindings-
1 gem installed
Installing ri documentation for qtbindings-
Installing RDoc documentation for qtbindings-

4. Test
$ irb
irb(main):001:0> require 'Qt'
=> true
irb(main):002:0> a =
=> #<Qt::Application:0x97f20ac objectName="irb">
irb(main):003:0> button ='Hello World!',nil)
=> #<Qt::PushButton:0x97d199c objectName="", x=0, y=0, width=640, height=480>
irb(main):004:0> button.resize 300, 30
=> nil
=> nil
irb(main):006:0> a.exec
=> true

5. Result

1 comment:

  1. thanks, I'm also new to ruby and this is really helpful