kdevelop 3.4, qt4, ruby installation problems
Richard Dale
richard_dale at tipitina.demon.co.uk
Tue Aug 28 17:23:20 BST 2007
On Tuesday 28 August 2007, Wolfgang Rohdewald wrote:
> Hi,
>
> today I tried the qt ruby sample application. This is Ubuntu Feisty
> with kdevelop 3.4, qt4, version 4.3.0-4ubuntu1, qtruby1.8 version
> 1.4.6.0-ubuntu1. Is this combination supposed to
> work, or what versions should I install?
>
>
> when I tried to run that sample app, I got
>
> /home/wr/kws/kws.rb:14: `uninitialized constant Kws::WDestructiveClose'
> (NameError) from /usr/lib/ruby/1.8/Qt/qtruby.rb:1678:in `try_initialize'
> from /home/wr/kws/./main.rb:5:in `new'
> from /home/wr/kws/./main.rb:5
>
> the source code is:
> def initialize()
> super( nil, "Kws", WDestructiveClose )
>
> http://doc.trolltech.com/4.3/qt.html#WidgetFlags says WDestructiveClose is
> obsolete, use Qt::WA_DeleteOnClose. So I changed that, now I got
>
> /home/wr/kws/kws.rb:14: `unresolved constructor call Kws
> ' (ArgumentError)
> from /usr/lib/ruby/1.8/Qt/qtruby.rb:1678:in `try_initialize'
> from /home/wr/kws/./main.rb:5:in `new'
> from /home/wr/kws/./main.rb:5
>
> the qmainwindow doc does not mention any string parameter for the
> constructor, so I tried
>
> super( nil, Qt::WA_DeleteOnClose )
>
> now I am getting
>
> /usr/lib/ruby/1.8/Qt/qtruby.rb:1679: `unresolved constructor call
> Qt::ToolBar ' (ArgumentError)
> from ./kws.rb:17:in `initialize'
> from /home/wr/kws/./main.rb:5:in `new'
> from /home/wr/kws/./main.rb:5
>
> and when I run the Ruby hello world example, I get
>
> /home/wr/rhw/rhw.rb:8: `undefined method `caption=' for
> #<Qt::Widget:0xb624fac0>' (NoMethodError) with this source code:
> app = Qt::Application.new(ARGV)
> widget = Qt::Widget.new
> widget.setGeometry(50, 500, 400, 400)
> widget.caption = "Hello World!"
It doesn't work because it's a Qt3 QtRuby project, and there are quite a few
changes to the Qt api between Qt3 and Qt4. You would need to create a C++ Qt4
project to see what has changed, and translate that code back to ruby. If
possible I will do a Qt4 QtRuby project sometime to match the C++ Qt4 one
(I'm not sure if new project templates are allowed in KDevelop 3.x at the
moment).
-- Richard
More information about the KDevelop
mailing list