From: Richard Dale Date: 2005-02-06T04:20:14+09:00 Subject: Re: Korundum: error when overriding a KDE::RootPixmap method Martin Traverso wrote: > Hi, > > I'm experimenting a bit with Korundum, but I'm having some problems. I > have the following code: > > require 'Korundum' > > app = Qt::Application.new([]) > widget = Qt::Widget.new > pixmap = KDE::RootPixmap.new(widget) > > class << pixmap > def updateBackground(x) > puts "update background" > end > end > > pixmap.start > > widget.show > app.setMainWidget(widget) > app.exec > > When I run it I get this error: > > ArgumentError: Cannot handle 'KSharedPixmap*' as argument of virtual > method KRootPixmap::updateBackground > from /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in > `method_missing' > from /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in > `qt_invoke' from > /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in > `method_missing' > from /usr/local/lib/ruby/site_ruby/1.8/Qt/qtruby.rb:128:in `exec' > > If I remove the class << pixmap ... end section the program runs ok (but > does not do what I want, of course). Any idea of what the error means in > this context? What am I doing wrong? That means that 'KSharedPixmap*' is an unknown argument type, and can't be marshalled from a C++ instance to a ruby value. The problem is that the KSharedPixmap code in ksharedpixmap.h is bracketed with: #ifdef Q_WS_X11 .... #endif And at the moment platform specific code is ignored when generating the bindings, so that class isn't added to the Smoke library's runtime, and can't be used from Korundum. As it happens I was just looking at another '#ifdef' related problem for Q_OS_UNIX - that code was being skipped too. I'll try and fix this for the next release of Korundum (ie for KDE 3.4). -- Richard