Forum: Ruby QtRuby - Error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bcc9719bc108ba8566e63b70bc23ad9d?d=identicon&s=25 Germán alberto Giménez silva (ggerman)
on 2007-07-17 14:47
(Received via mailing list)
Hello,
I new in the ruby world.
Sorry my english, i'm argentino and speak spanish.

My question is about QtRuby. Where can tutorials, Faq, Qt's Classes?.
Qt4 work with ruby or only Qt3?
I' design form with Qt4-designer and:

rbuic mainWindow.ui > mainWindow.rb

##################################################################
ggerman@comandante:~/Qt4/example$ cat mainWindow.rb
# Form implementation generated from reading ui file 'mainWindow.ui'
#
# Created: mar jul 17 08:28:32 2007
#      by: The QtRuby User Interface Compiler (rbuic)
#
# WARNING! All changes made in this file will be lost!
require 'Qt'
class MainWindow < Qt::MainWindow
    def initialize(parent = nil, name = nil, fl = WType_TopLevel)
        super
        statusBar()
        setCentralWidget(Qt::Widget.new(self, "qt_central_widget"))
        @Widget = Qt::Widget.new(centralWidget(), "Widget")
        @MenuBar.setProperty( "geometry",
Qt::Variant.new(Qt::Rect.new(0, 0,
409, 29) ) )
        @StatusBar = Qt::StatusBar.new(centralWidget(), "StatusBar")
        languageChange()
        resize( Qt::Size.new(409, 580).expandedTo(minimumSizeHint()) )
        clearWState( WState_Polished )
    end
    #
    #  Sets the strings of the subwidgets using the current
    #  language.
    #
    def languageChange()
        setProperty("windowTitle",
Qt::Variant.new(trUtf8("MainWindow")))
    end
    protected :languageChange
end
if $0 == __FILE__
    a = Qt::Application.new(ARGV)
    w = MainWindow.new
    a.mainWidget = w
    w.show
    a.exec
end
##################################################################

mainWindow.rb:24:in `initialize': undefined method `setProperty' for
nil:NilClass (NoMethodError)
        from mainWindow.rb:47:in `new'
        from mainWindow.rb:47

Thank you for you help.

--
----
"El mundo no está en peligro por las malas personas sino por las buenas
personas que permiten la maldad." Albert Einstein.
----
Star Wars: Episodio V - El imperio contraataca:
Ten cuidado de la ira, del miedo, de la agresividad. el Lado Oscuro
ellos son.
Una vez que entras en el sendero Oscuro dominará tu destino para
siempre.
9c7f2f44463d1d4890f73e8a8229dd29?d=identicon&s=25 Caleb Tennis (Guest)
on 2007-07-17 14:56
(Received via mailing list)
> rbuic mainWindow.ui > mainWindow.rb

You're mixing QtRuby versions here.  The rbuic you are using is for
QtRuby for Qt3.
You probably need to use rbuic4 (that's what it's called on my system).

Caleb
Bcc9719bc108ba8566e63b70bc23ad9d?d=identicon&s=25 Germán alberto Giménez silva (ggerman)
on 2007-07-17 15:04
(Received via mailing list)
El Tuesday 17 July 2007 09:51:37 Caleb Tennis
escribió:> > rbuic mainWindow.ui > mainWindow.rb
>
> You're mixing QtRuby versions here.  The rbuic you are using is for QtRuby
> for Qt3. You probably need to use rbuic4 (that's what it's called on my
> system).
>
> Caleb

It's working with rbuic4
Sorry my stupid question.

Thank you very much.

--
----
"El mundo no está en peligro por las malas personas sino por las buenas
personas que permiten la maldad." Albert Einstein.
----
Star Wars: Episodio V - El imperio contraataca:
Ten cuidado de la ira, del miedo, de la agresividad. el Lado Oscuro
ellos son.
Una vez que entras en el sendero Oscuro dominará tu destino para siempre.
This topic is locked and can not be replied to.