# Graphical programming with Qt

**URL:** <https://www.ruby-forum.com/t/graphical-programming-with-qt/189385>\
**Category:** Ruby\
**Created:** [May 31, 2010, 1:42am UTC](https://www.ruby-forum.com/t/graphical-programming-with-qt/189385 "2010-05-31T01:42:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amoo3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@amoo3](https://www.ruby-forum.com/u/amoo3)\
**Post date:** [May 31, 2010, 1:42am UTC](https://www.ruby-forum.com/t/graphical-programming-with-qt/189385/1 "2010-05-31T01:42:16Z")

</div>

Hi every one  
How are you my friends?

I will finally kill my self. ☹

I want to write a graphical program with ruby and qt

but i can’t.

I installed qtruby4(2.1.0) gem and qt-win-opensource-4.3.4-mingw (70.6  
mb) and qtruby4installer (3mb) and qt-sdk-win-opensource-2010.02.1  
(273mb) but there is  
just errors.  
I use ruby 1.8.6.

I configure the environment variables like this:

path c:\Qt\4.3.4\Bin;c:\MinGW\bin  
QMAKESPEC win32-g++  
QTDIR c:\Qt\4.3.4

and the

gcc -v  
make -v  
qmake -v

are work on my system.

I have MS windows XP on my machine.

I want to write my program in netbeans.  
please help me how can i write this simple program in my  
ide or every Ide else ?  
i want programming with Qt in ruby please help me to get my goal 🙂  
please advise me to download what and how installing them and what  
should i do  
and how configure the system to solve my problem???  
i read all thread in this site about qt but most of them are about  
Linux OS and also I search the Web so much but I am so stupid and i  
don’t know  
how can I write a Graphical program with Qt in ruby Lang.

thanks for your replies.

require ‘Qt4’

app = Qt::Application.new(ARGV)

hello = Qt::PushButton.new(‘Hello World!’)  
hello.resize(100, 30)  
hello.show()

app.exec()

when I run it say that :

from C:/Ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:31:in  
`require' from C:/Ruby/lib/ruby/site_ruby/1.8/Qt.rb:1 from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in`gem\_original\_require’  
from C:/Ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:31:in  
`require’  
from C:/Documents and Settings/Amir/qt2/lib/main.rb:3

it always get error on the firs line of program  
(require ‘Qt4’)

I also test this version :

require ‘Qt’  
app = Qt::Application.new(ARGV)  
button=Qt::PushButton.new(“Hello Ruby, hello Qt!”)  
button.resize(100,30)  
button.show  
app.exec

I am going crazy.  
…  
…  
…  
…  
…  
.

Best Regards  
Amir 🙂

---

<div class="post-metadata">

**Author:** ![amoo3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@amoo3](https://www.ruby-forum.com/u/amoo3)\
**Post date:** [May 31, 2010, 9:23am UTC](https://www.ruby-forum.com/t/graphical-programming-with-qt/189385/2 "2010-05-31T09:23:42Z")

</div>

I haven’ tried qtruby \> 2 but shouldn’t require be just:

require ‘Qt’

by  
TheR

---

<div class="post-metadata">

**Author:** ![amoo3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@amoo3](https://www.ruby-forum.com/u/amoo3)\
**Post date:** [May 31, 2010, 3:25pm UTC](https://www.ruby-forum.com/t/graphical-programming-with-qt/189385/3 "2010-05-31T15:25:37Z")

</div>

On Mon, May 31, 2010 at 1:42 AM, Amir S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Probably:

require ‘rubygems’  
require ‘Qt4’

Cheers,

Han H.
