From: Richard Dale Date: 2005-02-07T21:30:14+09:00 Subject: Re: Korundum: error when overriding a KDE::RootPixmap method Richard Dale wrote: > 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). I've tried getting the KSharedPixmap class wrapped, but it uses multiple inheritance with a diamond shaped hierachy and I had trouble getting the C++ code for the binding to compile. So it might not be possible to include it I'm afraid. -- Richard