[Kde-bindings] Qt3 Kimono version - got it compiled

Richard Dale Richard_Dale at tipitina.demon.co.uk
Fri Nov 25 18:29:33 UTC 2005


On Friday 25 November 2005 15:43, Arno Rehn wrote:
> > I checked the sources in - even if they have bad hacks it's a starting
> > point. I backported qyoto.cpp and handlers.cpp to Qt3 and called them
> > qt3qyoto.cpp and qt3handlers.cpp, and added a target to the makefile to
> > build them. Those sources are very similar to Qt.cpp and handlers.cpp in
> > the qtruby project.
> >
> > The next step is to look up a method in the Smoke lib and successfully
> > call it..
> >
> > None of the methods involved in getting a 'hello world' working are over
> > loaded, so we don't have to worry about overloaded method resolution on
> > the argument types for now. That will involve adding an instance variable
> > to SmokeInvocation called 'callSignature' which will have a String
> > containing the C++ type signature of the method about to be called. It
> > will involve generating an assignment to that before each method is
> > called through SmokeInvocation.Invoke().
>
> Ok, it works - if you want to call it like this. I can create a MainForm,
> Layout, Buttons etc. and can run my app. But I can't display a "Hello
> World!" because the function "SetCaption" always gives me an error
> (System.MissingMethodException) , even if it isn't overloaded.
> But it seems to be the same problem as with overloaded functions, the error
> is the same.
Good news! That was fast work, maybe we ought to turn it into a proper 
project?

I can't see anything special about SetCaption():

baldhead duke 1071% grep SetCaption *.cs
QDockWindow.cs:         public new void SetCaption(string s) {
QDockWindow.cs:                 ProxyQDockWindow().SetCaption(s);
QWidget.cs:             public virtual void SetCaption(string arg1) {
QWidget.cs:                     ProxyQWidget().SetCaption(arg1);

Is it the only method that is passed an argument in your example?

It is certainly in the Smoke library. I put debugging on this QtRuby example 
to trace the call, and it looks fine to me:

require 'Qt'

a = Qt::Application.new(ARGV)
hello = Qt::PushButton.new('Hello World!', nil)
hello.resize(100, 30)
Qt.debug_level = Qt::DebugLevel::High
hello.setCaption("MyCaption")
Qt.debug_level = Qt::DebugLevel::Off
a.setMainWidget(hello)
hello.show()
a.exec()

ruby t1.rb
classname    == QPushButton
:: method == setCaption
-> methodIds == [13096]
candidate list:
        void QWidget::setCaption(const QString&)  (13096)
matching => 13096
      const QString& (s)
match => 13096 score: 3
Resolved to id: 13096
setCurrentMethod(13096)

But from the error message you're getting, it isn't getting as far as looking 
the method up in the Smoke library.

Can you post the C# sources, and the code you were using. Do you have a KDE 
svn account? If so, check it into the playground/bindings/kimono project and 
then I can debug it. Otherwise, if you can put it on your web site and I'll 
download it.

-- Richard



More information about the Kde-bindings mailing list