# Re: Qt4 not supported?

**URL:** <https://www.ruby-forum.com/t/re-qt4-not-supported/168435>\
**Category:** Ruby\
**Created:** [May 20, 2009, 7:47pm UTC](https://www.ruby-forum.com/t/re-qt4-not-supported/168435 "2009-05-20T19:47:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jolivierld](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jolivierld](https://www.ruby-forum.com/u/jolivierld)\
**Post date:** [May 20, 2009, 7:47pm UTC](https://www.ruby-forum.com/t/re-qt4-not-supported/168435/1 "2009-05-20T19:47:17Z")

</div>

hello,

I have made a little change :

* * *

require (‘Qt’)

class Fen\_princ \< Qt::MainWindow

def initialize  
zone\_centrale=Qt::Widget.new  
nom=Qt::LineEdit.new  
layout=Qt::FormLayout.new  
layout.addRow(“Votre nom :”,nom)  
zone\_centrale.setLayout(layout)  
self.setCentralWidget(zone\_centrale)

end

end

app=Qt::Application.new(ARGV)  
fenetre=Fen\_princ.new()  
fenetre.show  
app.exec

* * *

and I have then this error :

* * *

C:/Users/lolveley/Documents/Visual Studio  
2008/Projects/test\_qt\_central\_widget/test\_qt\_central\_widget/rubyfile.rb:11:in  
`method_missing': Instance is not initialized, cannot call setCentralWidget (ArgumentError) from C:/Users/lolveley/Documents/Visual Studio 2008/Projects/test_qt_central_widget/test_qt_central_widget/rubyfile.rb:11:in `initialize’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/qtruby4-1.4.10-mswin32/lib/Qt/qtruby4.rb:2398:in  
`call' from c:/ruby/lib/ruby/gems/1.8/gems/qtruby4-1.4.10-mswin32/lib/Qt/qtruby4.rb:2398:in `try\_initialize’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/qtruby4-1.4.10-mswin32/lib/Qt/qtruby4.rb:2397:in  
`catch' from c:/ruby/lib/ruby/gems/1.8/gems/qtruby4-1.4.10-mswin32/lib/Qt/qtruby4.rb:2397:in `try\_initialize’  
from C:/Users/lolveley/Documents/Visual Studio  
2008/Projects/test\_qt\_central\_widget/test\_qt\_central\_widget/rubyfile.rb:19:in  
`new’  
from C:/Users/lolveley/Documents/Visual Studio  
2008/Projects/test\_qt\_central\_widget/test\_qt\_central\_widget/rubyfile.rb:19

* * *

lolveley.

* * *

Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son  
interface révolutionnaire.

> **[Yahoo](https://mail.yahoo.com/)**
>
> It's

---

<div class="post-metadata">

**Author:** ![jolivierld](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jolivierld](https://www.ruby-forum.com/u/jolivierld)\
**Post date:** [May 20, 2009, 9:07pm UTC](https://www.ruby-forum.com/t/re-qt4-not-supported/168435/2 "2009-05-20T21:07:13Z")

</div>

Stop!

I have found the error : a “super” was miussing in the head of  
initialize.

olivier.

> ```
> zone_centrale=Qt::Widget.new
> 
> ```
> 
> C:/Users/lolveley/Documents/Visual Studio  
> c:/ruby/lib/ruby/gems/1.8/gems/qtruby4-1.4.10-mswin32/lib/Qt/qtruby4.rb:2398:in  
> from C:/Users/lolveley/Documents/Visual Studio  
> 2008/Projects/test\_qt\_central\_widget/test\_qt\_central\_widget/rubyfile.rb:19
> 
> * * *
> 
> lolveley.

* * *

Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son  
interface révolutionnaire.

> **[Yahoo Mail](https://mail.yahoo.com/)**
>
> Take a trip into an upgraded, more organized inbox. Sign in and start exploring all the free, organizational tools for your email. Check out new themes, send GIFs, find every photo you've ever sent or received, and search your account faster than...
