[Kde-bindings] Missing pieces in the ruby qt4 bindings.

Richard Dale rdale at foton.es
Mon May 28 13:11:03 UTC 2007


On Saturday 26 May 2007, William Johnston wrote:
> Hi, I am having some problems with the GraphicsView component of Qt. I am
> using ruby and every so often I transelate some C++ code to ruby and it
> gives me a method not found or class not found. In particular,
> Qt::GraphicsSvgItem is nonexistent, and Qt::Painter.fillRect.
>
> If I do something like: test = Qt::GraphicsSvgItem.new it errors out.
>
> Am I missing something?
>
> I am using the qt4 ruby bindings, version 1.4.7.
I think that class was added after qtruby 1.4.7 was released. It's in the kde 
svn version of qtruby:

irb(main):001:0> app = Qt::Application.new(ARGV)
=> #<Qt::Application:0xb7c67930 objectName="irb">
irb(main):002:0> test = Qt::GraphicsSvgItem.new
=> #<Qt::GraphicsSvgItem:0xb7a8a39c objectName="">
irb(main):003:0> w = Qt::Widget.new
=> #<Qt::Widget:0xb7a79344 objectName="", x=0, y=0, width=640, height=480>
irb(main):004:0> painter = Qt::Painter.new(w)
QPainter::begin: Widget painting can only begin as a result of a paintEvent
=> #<Qt::Painter:0xb7a44f40>
irb(main):005:0> painter.fillRect(Qt::Rect.new, Qt::Brush.new)
=> nil

You could add the qgraphicssvgitem.h to smoke/qt/header_list, and regenerate 
your version of the smoke library.

What were you passing to Qt::Painter.fillRect() - was it an incorrect argument 
type?

> Please CC me as I am not subscribed to the list due to seeing spam in the
> archives.
The help forum on the Rubyforge Korundum site is another place to ask, and it 
doesn't get messed up by spam attacks.

-- Richard



More information about the Kde-bindings mailing list