Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: Qt4 not supported?
lolveley
5/20/2009 5:46:00 PM
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.
http://fr.mail...
1 Answer
lolveley
5/20/2009 7:06:00 PM
0
Stop!
I have found the error : a "super" was miussing in the head of initialize.
olivier.
> 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.
http://fr.mail...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: Qt4 not supported?
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password