[Kde-bindings] Re: Qt-Ruby implementation of the "Address Book Example"

Richard Dale richard.dale at telefonica.net
Sun Nov 21 13:42:50 UTC 2010


On Sunday, November 21, 2010 01:13:18 pm Arno Rehn wrote:
> On Sunday 21 November 2010 00:23:54 Jérémy Blain wrote:
> > Hello,
> > 
> > I'm trying to implement the "Address Book Example" with Qt-Ruby.
> > http://doc.qt.nokia.com/4.7-snapshot/itemviews-addressbook.html
> > 
> > The problem that I face is that in the AddressWidget class, there are
> > two "addEntry" methods (one without parameter and the other with two
> > parameters) and they are both slots.
> > 
> > In Ruby, I think we can't have two methods with the same name in the same
> > class. So, what could a solution? Only one addEntry method with a hash as
> > only parameter?
> > 
> > I don't know if that was the right place to ask that...
> 
> You can define mutliple slots with the same name but different signatures.
> They will eventually all call the same ruby method, but you can make that
> method take *args or so, so it can be called with different parameters.
I think I would personally just give the two slots different names, unless 
there is a real reason why they need to be called a particular name.

-- Richard



More information about the Kde-bindings mailing list